From 1e6c5846ea1dc429be789893be92ca4cdd2ccc57 Mon Sep 17 00:00:00 2001 From: megboyzz Date: Sun, 15 Dec 2024 22:13:44 +0300 Subject: [PATCH] try to cut devmenu --- app/src/main/AndroidManifest.xml | 15 +- .../java/com/ea/ironmonkey/GameActivity.kt | 20 +- .../com/ea/nimble/ApplicationEnvironment.java | 34 - .../ea/nimble/ApplicationEnvironmentImpl.java | 504 ------- .../com/ea/nimble/ApplicationLifecycle.java | 78 -- .../ea/nimble/ApplicationLifecycleImpl.java | 392 ------ .../nimble/BackgroundNetworkConnection.java | 16 - app/src/main/java/com/ea/nimble/Base.java | 39 - app/src/main/java/com/ea/nimble/BaseCore.java | 371 ----- .../com/ea/nimble/ByteBufferIOStream.java | 305 ----- .../main/java/com/ea/nimble/Component.java | 27 - .../java/com/ea/nimble/ComponentManager.java | 151 -- .../java/com/ea/nimble/EASPDataLoader.java | 178 --- .../main/java/com/ea/nimble/Encryptor.java | 57 - .../ea/nimble/EnvironmentDataContainer.java | 325 ----- app/src/main/java/com/ea/nimble/Error.java | 180 --- app/src/main/java/com/ea/nimble/Facebook.java | 21 - .../java/com/ea/nimble/FacebookCallback.java | 11 - .../main/java/com/ea/nimble/FacebookImpl.java | 173 --- app/src/main/java/com/ea/nimble/Global.java | 31 - .../main/java/com/ea/nimble/HttpError.java | 21 - .../main/java/com/ea/nimble/HttpRequest.java | 75 - .../main/java/com/ea/nimble/HttpResponse.java | 79 -- .../ea/nimble/IApplicationEnvironment.java | 72 - .../com/ea/nimble/IApplicationLifecycle.java | 88 -- .../main/java/com/ea/nimble/IFacebook.java | 50 - .../main/java/com/ea/nimble/IHttpRequest.java | 60 - .../java/com/ea/nimble/IHttpResponse.java | 30 - app/src/main/java/com/ea/nimble/ILog.java | 17 - app/src/main/java/com/ea/nimble/INetwork.java | 31 - .../nimble/IOperationalTelemetryDispatch.java | 24 - .../com/ea/nimble/IPersistenceService.java | 18 - .../com/ea/nimble/ISynergyEnvironment.java | 48 - .../java/com/ea/nimble/ISynergyIdManager.java | 17 - .../java/com/ea/nimble/ISynergyNetwork.java | 20 - .../java/com/ea/nimble/ISynergyRequest.java | 20 - .../java/com/ea/nimble/ISynergyResponse.java | 18 - app/src/main/java/com/ea/nimble/Log.java | 84 -- app/src/main/java/com/ea/nimble/LogImpl.java | 473 ------- .../main/java/com/ea/nimble/LogSource.java | 9 - app/src/main/java/com/ea/nimble/Network.java | 72 - .../java/com/ea/nimble/NetworkConnection.java | 830 ----------- .../ea/nimble/NetworkConnectionCallback.java | 11 - .../ea/nimble/NetworkConnectionHandle.java | 31 - .../main/java/com/ea/nimble/NetworkImpl.java | 486 ------- .../com/ea/nimble/NimbleConfiguration.java | 47 - .../com/ea/nimble/NimbleFacebookError.java | 45 - .../nimble/OperationalTelemetryDispatch.java | 17 - .../OperationalTelemetryDispatchImpl.java | 154 --- .../ea/nimble/OperationalTelemetryEvent.java | 16 - .../nimble/OperationalTelemetryEventImpl.java | 41 - .../main/java/com/ea/nimble/Persistence.java | 405 ------ .../com/ea/nimble/PersistenceService.java | 116 -- .../com/ea/nimble/PersistenceServiceImpl.java | 149 -- app/src/main/java/com/ea/nimble/QA.java | 13 - .../com/ea/nimble/SynergyEnvironment.java | 42 - .../com/ea/nimble/SynergyEnvironmentImpl.java | 400 ------ .../ea/nimble/SynergyEnvironmentUpdater.java | 403 ------ .../java/com/ea/nimble/SynergyIdManager.java | 19 - .../com/ea/nimble/SynergyIdManagerError.java | 38 - .../com/ea/nimble/SynergyIdManagerImpl.java | 231 ---- .../java/com/ea/nimble/SynergyNetwork.java | 16 - .../ea/nimble/SynergyNetworkConnection.java | 243 ---- .../SynergyNetworkConnectionCallback.java | 11 - .../SynergyNetworkConnectionHandle.java | 31 - .../com/ea/nimble/SynergyNetworkImpl.java | 140 -- .../java/com/ea/nimble/SynergyRequest.java | 121 -- .../java/com/ea/nimble/SynergyResponse.java | 72 - .../com/ea/nimble/SynergyServerError.java | 47 - app/src/main/java/com/ea/nimble/Timer.java | 136 -- app/src/main/java/com/ea/nimble/Utility.java | 274 ---- .../ea/nimble/bridge/BaseNativeCallback.java | 69 - .../nimble/bridge/FacebookNativeCallback.java | 26 - .../nimble/bridge/FriendsNativeCallback.java | 45 - ...dentityGenericAuthenticationConductor.java | 33 - ...ntityMigrationAuthenticationConductor.java | 38 - .../nimble/bridge/IdentityNativeCallback.java | 43 - .../IdentityPlainAuthenticationConductor.java | 31 - .../ea/nimble/bridge/MTXNativeCallback.java | 44 - .../com/ea/nimble/friends/INimbleFriends.java | 9 - .../friends/INimbleOriginFriendsService.java | 36 - .../ea/nimble/friends/NimbleFacebookUser.java | 17 - .../com/ea/nimble/friends/NimbleFriends.java | 12 - .../ea/nimble/friends/NimbleFriendsError.java | 64 - .../ea/nimble/friends/NimbleFriendsImpl.java | 105 -- .../ea/nimble/friends/NimbleFriendsList.java | 65 - .../friends/NimbleFriendsListFacebook.java | 99 -- .../nimble/friends/NimbleFriendsListImpl.java | 635 --------- .../friends/NimbleFriendsListOrigin.java | 418 ------ .../NimbleFriendsRangeRefreshResult.java | 25 - .../NimbleFriendsRefreshBasicInfo.java | 39 - .../friends/NimbleFriendsRefreshCallback.java | 6 - .../NimbleFriendsRefreshIdentityInfo.java | 16 - .../friends/NimbleFriendsRefreshImageUrl.java | 16 - .../friends/NimbleFriendsRefreshResult.java | 24 - .../friends/NimbleFriendsRefreshScope.java | 5 - .../nimble/friends/NimbleFriendsUtility.java | 65 - .../friends/NimbleOriginFriendsService.java | 12 - .../NimbleOriginFriendsServiceImpl.java | 1209 ----------------- .../com/ea/nimble/friends/NimbleUser.java | 233 ---- .../nimble/friends/UserInfoFromIdentity.java | 28 - .../identity/AuthenticatorAnonymous.java | 239 ---- .../ea/nimble/identity/AuthenticatorBase.java | 1202 ---------------- .../identity/AuthenticatorFacebook.java | 210 --- .../nimble/identity/AuthenticatorOrigin.java | 87 -- .../ea/nimble/identity/INimbleIdentity.java | 39 - ...NimbleIdentityAuthenticationConductor.java | 5 - .../INimbleIdentityAuthenticator.java | 70 - ...dentityGenericAuthenticationConductor.java | 8 - .../INimbleIdentityGenericLoginResolver.java | 17 - .../INimbleIdentityGenericLogoutResolver.java | 12 - ...ntityMigrationAuthenticationConductor.java | 10 - ...INimbleIdentityMigrationLoginResolver.java | 17 - ...NimbleIdentityMigrationLogoutResolver.java | 12 - ...imbleIdentityPendingMigrationResolver.java | 12 - ...eIdentityPlainAuthenticationConductor.java | 8 - .../ea/nimble/identity/NimbleIdentity.java | 12 - ...dentityAuthenticationConductorHandler.java | 8 - .../nimble/identity/NimbleIdentityConfig.java | 105 -- .../nimble/identity/NimbleIdentityError.java | 75 - ...GenericAuthenticationConductorHandler.java | 25 - .../NimbleIdentityGenericLoginResolver.java | 51 - .../NimbleIdentityGenericLogoutResolver.java | 36 - .../nimble/identity/NimbleIdentityImpl.java | 558 -------- .../identity/NimbleIdentityLoginParams.java | 111 -- ...grationAuthenticationConductorHandler.java | 94 -- .../NimbleIdentityMigrationLoginResolver.java | 48 - .../NimbleIdentityMigrationObject.java | 25 - ...imbleIdentityPendingMigrationResolver.java | 41 - .../identity/NimbleIdentityPersona.java | 518 ------- .../identity/NimbleIdentityPidInfo.java | 201 --- ...tyPlainAuthenticationConductorHandler.java | 26 - .../nimble/identity/NimbleIdentityToken.java | 76 -- .../identity/NimbleIdentityUserInfo.java | 92 -- .../identity/NimbleIdentityUtility.java | 92 -- .../ea/nimble/inappmessage/IInAppMessage.java | 10 - .../ea/nimble/inappmessage/InAppMessage.java | 26 - .../nimble/inappmessage/InAppMessageImpl.java | 304 ----- .../com/ea/nimble/inappmessage/Message.java | 60 - .../java/com/ea/nimble/mtx/INimbleMTX.java | 54 - .../com/ea/nimble/mtx/NimbleCatalogItem.java | 32 - .../java/com/ea/nimble/mtx/NimbleMTX.java | 23 - .../com/ea/nimble/mtx/NimbleMTXError.java | 57 - .../ea/nimble/mtx/NimbleMTXTransaction.java | 46 - .../mtx/catalog/synergy/ItemCategory.java | 12 - .../mtx/catalog/synergy/SynergyCatalog.java | 219 --- .../catalog/synergy/SynergyCatalogItem.java | 93 -- .../IPushNotification.java | 15 - .../PushNotification.java | 230 ---- .../PushNotificationImpl.java | 237 ---- .../com/ea/nimble/tracking/ITracking.java | 21 - .../tracking/NimbleTrackingImplBase.java | 807 ----------- .../tracking/NimbleTrackingS2SComponent.java | 22 - .../tracking/NimbleTrackingS2SImpl.java | 416 ------ .../NimbleTrackingSynergyComponent.java | 22 - .../tracking/NimbleTrackingSynergyImpl.java | 679 --------- .../tracking/NimbleTrackingThreadManager.java | 51 - .../tracking/NimbleTrackingThreadProxy.java | 156 --- .../ea/nimble/tracking/ReferrerReceiver.java | 79 -- .../ea/nimble/tracking/SynergyConstants.java | 254 ---- .../java/com/ea/nimble/tracking/Tracking.java | 104 -- .../tracking/TrackingBaseSessionObject.java | 51 - .../tracking/TrackingEventWrangler.java | 199 --- .../com/ea/nimble/tracking/TrackingS2S.java | 15 - .../ea/nimble/tracking/TrackingSynergy.java | 15 - .../ea/nimble/tracking/TrackingWrangler.java | 136 -- 166 files changed, 15 insertions(+), 20878 deletions(-) delete mode 100644 app/src/main/java/com/ea/nimble/ApplicationEnvironment.java delete mode 100644 app/src/main/java/com/ea/nimble/ApplicationEnvironmentImpl.java delete mode 100644 app/src/main/java/com/ea/nimble/ApplicationLifecycle.java delete mode 100644 app/src/main/java/com/ea/nimble/ApplicationLifecycleImpl.java delete mode 100644 app/src/main/java/com/ea/nimble/BackgroundNetworkConnection.java delete mode 100644 app/src/main/java/com/ea/nimble/Base.java delete mode 100644 app/src/main/java/com/ea/nimble/BaseCore.java delete mode 100644 app/src/main/java/com/ea/nimble/ByteBufferIOStream.java delete mode 100644 app/src/main/java/com/ea/nimble/Component.java delete mode 100644 app/src/main/java/com/ea/nimble/ComponentManager.java delete mode 100644 app/src/main/java/com/ea/nimble/EASPDataLoader.java delete mode 100644 app/src/main/java/com/ea/nimble/Encryptor.java delete mode 100644 app/src/main/java/com/ea/nimble/EnvironmentDataContainer.java delete mode 100644 app/src/main/java/com/ea/nimble/Error.java delete mode 100644 app/src/main/java/com/ea/nimble/Facebook.java delete mode 100644 app/src/main/java/com/ea/nimble/FacebookCallback.java delete mode 100644 app/src/main/java/com/ea/nimble/FacebookImpl.java delete mode 100644 app/src/main/java/com/ea/nimble/Global.java delete mode 100644 app/src/main/java/com/ea/nimble/HttpError.java delete mode 100644 app/src/main/java/com/ea/nimble/HttpRequest.java delete mode 100644 app/src/main/java/com/ea/nimble/HttpResponse.java delete mode 100644 app/src/main/java/com/ea/nimble/IApplicationEnvironment.java delete mode 100644 app/src/main/java/com/ea/nimble/IApplicationLifecycle.java delete mode 100644 app/src/main/java/com/ea/nimble/IFacebook.java delete mode 100644 app/src/main/java/com/ea/nimble/IHttpRequest.java delete mode 100644 app/src/main/java/com/ea/nimble/IHttpResponse.java delete mode 100644 app/src/main/java/com/ea/nimble/ILog.java delete mode 100644 app/src/main/java/com/ea/nimble/INetwork.java delete mode 100644 app/src/main/java/com/ea/nimble/IOperationalTelemetryDispatch.java delete mode 100644 app/src/main/java/com/ea/nimble/IPersistenceService.java delete mode 100644 app/src/main/java/com/ea/nimble/ISynergyEnvironment.java delete mode 100644 app/src/main/java/com/ea/nimble/ISynergyIdManager.java delete mode 100644 app/src/main/java/com/ea/nimble/ISynergyNetwork.java delete mode 100644 app/src/main/java/com/ea/nimble/ISynergyRequest.java delete mode 100644 app/src/main/java/com/ea/nimble/ISynergyResponse.java delete mode 100644 app/src/main/java/com/ea/nimble/Log.java delete mode 100644 app/src/main/java/com/ea/nimble/LogImpl.java delete mode 100644 app/src/main/java/com/ea/nimble/LogSource.java delete mode 100644 app/src/main/java/com/ea/nimble/Network.java delete mode 100644 app/src/main/java/com/ea/nimble/NetworkConnection.java delete mode 100644 app/src/main/java/com/ea/nimble/NetworkConnectionCallback.java delete mode 100644 app/src/main/java/com/ea/nimble/NetworkConnectionHandle.java delete mode 100644 app/src/main/java/com/ea/nimble/NetworkImpl.java delete mode 100644 app/src/main/java/com/ea/nimble/NimbleConfiguration.java delete mode 100644 app/src/main/java/com/ea/nimble/NimbleFacebookError.java delete mode 100644 app/src/main/java/com/ea/nimble/OperationalTelemetryDispatch.java delete mode 100644 app/src/main/java/com/ea/nimble/OperationalTelemetryDispatchImpl.java delete mode 100644 app/src/main/java/com/ea/nimble/OperationalTelemetryEvent.java delete mode 100644 app/src/main/java/com/ea/nimble/OperationalTelemetryEventImpl.java delete mode 100644 app/src/main/java/com/ea/nimble/Persistence.java delete mode 100644 app/src/main/java/com/ea/nimble/PersistenceService.java delete mode 100644 app/src/main/java/com/ea/nimble/PersistenceServiceImpl.java delete mode 100644 app/src/main/java/com/ea/nimble/QA.java delete mode 100644 app/src/main/java/com/ea/nimble/SynergyEnvironment.java delete mode 100644 app/src/main/java/com/ea/nimble/SynergyEnvironmentImpl.java delete mode 100644 app/src/main/java/com/ea/nimble/SynergyEnvironmentUpdater.java delete mode 100644 app/src/main/java/com/ea/nimble/SynergyIdManager.java delete mode 100644 app/src/main/java/com/ea/nimble/SynergyIdManagerError.java delete mode 100644 app/src/main/java/com/ea/nimble/SynergyIdManagerImpl.java delete mode 100644 app/src/main/java/com/ea/nimble/SynergyNetwork.java delete mode 100644 app/src/main/java/com/ea/nimble/SynergyNetworkConnection.java delete mode 100644 app/src/main/java/com/ea/nimble/SynergyNetworkConnectionCallback.java delete mode 100644 app/src/main/java/com/ea/nimble/SynergyNetworkConnectionHandle.java delete mode 100644 app/src/main/java/com/ea/nimble/SynergyNetworkImpl.java delete mode 100644 app/src/main/java/com/ea/nimble/SynergyRequest.java delete mode 100644 app/src/main/java/com/ea/nimble/SynergyResponse.java delete mode 100644 app/src/main/java/com/ea/nimble/SynergyServerError.java delete mode 100644 app/src/main/java/com/ea/nimble/Timer.java delete mode 100644 app/src/main/java/com/ea/nimble/Utility.java delete mode 100644 app/src/main/java/com/ea/nimble/bridge/BaseNativeCallback.java delete mode 100644 app/src/main/java/com/ea/nimble/bridge/FacebookNativeCallback.java delete mode 100644 app/src/main/java/com/ea/nimble/bridge/FriendsNativeCallback.java delete mode 100644 app/src/main/java/com/ea/nimble/bridge/IdentityGenericAuthenticationConductor.java delete mode 100644 app/src/main/java/com/ea/nimble/bridge/IdentityMigrationAuthenticationConductor.java delete mode 100644 app/src/main/java/com/ea/nimble/bridge/IdentityNativeCallback.java delete mode 100644 app/src/main/java/com/ea/nimble/bridge/IdentityPlainAuthenticationConductor.java delete mode 100644 app/src/main/java/com/ea/nimble/bridge/MTXNativeCallback.java delete mode 100644 app/src/main/java/com/ea/nimble/friends/INimbleFriends.java delete mode 100644 app/src/main/java/com/ea/nimble/friends/INimbleOriginFriendsService.java delete mode 100644 app/src/main/java/com/ea/nimble/friends/NimbleFacebookUser.java delete mode 100644 app/src/main/java/com/ea/nimble/friends/NimbleFriends.java delete mode 100644 app/src/main/java/com/ea/nimble/friends/NimbleFriendsError.java delete mode 100644 app/src/main/java/com/ea/nimble/friends/NimbleFriendsImpl.java delete mode 100644 app/src/main/java/com/ea/nimble/friends/NimbleFriendsList.java delete mode 100644 app/src/main/java/com/ea/nimble/friends/NimbleFriendsListFacebook.java delete mode 100644 app/src/main/java/com/ea/nimble/friends/NimbleFriendsListImpl.java delete mode 100644 app/src/main/java/com/ea/nimble/friends/NimbleFriendsListOrigin.java delete mode 100644 app/src/main/java/com/ea/nimble/friends/NimbleFriendsRangeRefreshResult.java delete mode 100644 app/src/main/java/com/ea/nimble/friends/NimbleFriendsRefreshBasicInfo.java delete mode 100644 app/src/main/java/com/ea/nimble/friends/NimbleFriendsRefreshCallback.java delete mode 100644 app/src/main/java/com/ea/nimble/friends/NimbleFriendsRefreshIdentityInfo.java delete mode 100644 app/src/main/java/com/ea/nimble/friends/NimbleFriendsRefreshImageUrl.java delete mode 100644 app/src/main/java/com/ea/nimble/friends/NimbleFriendsRefreshResult.java delete mode 100644 app/src/main/java/com/ea/nimble/friends/NimbleFriendsRefreshScope.java delete mode 100644 app/src/main/java/com/ea/nimble/friends/NimbleFriendsUtility.java delete mode 100644 app/src/main/java/com/ea/nimble/friends/NimbleOriginFriendsService.java delete mode 100644 app/src/main/java/com/ea/nimble/friends/NimbleOriginFriendsServiceImpl.java delete mode 100644 app/src/main/java/com/ea/nimble/friends/NimbleUser.java delete mode 100644 app/src/main/java/com/ea/nimble/friends/UserInfoFromIdentity.java delete mode 100644 app/src/main/java/com/ea/nimble/identity/AuthenticatorAnonymous.java delete mode 100644 app/src/main/java/com/ea/nimble/identity/AuthenticatorBase.java delete mode 100644 app/src/main/java/com/ea/nimble/identity/AuthenticatorFacebook.java delete mode 100644 app/src/main/java/com/ea/nimble/identity/AuthenticatorOrigin.java delete mode 100644 app/src/main/java/com/ea/nimble/identity/INimbleIdentity.java delete mode 100644 app/src/main/java/com/ea/nimble/identity/INimbleIdentityAuthenticationConductor.java delete mode 100644 app/src/main/java/com/ea/nimble/identity/INimbleIdentityAuthenticator.java delete mode 100644 app/src/main/java/com/ea/nimble/identity/INimbleIdentityGenericAuthenticationConductor.java delete mode 100644 app/src/main/java/com/ea/nimble/identity/INimbleIdentityGenericLoginResolver.java delete mode 100644 app/src/main/java/com/ea/nimble/identity/INimbleIdentityGenericLogoutResolver.java delete mode 100644 app/src/main/java/com/ea/nimble/identity/INimbleIdentityMigrationAuthenticationConductor.java delete mode 100644 app/src/main/java/com/ea/nimble/identity/INimbleIdentityMigrationLoginResolver.java delete mode 100644 app/src/main/java/com/ea/nimble/identity/INimbleIdentityMigrationLogoutResolver.java delete mode 100644 app/src/main/java/com/ea/nimble/identity/INimbleIdentityPendingMigrationResolver.java delete mode 100644 app/src/main/java/com/ea/nimble/identity/INimbleIdentityPlainAuthenticationConductor.java delete mode 100644 app/src/main/java/com/ea/nimble/identity/NimbleIdentity.java delete mode 100644 app/src/main/java/com/ea/nimble/identity/NimbleIdentityAuthenticationConductorHandler.java delete mode 100644 app/src/main/java/com/ea/nimble/identity/NimbleIdentityConfig.java delete mode 100644 app/src/main/java/com/ea/nimble/identity/NimbleIdentityError.java delete mode 100644 app/src/main/java/com/ea/nimble/identity/NimbleIdentityGenericAuthenticationConductorHandler.java delete mode 100644 app/src/main/java/com/ea/nimble/identity/NimbleIdentityGenericLoginResolver.java delete mode 100644 app/src/main/java/com/ea/nimble/identity/NimbleIdentityGenericLogoutResolver.java delete mode 100644 app/src/main/java/com/ea/nimble/identity/NimbleIdentityImpl.java delete mode 100644 app/src/main/java/com/ea/nimble/identity/NimbleIdentityLoginParams.java delete mode 100644 app/src/main/java/com/ea/nimble/identity/NimbleIdentityMigrationAuthenticationConductorHandler.java delete mode 100644 app/src/main/java/com/ea/nimble/identity/NimbleIdentityMigrationLoginResolver.java delete mode 100644 app/src/main/java/com/ea/nimble/identity/NimbleIdentityMigrationObject.java delete mode 100644 app/src/main/java/com/ea/nimble/identity/NimbleIdentityPendingMigrationResolver.java delete mode 100644 app/src/main/java/com/ea/nimble/identity/NimbleIdentityPersona.java delete mode 100644 app/src/main/java/com/ea/nimble/identity/NimbleIdentityPidInfo.java delete mode 100644 app/src/main/java/com/ea/nimble/identity/NimbleIdentityPlainAuthenticationConductorHandler.java delete mode 100644 app/src/main/java/com/ea/nimble/identity/NimbleIdentityToken.java delete mode 100644 app/src/main/java/com/ea/nimble/identity/NimbleIdentityUserInfo.java delete mode 100644 app/src/main/java/com/ea/nimble/identity/NimbleIdentityUtility.java delete mode 100644 app/src/main/java/com/ea/nimble/inappmessage/IInAppMessage.java delete mode 100644 app/src/main/java/com/ea/nimble/inappmessage/InAppMessage.java delete mode 100644 app/src/main/java/com/ea/nimble/inappmessage/InAppMessageImpl.java delete mode 100644 app/src/main/java/com/ea/nimble/inappmessage/Message.java delete mode 100644 app/src/main/java/com/ea/nimble/mtx/INimbleMTX.java delete mode 100644 app/src/main/java/com/ea/nimble/mtx/NimbleCatalogItem.java delete mode 100644 app/src/main/java/com/ea/nimble/mtx/NimbleMTX.java delete mode 100644 app/src/main/java/com/ea/nimble/mtx/NimbleMTXError.java delete mode 100644 app/src/main/java/com/ea/nimble/mtx/NimbleMTXTransaction.java delete mode 100644 app/src/main/java/com/ea/nimble/mtx/catalog/synergy/ItemCategory.java delete mode 100644 app/src/main/java/com/ea/nimble/mtx/catalog/synergy/SynergyCatalog.java delete mode 100644 app/src/main/java/com/ea/nimble/mtx/catalog/synergy/SynergyCatalogItem.java delete mode 100644 app/src/main/java/com/ea/nimble/pushnotificationgoogle/IPushNotification.java delete mode 100644 app/src/main/java/com/ea/nimble/pushnotificationgoogle/PushNotification.java delete mode 100644 app/src/main/java/com/ea/nimble/pushnotificationgoogle/PushNotificationImpl.java delete mode 100644 app/src/main/java/com/ea/nimble/tracking/ITracking.java delete mode 100644 app/src/main/java/com/ea/nimble/tracking/NimbleTrackingImplBase.java delete mode 100644 app/src/main/java/com/ea/nimble/tracking/NimbleTrackingS2SComponent.java delete mode 100644 app/src/main/java/com/ea/nimble/tracking/NimbleTrackingS2SImpl.java delete mode 100644 app/src/main/java/com/ea/nimble/tracking/NimbleTrackingSynergyComponent.java delete mode 100644 app/src/main/java/com/ea/nimble/tracking/NimbleTrackingSynergyImpl.java delete mode 100644 app/src/main/java/com/ea/nimble/tracking/NimbleTrackingThreadManager.java delete mode 100644 app/src/main/java/com/ea/nimble/tracking/NimbleTrackingThreadProxy.java delete mode 100644 app/src/main/java/com/ea/nimble/tracking/ReferrerReceiver.java delete mode 100644 app/src/main/java/com/ea/nimble/tracking/SynergyConstants.java delete mode 100644 app/src/main/java/com/ea/nimble/tracking/Tracking.java delete mode 100644 app/src/main/java/com/ea/nimble/tracking/TrackingBaseSessionObject.java delete mode 100644 app/src/main/java/com/ea/nimble/tracking/TrackingEventWrangler.java delete mode 100644 app/src/main/java/com/ea/nimble/tracking/TrackingS2S.java delete mode 100644 app/src/main/java/com/ea/nimble/tracking/TrackingSynergy.java delete mode 100644 app/src/main/java/com/ea/nimble/tracking/TrackingWrangler.java 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 list = (List) SynergyEnvironmentUpdater.this.m_environmentForSynergyStartUp.getGetDirectionResponseDictionary().get("serverData"); - SynergyEnvironmentUpdater.this.m_environmentForSynergyStartUp.setServerUrls(new HashMap()); - if (list != null) { - for (Map map : list) { - SynergyEnvironmentUpdater.this.m_environmentForSynergyStartUp.getServerUrls().put((String) map.get("key"), (String)map.get("value")); - } - } - if (SynergyEnvironmentUpdater.this.m_environmentForSynergyStartUp.getServerUrls().size() == 0) { - SynergyEnvironmentUpdater.this.onStartUpSequenceFinished(new Error(Error.Code.NOT_AVAILABLE, "No Synergy server URLs available.")); - } else if (SynergyEnvironmentUpdater.this.m_previousValidEnvironmentData == null || !Utility.validString(SynergyEnvironmentUpdater.this.m_previousValidEnvironmentData.getEADeviceId())) { - String loadEADeviceId = EASPDataLoader.loadEADeviceId(); - if (loadEADeviceId != null) { - SynergyEnvironmentUpdater.this.callSynergyValidateEADeviceId(loadEADeviceId); - } else { - SynergyEnvironmentUpdater.this.callSynergyGetEADeviceId(); - } - } else { - SynergyEnvironmentUpdater.this.callSynergyValidateEADeviceId(SynergyEnvironmentUpdater.this.m_previousValidEnvironmentData.getEADeviceId()); - } - } else if (!(error instanceof SynergyServerError)) { - boolean isTimeoutError = SynergyEnvironmentUpdater.this.isTimeoutError(error); - if (isTimeoutError || SynergyEnvironmentUpdater.this.m_getDirectionRetryCount >= 3) { - SynergyEnvironmentUpdater.this.m_getDirectionRetryCount = 0; - if (isTimeoutError) { - SynergyEnvironmentUpdater.this.onStartUpSequenceFinished(new Error(Error.Code.SYNERGY_GET_DIRECTION_TIMEOUT, "Synergy /getDirectionByPackage request timed out.", error)); - } else { - SynergyEnvironmentUpdater.this.onStartUpSequenceFinished(error); - } - } else { - SynergyEnvironmentUpdater.access$708(SynergyEnvironmentUpdater.this); - Log.Helper.LOGD(this, "GetDirection, call failed. Making retry attempt number %d.", Long.valueOf(SynergyEnvironmentUpdater.this.m_getDirectionRetryCount)); - SynergyEnvironmentUpdater.this.callSynergyGetDirection(); - } - } else if (((SynergyServerError) error).isError(SynergyEnvironmentUpdater.SYNERGY_DIRECTOR_RESPONSE_ERROR_CODE_SERVERS_FULL)) { - SynergyEnvironmentUpdater.this.onStartUpSequenceFinished(new Error(Error.Code.SYNERGY_SERVER_FULL, "Synergy ServerUnavailable signal received.", error)); - } - } - }); - } - } - - /* JADX INFO: Access modifiers changed from: private */ - public void callSynergyGetEADeviceId() { - int phoneType; - String string; - String SHA256HashString; - EnvironmentDataContainer environmentDataContainer = this.m_environmentForSynergyStartUp; - HashMap hashMap = new HashMap(); - hashMap.put("apiVer", "1.0.0"); - hashMap.put("hwId", environmentDataContainer.getEAHardwareId()); - String mACAddress = ApplicationEnvironment.getComponent().getMACAddress(); - if (Utility.validString(mACAddress) && (SHA256HashString = Utility.SHA256HashString(mACAddress)) != null) { - hashMap.put("macHash", SHA256HashString); - } - IApplicationEnvironment component = ApplicationEnvironment.getComponent(); - Context context = null; - if (component != null) { - context = component.getApplicationContext(); - } - if (!(context == null || (string = Settings.Secure.getString(component.getApplicationContext().getContentResolver(), "android_id")) == null)) { - hashMap.put("androidId", string); - } - if (context != null) { - TelephonyManager telephonyManager = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE); - PackageManager packageManager = context.getPackageManager(); - if (!(telephonyManager == null || packageManager.checkPermission("android.permission.READ_PHONE_STATE", context.getPackageName()) != 0 || (phoneType = telephonyManager.getPhoneType()) == 0)) { - String deviceId = telephonyManager.getDeviceId(); - if (Utility.validString(deviceId)) { - String str = "imei"; - if (phoneType == 2) { - str = "meid"; - } - hashMap.put(str, deviceId); - } - } - } - this.m_synergyNetworkConnectionHandle = SynergyNetwork.getComponent().sendGetRequest(this.m_environmentForSynergyStartUp.getServerUrlWithKey(SynergyEnvironment.SERVER_URL_KEY_SYNERGY_USER), "/user/api/android/getDeviceID", hashMap, new SynergyNetworkConnectionCallback() { // from class: com.ea.nimble.SynergyEnvironmentUpdater.2 - @Override // com.ea.nimble.SynergyNetworkConnectionCallback - public void callback(SynergyNetworkConnectionHandle synergyNetworkConnectionHandle) { - SynergyEnvironmentUpdater.this.m_synergyNetworkConnectionHandle = null; - Exception error = synergyNetworkConnectionHandle.getResponse().getError(); - if (error == null) { - Log.Helper.LOGD(this, "GetEADeviceID Success"); - SynergyEnvironmentUpdater.this.m_environmentForSynergyStartUp.setEADeviceId((String) synergyNetworkConnectionHandle.getResponse().getJsonData().get("deviceId")); - SynergyEnvironmentUpdater.this.callSynergyGetAnonUid(); - } else if (SynergyEnvironmentUpdater.this.isTimeoutError(error) || SynergyEnvironmentUpdater.this.m_getEADeviceIDRetryCount >= 3) { - SynergyEnvironmentUpdater.this.m_getEADeviceIDRetryCount = 0; - Log.Helper.LOGD(this, "GetEADeviceID Error (%s)", synergyNetworkConnectionHandle.getResponse().getError()); - SynergyEnvironmentUpdater.this.onStartUpSequenceFinished(new Error(Error.Code.SYNERGY_GET_EA_DEVICE_ID_FAILURE, "GetEADevideId call failed", synergyNetworkConnectionHandle.getResponse().getError())); - } else { - SynergyEnvironmentUpdater.access$1008(SynergyEnvironmentUpdater.this); - Log.Helper.LOGD(this, "GetEADeviceID, call failed. Making retry attempt number %d.", Long.valueOf(SynergyEnvironmentUpdater.this.m_getEADeviceIDRetryCount)); - SynergyEnvironmentUpdater.this.callSynergyGetEADeviceId(); - } - } - }); - } - - /* JADX INFO: Access modifiers changed from: private */ - public void callSynergyValidateEADeviceId(final String str) { - int phoneType; - String string; - String SHA256HashString; - EnvironmentDataContainer environmentDataContainer = this.m_environmentForSynergyStartUp; - HashMap hashMap = new HashMap(); - hashMap.put("apiVer", "1.0.0"); - hashMap.put("hwId", environmentDataContainer.getEAHardwareId()); - hashMap.put("eadeviceid", str); - String mACAddress = ApplicationEnvironment.getComponent().getMACAddress(); - if (Utility.validString(mACAddress) && (SHA256HashString = Utility.SHA256HashString(mACAddress)) != null) { - hashMap.put("macHash", SHA256HashString); - } - IApplicationEnvironment component = ApplicationEnvironment.getComponent(); - Context context = null; - if (component != null) { - context = component.getApplicationContext(); - } - if (!(context == null || (string = Settings.Secure.getString(component.getApplicationContext().getContentResolver(), "android_id")) == null)) { - hashMap.put("androidId", string); - } - if (context != null) { - TelephonyManager telephonyManager = (TelephonyManager) context.getSystemService("phone"); - PackageManager packageManager = context.getPackageManager(); - if (!(telephonyManager == null || packageManager.checkPermission("android.permission.READ_PHONE_STATE", context.getPackageName()) != 0 || (phoneType = telephonyManager.getPhoneType()) == 0)) { - String deviceId = telephonyManager.getDeviceId(); - if (Utility.validString(deviceId)) { - String str2 = "imei"; - if (phoneType == 2) { - str2 = "meid"; - } - hashMap.put(str2, deviceId); - } - } - } - this.m_synergyNetworkConnectionHandle = SynergyNetwork.getComponent().sendGetRequest(this.m_environmentForSynergyStartUp.getServerUrlWithKey(SynergyEnvironment.SERVER_URL_KEY_SYNERGY_USER), "/user/api/android/validateDeviceID", hashMap, new SynergyNetworkConnectionCallback() { // from class: com.ea.nimble.SynergyEnvironmentUpdater.3 - @Override // com.ea.nimble.SynergyNetworkConnectionCallback - public void callback(SynergyNetworkConnectionHandle synergyNetworkConnectionHandle) { - SynergyEnvironmentUpdater.this.m_synergyNetworkConnectionHandle = null; - Exception error = synergyNetworkConnectionHandle.getResponse().getError(); - if (error == null) { - Log.Helper.LOGD(this, "ValidateEADeviceID Success"); - SynergyEnvironmentUpdater.this.m_environmentForSynergyStartUp.setEADeviceId((String) synergyNetworkConnectionHandle.getResponse().getJsonData().get("deviceId")); - SynergyEnvironmentUpdater.this.callSynergyGetAnonUid(); - return; - } - Log.Helper.LOGD(this, "ValidateEADeviceID Error (%s)", error); - if (error instanceof SynergyServerError) { - SynergyServerError synergyServerError = (SynergyServerError) error; - if (synergyServerError.isError(SynergyEnvironmentUpdater.SYNERGY_USER_VALIDATE_EADEVICEID_RESPONSE_ERROR_CODE_CLEAR_CLIENT_CACHED_EADEVICEID)) { - if (SynergyEnvironmentUpdater.this.m_previousValidEnvironmentData != null) { - SynergyEnvironmentUpdater.this.m_previousValidEnvironmentData.setEADeviceId(null); - } - Log.Helper.LOGD(this, "ValidateEADeviceID, Server signal received to delete cached EA Device ID. Making request to get a new EA Device ID."); - SynergyEnvironmentUpdater.this.callSynergyGetEADeviceId(); - return; - } else if (synergyServerError.isError(SynergyEnvironmentUpdater.SYNERGY_USER_VALIDATE_EADEVICEID_RESPONSE_ERROR_CODE_VALIDATION_FAILED)) { - Log.Helper.LOGD(this, "ValidateEADeviceID, EADeviceID validation failed. Making request to get a new EA Device ID."); - SynergyEnvironmentUpdater.this.callSynergyGetEADeviceId(); - return; - } - } - if (SynergyEnvironmentUpdater.this.isTimeoutError(error) || SynergyEnvironmentUpdater.this.m_validateEADeviceIDRetryCount >= 3) { - SynergyEnvironmentUpdater.this.m_validateEADeviceIDRetryCount = 0; - SynergyEnvironmentUpdater.this.onStartUpSequenceFinished(new Error(Error.Code.SYNERGY_GET_EA_DEVICE_ID_FAILURE, "ValidateEADeviceId call failed", error)); - return; - } - SynergyEnvironmentUpdater.access$1108(SynergyEnvironmentUpdater.this); - Log.Helper.LOGD(this, "ValidateEADeviceID, call failed. Making retry attempt number %d.", Long.valueOf(SynergyEnvironmentUpdater.this.m_validateEADeviceIDRetryCount)); - SynergyEnvironmentUpdater.this.callSynergyValidateEADeviceId(str); - } - }); - } - - private String getSynergyServerEnvironmentName() { - switch (AnonymousClass5.$SwitchMap$com$ea$nimble$NimbleConfiguration[this.m_core.getConfiguration().ordinal()]) { - case 1: - case 2: - case 3: - return this.m_core.getConfiguration().toString(); - case 4: - return PreferenceManager.getDefaultSharedPreferences(ApplicationEnvironment.getComponent().getApplicationContext()).getString("NimbleCustomizedSynergyServerEnvironmentName", "live"); - default: - Log.Helper.LOGF(this, "Request for Synergy server environment name with unknown NimbleConfiguration %s", this.m_core.getConfiguration().toString()); - return "live"; - } - } - - /* JADX INFO: Access modifiers changed from: private */ - public boolean isTimeoutError(Exception exc) { - return (exc instanceof Error) && ((Error) exc).isError(Error.Code.NETWORK_TIMEOUT); - } - - /* JADX INFO: Access modifiers changed from: private */ - public void onStartUpSequenceFinished(Exception exc) { - if (this.m_completionCallback != null) { - this.m_completionCallback.callback(exc); - } else { - Log.Helper.LOGW(this, "Startup sequence finished, but no completion callback set."); - } - } - - public void cancel() { - SynergyNetworkConnectionHandle synergyNetworkConnectionHandle = this.m_synergyNetworkConnectionHandle; - if (synergyNetworkConnectionHandle != null) { - Log.Helper.LOGD(this, "Canceling network connection."); - synergyNetworkConnectionHandle.cancel(); - this.m_synergyNetworkConnectionHandle = null; - } - onStartUpSequenceFinished(new Error(Error.Code.NETWORK_OPERATION_CANCELLED, "Synergy startup sequence canceled.")); - } - - /* JADX INFO: Access modifiers changed from: package-private */ - public EnvironmentDataContainer getEnvironmentDataContainer() { - return this.m_environmentForSynergyStartUp; - } - - @Override // com.ea.nimble.LogSource - public String getLogSourceTitle() { - return "SynergyEnv"; - } - - public void startSynergyStartupSequence(EnvironmentDataContainer environmentDataContainer, CompletionCallback completionCallback) { - this.m_completionCallback = completionCallback; - this.m_previousValidEnvironmentData = environmentDataContainer; - if (Network.getComponent().getStatus() != Network.Status.OK) { - onStartUpSequenceFinished(new Error(Error.Code.NETWORK_NO_CONNECTION, "Device is not connected to Wifi or wireless.")); - } else { - callSynergyGetDirection(); - } - } -} diff --git a/app/src/main/java/com/ea/nimble/SynergyIdManager.java b/app/src/main/java/com/ea/nimble/SynergyIdManager.java deleted file mode 100644 index 4e5ca35..0000000 --- a/app/src/main/java/com/ea/nimble/SynergyIdManager.java +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Decompiled with CFR 0.152. - */ -package com.ea.nimble; - -import com.ea.nimble.ISynergyIdManager; -import com.ea.nimble.SynergyIdManagerImpl; - -public class SynergyIdManager { - public static final String COMPONENT_ID = "com.ea.nimble.synergyidmanager"; - public static final String LOG_TAG = "SynergyID"; - public static final String NOTIFICATION_ANONYMOUS_SYNERGY_ID_CHANGED = "nimble.synergyidmanager.notification.anonymous_synergy_id_changed"; - public static final String NOTIFICATION_SYNERGY_ID_CHANGED = "nimble.synergyidmanager.notification.synergy_id_changed"; - - public static ISynergyIdManager getComponent() { - return SynergyIdManagerImpl.getComponent(); - } -} - diff --git a/app/src/main/java/com/ea/nimble/SynergyIdManagerError.java b/app/src/main/java/com/ea/nimble/SynergyIdManagerError.java deleted file mode 100644 index f2a8195..0000000 --- a/app/src/main/java/com/ea/nimble/SynergyIdManagerError.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Decompiled with CFR 0.152. - */ -package com.ea.nimble; - -import com.ea.nimble.Error; - -public class SynergyIdManagerError -extends Error { - public static final String ERROR_DOMAIN = "NimbleSynergyIdManager"; - private static final long serialVersionUID = 1L; - - public SynergyIdManagerError(int n2, String string2) { - super(ERROR_DOMAIN, n2, string2, null); - } - - public SynergyIdManagerError(int n2, String string2, Throwable throwable) { - super(ERROR_DOMAIN, n2, string2, throwable); - } - - public static enum Code { - AUTHENTICATOR_CONFLICT(5000), - UNEXPECTED_LOGIN_STATE(5001), - INVALID_ID(5002), - MISSING_AUTHENTICATOR(5003); - - private int m_value; - - private Code(int n3) { - this.m_value = n3; - } - - public int intValue() { - return this.m_value; - } - } -} - diff --git a/app/src/main/java/com/ea/nimble/SynergyIdManagerImpl.java b/app/src/main/java/com/ea/nimble/SynergyIdManagerImpl.java deleted file mode 100644 index 0e80a00..0000000 --- a/app/src/main/java/com/ea/nimble/SynergyIdManagerImpl.java +++ /dev/null @@ -1,231 +0,0 @@ -/* - * Decompiled with CFR 0.152. - * - * Could not load the following classes: - * android.content.BroadcastReceiver - * android.content.Context - * android.content.Intent - */ -package com.ea.nimble; - -import android.content.BroadcastReceiver; -import android.content.Context; -import android.content.Intent; - -import java.io.Serializable; -import java.util.HashMap; - -class SynergyIdManagerImpl -extends Component -implements ISynergyIdManager, -LogSource { - private static final String ANONYMOUS_ID_PERSISTENCE_DATA_ID = "anonymousId"; - private static final String AUTHENTICATOR_PERSISTENCE_DATA_ID = "authenticator"; - private static final String CURRENT_ID_PERSISTENCE_DATA_ID = "currentId"; - private static final String SYNERGY_ID_MANAGER_ANONYMOUS_ID_PERSISTENCE_ID = "com.ea.nimble.synergyidmanager.anonymousId"; - private static final String VERSION_PERSISTENCE_DATA_ID = "dataVersion"; - private String m_anonymousSynergyId; - private String m_authenticatorIdentifier; - private String m_currentSynergyId; - private BroadcastReceiver m_receiver = new SynergyIdManagerReceiver(); - - SynergyIdManagerImpl() { - } - - public static ISynergyIdManager getComponent() { - return (ISynergyIdManager)((Object)Base.getComponent("com.ea.nimble.synergyidmanager")); - } - - private void onSynergyEnvironmentStartupRequestsFinished() { - if (SynergyEnvironment.getComponent() != null) { - Log.Helper.LOGD(this, "onSynergyEnvironmentStartupRequestsFinished - Process the notification, everything looks okay"); - this.setAnonymousSynergyId(SynergyEnvironment.getComponent().getSynergyId()); - if (Utility.validString(this.m_currentSynergyId)) return; - this.setCurrentSynergyId(this.m_anonymousSynergyId); - return; - } - Log.Helper.LOGI(this, "onSynergyEnvironmentStartupRequestsFinished - Aborted because we were unable to get SynergyEnvironment"); - } - - private void restoreFromPersistent() { - Persistence persistence = PersistenceService.getPersistenceForNimbleComponent("com.ea.nimble.synergyidmanager", Persistence.Storage.CACHE); - if (persistence != null) { - Log.Helper.LOGD("Loaded persistence data version, %s.", persistence.getStringValue(VERSION_PERSISTENCE_DATA_ID)); - this.m_currentSynergyId = persistence.getStringValue(CURRENT_ID_PERSISTENCE_DATA_ID); - this.m_authenticatorIdentifier = persistence.getStringValue(AUTHENTICATOR_PERSISTENCE_DATA_ID); - Log.Helper.LOGD(this, "Loaded Synergy ID, %s, with authenticator, %s.", this.m_currentSynergyId, this.m_authenticatorIdentifier); - } else { - Log.Helper.LOGE(this, "Could not get persistence object to load from."); - } - if ((persistence = PersistenceService.getPersistenceForNimbleComponent(SYNERGY_ID_MANAGER_ANONYMOUS_ID_PERSISTENCE_ID, Persistence.Storage.DOCUMENT)) != null) { - Log.Helper.LOGD(this, "Loaded persistence data version, %s.", Utility.safeString(persistence.getStringValue(VERSION_PERSISTENCE_DATA_ID))); - this.m_anonymousSynergyId = persistence.getStringValue(ANONYMOUS_ID_PERSISTENCE_DATA_ID); - Log.Helper.LOGD(this, "Loaded anonymous Synergy ID, %s.", Utility.safeString(this.m_anonymousSynergyId)); - return; - } - Log.Helper.LOGE(this, "Could not get anonymous Synergy ID persistence object to load from."); - } - - private void saveDataToPersistent() { - Persistence persistence = PersistenceService.getPersistenceForNimbleComponent(SYNERGY_ID_MANAGER_ANONYMOUS_ID_PERSISTENCE_ID, Persistence.Storage.DOCUMENT); - if (persistence != null) { - Log.Helper.LOGD("Saving anonymous Synergy ID, %s, to persistent.", this.m_anonymousSynergyId); - persistence.setValue(VERSION_PERSISTENCE_DATA_ID, (Serializable)((Object)"1.0.0")); - persistence.setValue(ANONYMOUS_ID_PERSISTENCE_DATA_ID, (Serializable)((Object)this.m_anonymousSynergyId)); - persistence.setBackUp(true); - persistence.synchronize(); - } else { - Log.Helper.LOGE(this, "Could not get anonymous Synergy ID persistence object to save to."); - } - if ((persistence = PersistenceService.getPersistenceForNimbleComponent("com.ea.nimble.synergyidmanager", Persistence.Storage.CACHE)) != null) { - Log.Helper.LOGD(this, "Saving current Synergy ID, %s, and authenticator, %s, to persistent.", this.m_currentSynergyId, this.m_authenticatorIdentifier); - persistence.setValue(VERSION_PERSISTENCE_DATA_ID, (Serializable)((Object)"1.0.0")); - persistence.setValue(CURRENT_ID_PERSISTENCE_DATA_ID, (Serializable)((Object)this.m_currentSynergyId)); - persistence.setValue(AUTHENTICATOR_PERSISTENCE_DATA_ID, (Serializable)((Object)this.m_authenticatorIdentifier)); - persistence.synchronize(); - return; - } - Log.Helper.LOGE(this, "Could not get persistence object to save to."); - } - - private void setAnonymousSynergyId(String object) { - if (Utility.validString(this.m_anonymousSynergyId) && !Utility.validString((String)object)) { - Log.Helper.LOGE(this, "Attempt to set invalid anonymous Synergy ID over existing ID, %s. Ignoring attempt.", this.m_anonymousSynergyId); - return; - } - String string2 = this.m_anonymousSynergyId; - this.m_anonymousSynergyId = object; - this.saveDataToPersistent(); - if (Utility.validString(string2) && (Utility.validString(string2) && !string2.equals(this.m_anonymousSynergyId) || Utility.validString(this.m_anonymousSynergyId) && !this.m_anonymousSynergyId.equals(string2))) { - HashMap hashMap = new HashMap<>(); - hashMap.put("previousSynergyId", Utility.safeString(string2)); - hashMap.put("currentSynergyId", Utility.safeString(this.m_anonymousSynergyId)); - Utility.sendBroadcast("nimble.synergyidmanager.notification.anonymous_synergy_id_changed", hashMap); - } - if (this.m_authenticatorIdentifier != null) return; - this.setCurrentSynergyId(this.m_anonymousSynergyId); - } - - private void setCurrentSynergyId(String object) { - if (Utility.validString(this.m_currentSynergyId) && !Utility.validString((String)object)) { - Log.Helper.LOGE(this, "Attempt to set invalid current Synergy ID over existing ID, %s. Ignoring attempt.", this.m_currentSynergyId); - return; - } - String string2 = this.m_currentSynergyId; - this.m_currentSynergyId = object; - this.saveDataToPersistent(); - if (!Utility.validString(string2)) return; - if (!Utility.validString(string2) || string2.equals(this.m_currentSynergyId)) { - if (!Utility.validString(this.m_currentSynergyId)) return; - if (this.m_currentSynergyId.equals(string2)) return; - } - HashMap hashMap = new HashMap<>(); - hashMap.put("previousSynergyId", Utility.safeString(string2)); - hashMap.put("currentSynergyId", Utility.safeString(this.m_currentSynergyId)); - Utility.sendBroadcast("nimble.synergyidmanager.notification.synergy_id_changed", hashMap); - } - - private void sleep() { - Utility.unregisterReceiver(this.m_receiver); - this.saveDataToPersistent(); - } - - private void wakeup() { - this.restoreFromPersistent(); - if (!Utility.validString(this.m_anonymousSynergyId)) { - this.setAnonymousSynergyId(SynergyEnvironment.getComponent().getSynergyId()); - } - if (!Utility.validString(this.m_currentSynergyId)) { - this.setCurrentSynergyId(this.m_anonymousSynergyId); - } - Utility.registerReceiver("nimble.environment.notification.startup_requests_finished", this.m_receiver); - } - - @Override - protected void cleanup() { - this.sleep(); - } - - @Override - public String getAnonymousSynergyId() { - if (!Utility.validString(this.m_anonymousSynergyId)) return SynergyEnvironment.getComponent().getSynergyId(); - return this.m_anonymousSynergyId; - } - - @Override - public String getComponentId() { - return "com.ea.nimble.synergyidmanager"; - } - - @Override - public String getLogSourceTitle() { - return "SynergyId"; - } - - @Override - public String getSynergyId() { - if (!Utility.validString(this.m_currentSynergyId)) return this.getAnonymousSynergyId(); - return this.m_currentSynergyId; - } - - @Override - public SynergyIdManagerError login(String string2, String string3) { - if (this.m_authenticatorIdentifier != null) { - return new SynergyIdManagerError(SynergyIdManagerError.Code.UNEXPECTED_LOGIN_STATE.intValue(), "Already logged in with authenticator, " + this.m_authenticatorIdentifier); - } - if (!Utility.validString(string2)) return new SynergyIdManagerError(SynergyIdManagerError.Code.INVALID_ID.intValue(), "Synergy ID must be numeric digits."); - if (!Utility.isOnlyDecimalCharacters(string2)) { - return new SynergyIdManagerError(SynergyIdManagerError.Code.INVALID_ID.intValue(), "Synergy ID must be numeric digits."); - } - if (!Utility.validString(string3)) { - return new SynergyIdManagerError(SynergyIdManagerError.Code.MISSING_AUTHENTICATOR.intValue(), "Authenticator string required for login API."); - } - this.m_authenticatorIdentifier = string3; - this.setCurrentSynergyId(string2); - return null; - } - - @Override - public SynergyIdManagerError logout(String string2) { - if (this.m_authenticatorIdentifier == null) { - return new SynergyIdManagerError(SynergyIdManagerError.Code.UNEXPECTED_LOGIN_STATE.intValue(), "Already logged out."); - } - if (!Utility.validString(string2)) { - return new SynergyIdManagerError(SynergyIdManagerError.Code.MISSING_AUTHENTICATOR.intValue(), "Authenticator string required for logout API."); - } - if (!this.m_authenticatorIdentifier.equals(string2)) { - return new SynergyIdManagerError(SynergyIdManagerError.Code.AUTHENTICATOR_CONFLICT.intValue(), "Logout must be performed by the same authenticator that logged in, " + this.m_authenticatorIdentifier); - } - this.setCurrentSynergyId(this.m_anonymousSynergyId); - this.m_authenticatorIdentifier = null; - return null; - } - - @Override - protected void restore() { - this.wakeup(); - } - - @Override - protected void resume() { - this.wakeup(); - } - - @Override - protected void suspend() { - this.sleep(); - } - - private class SynergyIdManagerReceiver - extends BroadcastReceiver { - private SynergyIdManagerReceiver() { - } - - public void onReceive(Context context, Intent intent) { - if (!ApplicationEnvironment.isMainApplicationRunning()) return; - if (ApplicationEnvironment.getCurrentActivity() == null) return; - SynergyIdManagerImpl.this.onSynergyEnvironmentStartupRequestsFinished(); - } - } -} - diff --git a/app/src/main/java/com/ea/nimble/SynergyNetwork.java b/app/src/main/java/com/ea/nimble/SynergyNetwork.java deleted file mode 100644 index 12f0564..0000000 --- a/app/src/main/java/com/ea/nimble/SynergyNetwork.java +++ /dev/null @@ -1,16 +0,0 @@ -/* - * Decompiled with CFR 0.152. - */ -package com.ea.nimble; - -import com.ea.nimble.ISynergyNetwork; -import com.ea.nimble.SynergyNetworkImpl; - -public class SynergyNetwork { - public static final String COMPONENT_ID = "com.ea.nimble.synergynetwork"; - - public static ISynergyNetwork getComponent() { - return SynergyNetworkImpl.getComponent(); - } -} - diff --git a/app/src/main/java/com/ea/nimble/SynergyNetworkConnection.java b/app/src/main/java/com/ea/nimble/SynergyNetworkConnection.java deleted file mode 100644 index f92eeb5..0000000 --- a/app/src/main/java/com/ea/nimble/SynergyNetworkConnection.java +++ /dev/null @@ -1,243 +0,0 @@ -/* - * Decompiled with CFR 0.152. - */ -package com.ea.nimble; - -import com.ea.nimble.BaseCore; -import com.ea.nimble.HttpResponse; -import com.ea.nimble.IOperationalTelemetryDispatch; -import com.ea.nimble.ISynergyRequest; -import com.ea.nimble.ISynergyResponse; -import com.ea.nimble.Log; -import com.ea.nimble.Network; -import com.ea.nimble.NetworkConnectionCallback; -import com.ea.nimble.NetworkConnectionHandle; -import com.ea.nimble.OperationalTelemetryDispatch; -import com.ea.nimble.OperationalTelemetryEvent; -import com.ea.nimble.SynergyNetworkConnectionCallback; -import com.ea.nimble.SynergyNetworkConnectionHandle; -import com.ea.nimble.SynergyRequest; -import com.ea.nimble.SynergyResponse; -import java.util.List; -import java.util.Map; - -class SynergyNetworkConnection -implements SynergyNetworkConnectionHandle { - private SynergyNetworkConnectionCallback m_completionCallback; - private SynergyNetworkConnectionCallback m_headerCallback; - private NetworkConnectionHandle m_networkHandle = null; - private SynergyOperationalTelemetryDispatch m_otDispatch; - private SynergyNetworkConnectionCallback m_progressCallback; - private SynergyRequest m_request; - private SynergyResponse m_response; - - public SynergyNetworkConnection(SynergyRequest synergyRequest, SynergyNetworkConnectionCallback synergyNetworkConnectionCallback) { - this.m_request = synergyRequest; - this.m_response = new SynergyResponse(); - this.m_otDispatch = new SynergyOperationalTelemetryDispatch(); - this.m_headerCallback = null; - this.m_progressCallback = null; - this.m_completionCallback = synergyNetworkConnectionCallback; - } - - static /* synthetic */ NetworkConnectionHandle access$102(SynergyNetworkConnection synergyNetworkConnection, NetworkConnectionHandle networkConnectionHandle) { - synergyNetworkConnection.m_networkHandle = networkConnectionHandle; - return networkConnectionHandle; - } - - private void parseDataFromNetworkHandle() { - if (this.m_networkHandle == null) return; - this.m_response.httpResponse = this.m_networkHandle.getResponse(); - this.m_response.parseData(); - } - - private void updateNetworkHeaderHandler() { - if (this.m_headerCallback == null) { - this.m_networkHandle.setHeaderCallback(null); - return; - } - this.m_networkHandle.setHeaderCallback(new NetworkConnectionCallback(){ - - @Override - public void callback(NetworkConnectionHandle networkConnectionHandle) { - SynergyNetworkConnection.this.m_headerCallback.callback(SynergyNetworkConnection.this); - } - }); - } - - private void updateNetworkProgressHandler() { - if (this.m_progressCallback == null) { - this.m_networkHandle.setProgressCallback(null); - return; - } - this.m_networkHandle.setProgressCallback(new NetworkConnectionCallback(){ - - @Override - public void callback(NetworkConnectionHandle networkConnectionHandle) { - SynergyNetworkConnection.this.m_progressCallback.callback(SynergyNetworkConnection.this); - } - }); - } - - @Override - public void cancel() { - if (this.m_networkHandle == null) return; - this.m_networkHandle.cancel(); - } - - public void errorPriorToSend(Exception exception) { - HttpResponse httpResponse = new HttpResponse(); - httpResponse.error = exception; - httpResponse.isCompleted = true; - this.m_response.httpResponse = httpResponse; - if (this.m_completionCallback == null) return; - this.m_completionCallback.callback(this); - } - - @Override - public SynergyNetworkConnectionCallback getCompletionCallback() { - return this.m_completionCallback; - } - - @Override - public SynergyNetworkConnectionCallback getHeaderCallback() { - return this.m_headerCallback; - } - - public NetworkConnectionHandle getNetworkConnectionHandle() { - return this.m_networkHandle; - } - - @Override - public SynergyNetworkConnectionCallback getProgressCallback() { - return this.m_progressCallback; - } - - @Override - public ISynergyRequest getRequest() { - return this.m_request; - } - - @Override - public ISynergyResponse getResponse() { - return this.m_response; - } - - void send() { - try { - this.m_request.build(); - this.m_networkHandle = Network.getComponent().sendRequest(this.m_request.httpRequest, new NetworkConnectionCallback(){ - - @Override - public void callback(NetworkConnectionHandle networkConnectionHandle) { - if (SynergyNetworkConnection.this.m_networkHandle == null) { - SynergyNetworkConnection.access$102(SynergyNetworkConnection.this, networkConnectionHandle); - } - SynergyNetworkConnection.this.parseDataFromNetworkHandle(); - networkConnectionHandle.setHeaderCallback(null); - networkConnectionHandle.setProgressCallback(null); - networkConnectionHandle.setCompletionCallback(null); - if (SynergyNetworkConnection.this.m_completionCallback == null) return; - SynergyNetworkConnection.this.m_completionCallback.callback(SynergyNetworkConnection.this); - } - }, this.m_otDispatch); - this.m_response.httpResponse = this.m_networkHandle.getResponse(); - this.updateNetworkHeaderHandler(); - this.updateNetworkProgressHandler(); - return; - } - catch (Exception exception) { - this.errorPriorToSend(exception); - return; - } - } - - @Override - public void setCompletionCallback(SynergyNetworkConnectionCallback synergyNetworkConnectionCallback) { - this.m_completionCallback = synergyNetworkConnectionCallback; - } - - @Override - public void setHeaderCallback(SynergyNetworkConnectionCallback synergyNetworkConnectionCallback) { - this.m_headerCallback = synergyNetworkConnectionCallback; - if (this.m_networkHandle == null) return; - this.updateNetworkHeaderHandler(); - } - - public void setNetworkConnectionHandle(NetworkConnectionHandle networkConnectionHandle) { - this.m_networkHandle = networkConnectionHandle; - } - - @Override - public void setProgressCallback(SynergyNetworkConnectionCallback synergyNetworkConnectionCallback) { - this.m_progressCallback = synergyNetworkConnectionCallback; - if (this.m_networkHandle == null) return; - this.updateNetworkProgressHandler(); - } - - public void start() { - this.m_request.prepare(this); - } - - @Override - public void waitOn() { - if (this.m_networkHandle == null) return; - this.m_networkHandle.waitOn(); - } - - private class SynergyOperationalTelemetryDispatch - implements IOperationalTelemetryDispatch { - private SynergyOperationalTelemetryDispatch() { - } - - @Override - public List getEvents(String string2) { - if (!BaseCore.getInstance().isActive()) { - Log.Helper.LOGV(this, "BaseCore not active for operational telemetry logging.", new Object[0]); - return null; - } - IOperationalTelemetryDispatch iOperationalTelemetryDispatch = OperationalTelemetryDispatch.getComponent(); - if (iOperationalTelemetryDispatch == null) return null; - return iOperationalTelemetryDispatch.getEvents(string2); - } - - @Override - public int getMaxEventCount(String string2) { - if (!BaseCore.getInstance().isActive()) { - Log.Helper.LOGV(this, "BaseCore not active for operational telemetry logging.", new Object[0]); - return -1; - } - IOperationalTelemetryDispatch iOperationalTelemetryDispatch = OperationalTelemetryDispatch.getComponent(); - if (iOperationalTelemetryDispatch == null) return -1; - return iOperationalTelemetryDispatch.getMaxEventCount(string2); - } - - @Override - public void logEvent(String string2, Map map) { - if (!BaseCore.getInstance().isActive()) { - Log.Helper.LOGV(this, "BaseCore not active for operational telemetry logging.", new Object[0]); - return; - } - IOperationalTelemetryDispatch iOperationalTelemetryDispatch = OperationalTelemetryDispatch.getComponent(); - if (iOperationalTelemetryDispatch == null) return; - SynergyNetworkConnection.this.parseDataFromNetworkHandle(); - Map map2 = SynergyNetworkConnection.this.m_response.getJsonData(); - if (map2 != null && map2.containsKey("resultCode")) { - map.put("SYNERGY_RESULT_CODE", ((Integer)map2.get("resultCode")).toString()); - } - iOperationalTelemetryDispatch.logEvent(string2, map); - } - - @Override - public void setMaxEventCount(String string2, int n2) { - if (!BaseCore.getInstance().isActive()) { - Log.Helper.LOGV(this, "BaseCore not active for operational telemetry logging.", new Object[0]); - return; - } - IOperationalTelemetryDispatch iOperationalTelemetryDispatch = OperationalTelemetryDispatch.getComponent(); - if (iOperationalTelemetryDispatch == null) return; - iOperationalTelemetryDispatch.setMaxEventCount(string2, n2); - } - } -} - diff --git a/app/src/main/java/com/ea/nimble/SynergyNetworkConnectionCallback.java b/app/src/main/java/com/ea/nimble/SynergyNetworkConnectionCallback.java deleted file mode 100644 index 3367f3a..0000000 --- a/app/src/main/java/com/ea/nimble/SynergyNetworkConnectionCallback.java +++ /dev/null @@ -1,11 +0,0 @@ -/* - * Decompiled with CFR 0.152. - */ -package com.ea.nimble; - -import com.ea.nimble.SynergyNetworkConnectionHandle; - -public interface SynergyNetworkConnectionCallback { - public void callback(SynergyNetworkConnectionHandle var1); -} - diff --git a/app/src/main/java/com/ea/nimble/SynergyNetworkConnectionHandle.java b/app/src/main/java/com/ea/nimble/SynergyNetworkConnectionHandle.java deleted file mode 100644 index 0577d30..0000000 --- a/app/src/main/java/com/ea/nimble/SynergyNetworkConnectionHandle.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Decompiled with CFR 0.152. - */ -package com.ea.nimble; - -import com.ea.nimble.ISynergyRequest; -import com.ea.nimble.ISynergyResponse; -import com.ea.nimble.SynergyNetworkConnectionCallback; - -public interface SynergyNetworkConnectionHandle { - public void cancel(); - - public SynergyNetworkConnectionCallback getCompletionCallback(); - - public SynergyNetworkConnectionCallback getHeaderCallback(); - - public SynergyNetworkConnectionCallback getProgressCallback(); - - public ISynergyRequest getRequest(); - - public ISynergyResponse getResponse(); - - public void setCompletionCallback(SynergyNetworkConnectionCallback var1); - - public void setHeaderCallback(SynergyNetworkConnectionCallback var1); - - public void setProgressCallback(SynergyNetworkConnectionCallback var1); - - public void waitOn(); -} - diff --git a/app/src/main/java/com/ea/nimble/SynergyNetworkImpl.java b/app/src/main/java/com/ea/nimble/SynergyNetworkImpl.java deleted file mode 100644 index b5f0d5c..0000000 --- a/app/src/main/java/com/ea/nimble/SynergyNetworkImpl.java +++ /dev/null @@ -1,140 +0,0 @@ -/* - * Decompiled with CFR 0.152. - * - * Could not load the following classes: - * android.content.BroadcastReceiver - * android.content.Context - * android.content.Intent - */ -package com.ea.nimble; - -import android.content.BroadcastReceiver; -import android.content.Context; -import android.content.Intent; - -import java.util.ArrayList; -import java.util.Locale; -import java.util.Map; -import java.util.UUID; - -public class SynergyNetworkImpl -extends Component -implements ISynergyNetwork { - private ArrayList m_pendingRequests = null; - private String m_sessionId; - private BroadcastReceiver m_synergyEnvironmentNotifyReceiver = null; - - SynergyNetworkImpl() { - } - - private String generateSessionId() { - return UUID.randomUUID().toString().replace("-", "").toLowerCase(Locale.US); - } - - public static ISynergyNetwork getComponent() { - return (ISynergyNetwork)(Base.getComponent("com.ea.nimble.synergynetwork")); - } - - private SynergyNetworkConnectionHandle sendSynergyRequest(SynergyRequest object, SynergyNetworkConnectionCallback synergyNetworkConnectionCallback) { - SynergyNetworkConnection synergyNetworkConnection = new SynergyNetworkConnection(object, synergyNetworkConnectionCallback); - synergyNetworkConnection.start(); - return synergyNetworkConnection; - } - - @Override - public void cleanup() { - if (this.m_synergyEnvironmentNotifyReceiver != null) { - Utility.unregisterReceiver(this.m_synergyEnvironmentNotifyReceiver); - this.m_synergyEnvironmentNotifyReceiver = null; - } - this.m_pendingRequests.clear(); - } - - @Override - public String getComponentId() { - return "com.ea.nimble.synergynetwork"; - } - - String getSessionId() { - return this.m_sessionId; - } - - @Override - public void restore() { - if (SynergyEnvironment.getComponent().isDataAvailable()) return; - this.m_synergyEnvironmentNotifyReceiver = new BroadcastReceiver(){ - - public void onReceive(Context object, Intent intent) { - - for (SynergyNetworkConnection m_pendingRequest : SynergyNetworkImpl.this.m_pendingRequests) - if (intent.getStringExtra("result").equals("0")) - m_pendingRequest.errorPriorToSend(new Error(Error.Code.SYNERGY_ENVIRONMENT_UPDATE_FAILURE, "Failed to retrieve Environment data from Synergy")); - else - m_pendingRequest.start(); - - SynergyNetworkImpl.this.m_pendingRequests.clear(); - } - }; - Utility.registerReceiver("nimble.environment.notification.startup_requests_finished", this.m_synergyEnvironmentNotifyReceiver); - } - - @Override - protected void resume() { - this.m_sessionId = this.generateSessionId(); - } - - @Override - public SynergyNetworkConnectionHandle sendGetRequest(String string2, String object, Map map, SynergyNetworkConnectionCallback synergyNetworkConnectionCallback) { - SynergyRequest synergyRequest = new SynergyRequest(object, IHttpRequest.Method.GET, null); - synergyRequest.baseUrl = string2; - synergyRequest.urlParameters = map; - return this.sendSynergyRequest(synergyRequest, synergyNetworkConnectionCallback); - } - - @Override - public SynergyNetworkConnectionHandle sendPostRequest(String string2, String object, Map map, Map map2, SynergyNetworkConnectionCallback synergyNetworkConnectionCallback) { - SynergyRequest synergyRequest = new SynergyRequest(object, IHttpRequest.Method.POST, null); - synergyRequest.baseUrl = string2; - synergyRequest.urlParameters = map; - synergyRequest.jsonData = map2; - return this.sendSynergyRequest(synergyRequest, synergyNetworkConnectionCallback); - } - - @Override - public SynergyNetworkConnectionHandle sendPostRequest(String string2, String object, Map map, Map map2, SynergyNetworkConnectionCallback synergyNetworkConnectionCallback, Map map3) { - SynergyRequest synergyRequest = new SynergyRequest((String) object, IHttpRequest.Method.POST, null); - synergyRequest.baseUrl = string2; - synergyRequest.urlParameters = map; - synergyRequest.jsonData = map2; - if (map3 == null) return this.sendSynergyRequest(synergyRequest, synergyNetworkConnectionCallback); - synergyRequest.httpRequest.headers.putAll(map3); - return this.sendSynergyRequest(synergyRequest, synergyNetworkConnectionCallback); - } - - @Override - public void sendRequest(SynergyRequest object, SynergyNetworkConnectionCallback object2) { - ISynergyEnvironment iSynergyEnvironment = SynergyEnvironment.getComponent(); - if (iSynergyEnvironment.isDataAvailable()) { - this.sendSynergyRequest(object, object2); - return; - } - SynergyNetworkConnection synergyNetworkConnection = new SynergyNetworkConnection(object, object2); - if (iSynergyEnvironment.isUpdateInProgress()) { - this.m_pendingRequests.add(synergyNetworkConnection); - return; - } - Error error = iSynergyEnvironment.checkAndInitiateSynergyEnvironmentUpdate(); - if (error == null) { - this.m_pendingRequests.add(synergyNetworkConnection); - return; - } - synergyNetworkConnection.errorPriorToSend((Exception)object2); - } - - @Override - public void setup() { - this.m_pendingRequests = new ArrayList(); - this.m_sessionId = this.generateSessionId(); - } -} - diff --git a/app/src/main/java/com/ea/nimble/SynergyRequest.java b/app/src/main/java/com/ea/nimble/SynergyRequest.java deleted file mode 100644 index 2075556..0000000 --- a/app/src/main/java/com/ea/nimble/SynergyRequest.java +++ /dev/null @@ -1,121 +0,0 @@ -/* - * Decompiled with CFR 0.152. - */ -package com.ea.nimble; - -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.util.HashMap; -import java.util.Locale; -import java.util.Map; - -public class SynergyRequest -implements ISynergyRequest { - public String api; - public String baseUrl; - public HttpRequest httpRequest; - public Map jsonData; - private SynergyNetworkConnection m_connection; - public SynergyRequestPreparingCallback prepareRequestCallback; - public Map urlParameters; - - public SynergyRequest(String string2, IHttpRequest.Method method, SynergyRequestPreparingCallback synergyRequestPreparingCallback) { - this.api = string2; - this.httpRequest = new HttpRequest(); - this.prepareRequestCallback = synergyRequestPreparingCallback; - this.urlParameters = null; - this.jsonData = null; - this.httpRequest.method = method; - this.httpRequest.headers.put("Content-Type", "application/json"); - this.httpRequest.headers.put("SDK-VERSION", "1.23.14.1217"); - this.httpRequest.headers.put("SDK-TYPE", "Nimble"); - this.httpRequest.headers.put("EAM-USER-ID", SynergyIdManager.getComponent().getSynergyId()); - this.httpRequest.headers.put("EA-SELL-ID", SynergyEnvironment.getComponent().getSellId()); - this.httpRequest.headers.put("EAM-SESSION", ((SynergyNetworkImpl)SynergyNetwork.getComponent()).getSessionId()); - } - - void build() throws Error { - if (!Utility.validString(this.baseUrl) || !Utility.validString(this.api)) { - throw new Error(Error.Code.INVALID_ARGUMENT, String.format("Invalid synergy request parameter (%s, %s) to build http request url", this.baseUrl, this.api)); - } - IApplicationEnvironment object = ApplicationEnvironment.getComponent(); - HashMap object2 = new HashMap(); - object2.put("appVer", object.getApplicationVersion()); - object2.put("appLang", object.getShortApplicationLanguageCode()); - object2.put("localization", object.getApplicationLanguageCode()); - object2.put("deviceLanguage", Locale.getDefault().getLanguage()); - object2.put("deviceLocale", Locale.getDefault().toString()); - String eaHardwareId = SynergyEnvironment.getComponent().getEAHardwareId(); - if (Utility.validString(eaHardwareId)) { - object2.put("hwId", eaHardwareId); - } - if (this.urlParameters != null) { - object2.putAll(this.urlParameters); - } - this.httpRequest.url = Network.generateURL(this.baseUrl + this.api, object2); - if (this.httpRequest.method != IHttpRequest.Method.POST) { - if (this.httpRequest.method != IHttpRequest.Method.PUT) return; - } - if (this.jsonData == null) return; - if (this.jsonData.size() <= 0) return; - String s = Utility.convertObjectToJSONString(this.jsonData); - this.httpRequest.data = new ByteArrayOutputStream(); - try { - this.httpRequest.data.write(s.getBytes()); - } - catch (IOException iOException) { - throw new Error(Error.Code.INVALID_ARGUMENT, "Error converting jsonData in SynergyRequest to a data stream", iOException); - } - } - - @Override - public String getApi() { - return this.api; - } - - @Override - public String getBaseUrl() { - return this.baseUrl; - } - - @Override - public HttpRequest getHttpRequest() { - return this.httpRequest; - } - - @Override - public Map getJsonData() { - return this.jsonData; - } - - public IHttpRequest.Method getMethod() { - return this.httpRequest.getMethod(); - } - - @Override - public Map getUrlParameters() { - return this.urlParameters; - } - - void prepare(SynergyNetworkConnection synergyNetworkConnection) { - this.m_connection = synergyNetworkConnection; - if (this.prepareRequestCallback != null) { - this.prepareRequestCallback.prepareRequest(this); - return; - } - this.send(); - } - - public void send() { - this.m_connection.send(); - } - - public void setMethod(IHttpRequest.Method method) { - this.httpRequest.method = method; - } - - public static interface SynergyRequestPreparingCallback { - public void prepareRequest(SynergyRequest var1); - } -} - diff --git a/app/src/main/java/com/ea/nimble/SynergyResponse.java b/app/src/main/java/com/ea/nimble/SynergyResponse.java deleted file mode 100644 index 4b3c49c..0000000 --- a/app/src/main/java/com/ea/nimble/SynergyResponse.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Decompiled with CFR 0.152. - * - * Could not load the following classes: - * org.json.JSONObject - */ -package com.ea.nimble; - -import com.ea.nimble.Error; -import com.ea.nimble.IHttpResponse; -import com.ea.nimble.ISynergyResponse; -import com.ea.nimble.SynergyServerError; -import com.ea.nimble.Utility; -import java.util.Map; -import org.json.JSONObject; - -public class SynergyResponse -implements ISynergyResponse { - public Error error = null; - public IHttpResponse httpResponse = null; - public Map jsonData = null; - - @Override - public Exception getError() { - if (this.error != null) return this.error; - if (this.httpResponse != null) return this.httpResponse.getError(); - return this.error; - } - - @Override - public IHttpResponse getHttpResponse() { - return this.httpResponse; - } - - @Override - public Map getJsonData() { - return this.jsonData; - } - - @Override - public boolean isCompleted() { - if (this.httpResponse != null) return this.httpResponse.isCompleted(); - return false; - } - - public void parseData() { - if (this.jsonData != null) { - return; - } - if (this.httpResponse != null && this.httpResponse.getError() == null) { - String string2 = ""; - try { - String string3; - string2 = string3 = Utility.readStringFromStream(this.httpResponse.getDataStream()); - this.jsonData = Utility.convertJSONObjectToMap(new JSONObject(string3)); - if (!this.jsonData.containsKey("resultCode")) return; - int n2 = (Integer)this.jsonData.get("resultCode"); - if (n2 >= 0) return; - this.error = new SynergyServerError(n2, (String)this.jsonData.get("message")); - return; - } - catch (Exception exception) { - this.jsonData = null; - this.error = new Error(Error.Code.NETWORK_INVALID_SERVER_RESPONSE, "Unparseable synergy json response " + string2); - return; - } - } - this.jsonData = null; - this.error = null; - } -} - diff --git a/app/src/main/java/com/ea/nimble/SynergyServerError.java b/app/src/main/java/com/ea/nimble/SynergyServerError.java deleted file mode 100644 index b20e3a8..0000000 --- a/app/src/main/java/com/ea/nimble/SynergyServerError.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Decompiled with CFR 0.152. - */ -package com.ea.nimble; - -import com.ea.nimble.Error; - -public class SynergyServerError -extends Error { - public static final String ERROR_DOMAIN = "SynergyServerError"; - private static final long serialVersionUID = 1L; - - public SynergyServerError() { - } - - public SynergyServerError(int n2, String string2) { - super(ERROR_DOMAIN, n2, string2, null); - } - - public SynergyServerError(int n2, String string2, Throwable throwable) { - super(ERROR_DOMAIN, n2, string2, throwable); - } - - public boolean isError(int n2) { - if (this.getCode() != n2) return false; - return true; - } - - public static enum Code { - ERROR_NONCE_VERIFICATION(-30013), - ERROR_SIGNATURE_VERIFICATION(-30014), - ERROR_NOT_SUPPORTED_RECEIPT_TYPE(-30015), - AMAZON_SERVER_CONNECTION_ERROR(-30016), - APPLE_SERVER_CONNECTION_ERROR(10001); - - private int m_value; - - private Code(int n3) { - this.m_value = n3; - } - - public int intValue() { - return this.m_value; - } - } -} - diff --git a/app/src/main/java/com/ea/nimble/Timer.java b/app/src/main/java/com/ea/nimble/Timer.java deleted file mode 100644 index fd555ec..0000000 --- a/app/src/main/java/com/ea/nimble/Timer.java +++ /dev/null @@ -1,136 +0,0 @@ -/* - * Decompiled with CFR 0.152. - * - * Could not load the following classes: - * android.os.Handler - * android.os.Looper - * android.os.SystemClock - */ -package com.ea.nimble; - -import android.os.Handler; -import android.os.Looper; -import android.os.SystemClock; -import com.ea.nimble.Log; - -public class Timer { - private static Handler s_handler = new Handler(Looper.getMainLooper()); - private long m_fireTime; - private long m_pauseTime; - private boolean m_paused; - private boolean m_running; - private Runnable m_task; - private Runnable m_taskToRun; - private long m_timeInterval; - - public Timer(Runnable runnable) { - this.m_task = runnable; - this.m_running = false; - this.m_paused = false; - } - - static /* synthetic */ boolean access$102(Timer timer, boolean bl2) { - timer.m_running = bl2; - return bl2; - } - - static /* synthetic */ long access$302(Timer timer, long l2) { - timer.m_fireTime = l2; - return l2; - } - - public void cancel() { - if (!this.m_running) return; - if (!this.m_paused) { - s_handler.removeCallbacks(this.m_taskToRun); - } - this.m_running = false; - } - - public void fire() { - this.cancel(); - this.m_task.run(); - if (!(this.m_taskToRun instanceof RepeatingTask)) return; - if (this.m_paused) { - this.m_fireTime = this.m_pauseTime + this.m_timeInterval; - return; - } - this.m_fireTime = SystemClock.uptimeMillis() + this.m_timeInterval; - s_handler.postDelayed(this.m_taskToRun, this.m_timeInterval); - this.m_running = true; - } - - public boolean isPaused() { - return this.m_paused; - } - - public boolean isRunning() { - return this.m_running; - } - - public void pause() { - if (this.m_paused) return; - if (!this.m_running) return; - this.m_pauseTime = SystemClock.uptimeMillis(); - s_handler.removeCallbacks(this.m_taskToRun); - this.m_paused = true; - } - - public void resume() { - if (!this.m_paused) return; - if (!this.m_running) return; - this.m_fireTime += SystemClock.uptimeMillis() - this.m_pauseTime; - s_handler.postAtTime(this.m_taskToRun, this.m_fireTime); - this.m_paused = false; - } - - public void schedule(double d2, boolean bl2) { - this.cancel(); - if (d2 < 0.1) { - if (bl2) { - Log.Helper.LOGES(null, "Timer scheduled to repeat for %.2f seconds, running only once", d2); - } - if (Looper.myLooper() == Looper.getMainLooper()) { - this.m_task.run(); - return; - } - s_handler.post(this.m_task); - return; - } - this.m_timeInterval = (long)(1000.0 * d2); - this.m_fireTime = SystemClock.uptimeMillis() + this.m_timeInterval; - this.m_taskToRun = bl2 ? new RepeatingTask() : new SingleRunTask(); - s_handler.postDelayed(this.m_taskToRun, this.m_timeInterval); - this.m_running = true; - } - - private class RepeatingTask - implements Runnable { - private RepeatingTask() { - } - - @Override - public void run() { - if (Timer.this.m_paused) return; - if (!Timer.this.m_running) return; - Timer.this.m_task.run(); - Timer.access$302(Timer.this, SystemClock.uptimeMillis() + Timer.this.m_fireTime); - s_handler.postDelayed((Runnable)this, Timer.this.m_timeInterval); - } - } - - private class SingleRunTask - implements Runnable { - private SingleRunTask() { - } - - @Override - public void run() { - if (Timer.this.m_paused) return; - if (!Timer.this.m_running) return; - Timer.access$102(Timer.this, false); - Timer.this.m_task.run(); - } - } -} - diff --git a/app/src/main/java/com/ea/nimble/Utility.java b/app/src/main/java/com/ea/nimble/Utility.java deleted file mode 100644 index e244f01..0000000 --- a/app/src/main/java/com/ea/nimble/Utility.java +++ /dev/null @@ -1,274 +0,0 @@ -/* - * Decompiled with CFR 0.152. - * - * Could not load the following classes: - * android.content.BroadcastReceiver - * android.content.Context - * android.content.Intent - * android.content.IntentFilter - * android.support.v4.content.LocalBroadcastManager - * org.json.JSONArray - * org.json.JSONException - * org.json.JSONObject - */ -package com.ea.nimble; - -import android.content.BroadcastReceiver; -import android.content.Intent; -import android.content.IntentFilter; -import android.content.res.XmlResourceParser; -import androidx.localbroadcastmanager.content.LocalBroadcastManager; -import org.json.JSONArray; -import org.json.JSONException; -import org.json.JSONObject; -import java.io.IOException; -import java.io.InputStream; -import java.io.Serializable; -import java.io.StringWriter; -import java.security.MessageDigest; -import java.security.NoSuchAlgorithmException; -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Date; -import java.util.HashMap; -import java.util.Iterator; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Locale; -import java.util.Map; -import java.util.TimeZone; - -public final class Utility { - private Utility() { - } - - public static String SHA256HashString(String object) { - MessageDigest object2; - if (object == null) { - return null; - } - try { - object2 = MessageDigest.getInstance("SHA-256"); - object2.reset(); - } - catch (NoSuchAlgorithmException noSuchAlgorithmException) { - Log.Helper.LOGES(null, "Can't find SHA-256 algorithm"); - return null; - } - byte[] digest = object2.digest(object.getBytes()); - StringBuffer stringBuffer = new StringBuffer(); - int n2 = 0; - - while (n2 < digest.length) { - stringBuffer.append(Integer.toString((digest[n2] & 0xFF) + 256, 16).substring(1)); - ++n2; - } - return stringBuffer.toString(); - } - - public static String bytesToHexString(byte[] byArray) { - char[] cArray = "0123456789ABCDEF".toCharArray(); - char[] cArray2 = new char[byArray.length * 2]; - int n2 = 0; - while (n2 < byArray.length) { - int n3 = byArray[n2] & 0xFF; - cArray2[n2 * 2] = cArray[n3 >> 4]; - cArray2[n2 * 2 + 1] = cArray[n3 & 0xF]; - ++n2; - } - return new String(cArray2); - } - - public static List convertJSONArrayToList(JSONArray jSONArray) { - ArrayList arrayList = new ArrayList<>(); - if (jSONArray != null) - for (int i=0;i convertJSONObjectStringToMap(String object) { - try { - return Utility.convertJSONObjectToMap(new JSONObject(object)); - } - catch (JSONException jSONException) { - jSONException.printStackTrace(); - return new HashMap(); - } - } - - public static Map convertJSONObjectToMap(JSONObject jSONObject) { - - Map map = new HashMap(); - Iterator keys = jSONObject.keys(); - while(keys.hasNext()) { - String key = keys.next(); - Object value = null; - try { - value = jSONObject.get(key); - } catch (JSONException e) { - e.printStackTrace(); - return null; - } - if (value instanceof JSONArray) { - value = convertJSONArrayToList((JSONArray) value); - } else if (value instanceof JSONObject) { - value = convertJSONObjectToMap((JSONObject) value); - } - map.put(key, value); - } return map; - } - - public static String convertObjectToJSONString(Object object) { - return ""; - } - - public static boolean getTestResult() { - if (5 + 5 != 10) return false; - return true; - } - - public static String getUTCDateStringFormat(Date date) { - if (date == null) { - return ""; - } - SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMdd_HHmmss", Locale.US); - simpleDateFormat.setTimeZone(TimeZone.getTimeZone("UTC")); - return simpleDateFormat.format(date); - } - - public static boolean isOnlyDecimalCharacters(String string2) { - if (string2 == null) { - return false; - } - int n2 = 0; - while (n2 < string2.length()) { - if (!Character.isDigit(string2.charAt(n2))) return false; - ++n2; - } - return true; - } - - /* - * WARNING - Removed back jump from a try to a catch block - possible behaviour change. - * Enabled unnecessary exception pruning - */ - public static LinkedHashMap parseXmlFile(int i) { - XmlResourceParser xmlResourceParser = null; - LinkedHashMap linkedHashMap; - try { - xmlResourceParser = null; - XmlResourceParser xmlResourceParser2 = null; - try { - XmlResourceParser xml = ApplicationEnvironment.getComponent().getApplicationContext().getResources().getXml(i); - LinkedHashMap linkedHashMap2 = new LinkedHashMap(); - String str = null; - int eventType = xml.getEventType(); - while (eventType != 1) { - if (eventType == 2) { - str = xml.getName(); - } else { - str = str; - if (eventType == 4) { - linkedHashMap2.put(str, xml.getText()); - str = str; - } - } - eventType = xml.next(); - } - xmlResourceParser2 = xml; - xmlResourceParser = xml; - xml.close(); - linkedHashMap = linkedHashMap2; - xml.close(); - return linkedHashMap2; - } catch (Exception e) { - Log.Helper.LOGES(null, "Error reading xml file: " + e.toString()); - if (xmlResourceParser2 != null) { - xmlResourceParser2.close(); - } - linkedHashMap = null; - } - return linkedHashMap; - } catch (Throwable th) { - if (xmlResourceParser != null) { - xmlResourceParser.close(); - } - throw th; - } - } - - public static String readStringFromStream(InputStream closeable) throws IOException { - int n2; - byte[] cArray = new byte[8192]; - StringWriter stringWriter = new StringWriter(); - while ((n2 = closeable.read(cArray, 0, 4096)) > 0) { - stringWriter.write(Arrays.toString(cArray), 0, n2); - } - return stringWriter.toString(); - } - - public static void registerReceiver(String string2, BroadcastReceiver broadcastReceiver) { - IntentFilter intentFilter = new IntentFilter(string2); - LocalBroadcastManager - .getInstance( - ApplicationEnvironment - .getComponent() - .getApplicationContext() - ) - .registerReceiver(broadcastReceiver, intentFilter); - } - - public static String safeString(String string2) { - String string3 = string2; - if (string2 != null) return string3; - return ""; - } - - public static void sendBroadcast(String string2, Map map) { - LocalBroadcastManager localBroadcastManager = LocalBroadcastManager.getInstance(ApplicationEnvironment.getComponent().getApplicationContext()); - Intent intent = new Intent(string2); - if (map != null) { - for (String string3 : map.keySet()) { - intent.putExtra(string3, map.get(string3)); - } - } - localBroadcastManager.sendBroadcast(intent); - } - - public static void sendBroadcastSerializable(String string2, Map map) { - LocalBroadcastManager localBroadcastManager = LocalBroadcastManager.getInstance(ApplicationEnvironment.getComponent().getApplicationContext()); - Intent intent = new Intent(string2); - if (map != null) { - for (String string3 : map.keySet()) { - intent.putExtra(string3, map.get(string3)); - } - } - localBroadcastManager.sendBroadcast(intent); - } - - public static boolean stringsAreEquivalent(String string2, String string3) { - if (string2 != null && string3 != null) { - return string2.compareTo(string3) == 0; - } - if (string2 == string3) return true; - return false; - } - - public static void unregisterReceiver(BroadcastReceiver broadcastReceiver) { - LocalBroadcastManager.getInstance(ApplicationEnvironment.getComponent().getApplicationContext()).unregisterReceiver(broadcastReceiver); - } - - public static boolean validString(String string2) { - if (string2 == null) return false; - if (string2.length() <= 0) return false; - return true; - } -} - diff --git a/app/src/main/java/com/ea/nimble/bridge/BaseNativeCallback.java b/app/src/main/java/com/ea/nimble/bridge/BaseNativeCallback.java deleted file mode 100644 index bd712e7..0000000 --- a/app/src/main/java/com/ea/nimble/bridge/BaseNativeCallback.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Decompiled with CFR 0.152. - * - * Could not load the following classes: - * android.content.BroadcastReceiver - * android.content.Context - * android.content.Intent - * android.os.Bundle - */ -package com.ea.nimble.bridge; - -import android.content.BroadcastReceiver; -import android.content.Context; -import android.content.Intent; -import android.os.Bundle; -import com.ea.nimble.NetworkConnectionCallback; -import com.ea.nimble.NetworkConnectionHandle; -import com.ea.nimble.SynergyNetworkConnectionCallback; -import com.ea.nimble.SynergyNetworkConnectionHandle; -import com.ea.nimble.SynergyRequest; -import java.util.HashMap; -import java.util.Map; - -public class BaseNativeCallback -extends BroadcastReceiver -implements NetworkConnectionCallback, -SynergyNetworkConnectionCallback, -SynergyRequest.SynergyRequestPreparingCallback { - private int m_id; - - public BaseNativeCallback(int n2) { - this.m_id = n2; - } - - public static native void nativeCallback(int var0, Object ... var1); - - public static native void nativeFinalize(int var0); - - @Override - public void callback(NetworkConnectionHandle networkConnectionHandle) { - BaseNativeCallback.nativeCallback(this.m_id, networkConnectionHandle); - } - - @Override - public void callback(SynergyNetworkConnectionHandle synergyNetworkConnectionHandle) { - BaseNativeCallback.nativeCallback(this.m_id, synergyNetworkConnectionHandle); - } - - public void finalize() { - BaseNativeCallback.nativeFinalize(this.m_id); - } - - public void onReceive(Context object, Intent intent) { - Map hashMap = new HashMap<>(); - Bundle bundle = intent.getExtras(); - if (bundle != null) { - for (String string2 : bundle.keySet()) { - hashMap.put(string2, bundle.get(string2)); - } - } - BaseNativeCallback.nativeCallback(this.m_id, intent.getAction(), hashMap); - } - - @Override - public void prepareRequest(SynergyRequest synergyRequest) { - BaseNativeCallback.nativeCallback(this.m_id, synergyRequest); - } -} - diff --git a/app/src/main/java/com/ea/nimble/bridge/FacebookNativeCallback.java b/app/src/main/java/com/ea/nimble/bridge/FacebookNativeCallback.java deleted file mode 100644 index 85991fd..0000000 --- a/app/src/main/java/com/ea/nimble/bridge/FacebookNativeCallback.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Decompiled with CFR 0.152. - */ -package com.ea.nimble.bridge; - -import com.ea.nimble.IFacebook; -import com.ea.nimble.bridge.BaseNativeCallback; - -public class FacebookNativeCallback -implements IFacebook.FacebookCallback { - private int m_id; - - public FacebookNativeCallback(int n2) { - this.m_id = n2; - } - - @Override - public void callback(IFacebook iFacebook, boolean bl2, Exception exception) { - BaseNativeCallback.nativeCallback(this.m_id, iFacebook, bl2, exception); - } - - public void finalize() { - BaseNativeCallback.nativeFinalize(this.m_id); - } -} - diff --git a/app/src/main/java/com/ea/nimble/bridge/FriendsNativeCallback.java b/app/src/main/java/com/ea/nimble/bridge/FriendsNativeCallback.java deleted file mode 100644 index 98ca015..0000000 --- a/app/src/main/java/com/ea/nimble/bridge/FriendsNativeCallback.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Decompiled with CFR 0.152. - */ -package com.ea.nimble.bridge; - -import com.ea.nimble.Error; -import com.ea.nimble.friends.INimbleOriginFriendsService; -import com.ea.nimble.friends.NimbleFriendsList; -import com.ea.nimble.friends.NimbleFriendsRefreshCallback; -import com.ea.nimble.friends.NimbleFriendsRefreshResult; -import com.ea.nimble.friends.NimbleFriendsRefreshScope; -import com.ea.nimble.friends.NimbleUser; - -import java.util.ArrayList; - -public class FriendsNativeCallback -implements INimbleOriginFriendsService.NimbleFriendInvitationCallback, -INimbleOriginFriendsService.NimbleUserSearchCallback, -NimbleFriendsRefreshCallback { - private int m_id; - - public FriendsNativeCallback(int n2) { - this.m_id = n2; - } - - public void finalize() { - BaseNativeCallback.nativeFinalize(this.m_id); - } - - @Override - public void onCallback(NimbleFriendsList nimbleFriendsList, NimbleFriendsRefreshScope nimbleFriendsRefreshScope, NimbleFriendsRefreshResult nimbleFriendsRefreshResult) { - BaseNativeCallback.nativeCallback(this.m_id, nimbleFriendsList, nimbleFriendsRefreshScope, nimbleFriendsRefreshResult); - } - - @Override - public void onCallback(ArrayList arrayList, Error error) { - BaseNativeCallback.nativeCallback(this.m_id, arrayList, error); - } - - @Override - public void onCallback(boolean bl2, Error error) { - BaseNativeCallback.nativeCallback(this.m_id, bl2, error); - } -} - diff --git a/app/src/main/java/com/ea/nimble/bridge/IdentityGenericAuthenticationConductor.java b/app/src/main/java/com/ea/nimble/bridge/IdentityGenericAuthenticationConductor.java deleted file mode 100644 index 3f6f10c..0000000 --- a/app/src/main/java/com/ea/nimble/bridge/IdentityGenericAuthenticationConductor.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Decompiled with CFR 0.152. - */ -package com.ea.nimble.bridge; - -import com.ea.nimble.bridge.BaseNativeCallback; -import com.ea.nimble.identity.INimbleIdentityGenericAuthenticationConductor; -import com.ea.nimble.identity.INimbleIdentityGenericLoginResolver; -import com.ea.nimble.identity.INimbleIdentityGenericLogoutResolver; - -public class IdentityGenericAuthenticationConductor -implements INimbleIdentityGenericAuthenticationConductor { - private int m_id; - - public IdentityGenericAuthenticationConductor(int n2) { - this.m_id = n2; - } - - public void finalize() { - BaseNativeCallback.nativeFinalize(this.m_id); - } - - @Override - public void handleLogin(INimbleIdentityGenericLoginResolver iNimbleIdentityGenericLoginResolver) { - BaseNativeCallback.nativeCallback(this.m_id, iNimbleIdentityGenericLoginResolver); - } - - @Override - public void handleLogout(INimbleIdentityGenericLogoutResolver iNimbleIdentityGenericLogoutResolver) { - BaseNativeCallback.nativeCallback(this.m_id, iNimbleIdentityGenericLogoutResolver, null); - } -} - diff --git a/app/src/main/java/com/ea/nimble/bridge/IdentityMigrationAuthenticationConductor.java b/app/src/main/java/com/ea/nimble/bridge/IdentityMigrationAuthenticationConductor.java deleted file mode 100644 index 48c5f5c..0000000 --- a/app/src/main/java/com/ea/nimble/bridge/IdentityMigrationAuthenticationConductor.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Decompiled with CFR 0.152. - */ -package com.ea.nimble.bridge; - -import com.ea.nimble.bridge.BaseNativeCallback; -import com.ea.nimble.identity.INimbleIdentityMigrationAuthenticationConductor; -import com.ea.nimble.identity.INimbleIdentityMigrationLoginResolver; -import com.ea.nimble.identity.INimbleIdentityPendingMigrationResolver; - -public class IdentityMigrationAuthenticationConductor -implements INimbleIdentityMigrationAuthenticationConductor { - private int m_id; - - public IdentityMigrationAuthenticationConductor(int n2) { - this.m_id = n2; - } - - public void finalize() { - BaseNativeCallback.nativeFinalize(this.m_id); - } - - @Override - public void handleLogin(INimbleIdentityMigrationLoginResolver iNimbleIdentityMigrationLoginResolver) { - BaseNativeCallback.nativeCallback(this.m_id, iNimbleIdentityMigrationLoginResolver); - } - - @Override - public void handleLogout() { - BaseNativeCallback.nativeCallback(this.m_id, new Object[0]); - } - - @Override - public void handlePendingMigration(INimbleIdentityPendingMigrationResolver iNimbleIdentityPendingMigrationResolver) { - BaseNativeCallback.nativeCallback(this.m_id, iNimbleIdentityPendingMigrationResolver, null); - } -} - diff --git a/app/src/main/java/com/ea/nimble/bridge/IdentityNativeCallback.java b/app/src/main/java/com/ea/nimble/bridge/IdentityNativeCallback.java deleted file mode 100644 index ae21a25..0000000 --- a/app/src/main/java/com/ea/nimble/bridge/IdentityNativeCallback.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Decompiled with CFR 0.152. - * - * Could not load the following classes: - * org.json.JSONObject - */ -package com.ea.nimble.bridge; - -import com.ea.nimble.Error; -import com.ea.nimble.bridge.BaseNativeCallback; -import com.ea.nimble.identity.INimbleIdentityAuthenticator; -import org.json.JSONObject; - -public class IdentityNativeCallback -implements INimbleIdentityAuthenticator.NimbleIdentityAuthenticatorCallback, -INimbleIdentityAuthenticator.NimbleIdentityFriendsIdentityInfoCallback, -INimbleIdentityAuthenticator.NimbleIdentityServerAuthCodeCallback { - private int m_id; - - public IdentityNativeCallback(int n2) { - this.m_id = n2; - } - - public void finalize() { - BaseNativeCallback.nativeFinalize(this.m_id); - } - - @Override - public void onCallback(INimbleIdentityAuthenticator iNimbleIdentityAuthenticator, Error error) { - BaseNativeCallback.nativeCallback(this.m_id, iNimbleIdentityAuthenticator, error); - } - - @Override - public void onCallback(INimbleIdentityAuthenticator iNimbleIdentityAuthenticator, String string2, String string3, String string4, Error error) { - BaseNativeCallback.nativeCallback(this.m_id, iNimbleIdentityAuthenticator, string2, string3, string4, error); - } - - @Override - public void onCallback(INimbleIdentityAuthenticator iNimbleIdentityAuthenticator, JSONObject jSONObject, Error error) { - BaseNativeCallback.nativeCallback(this.m_id, iNimbleIdentityAuthenticator, jSONObject, error); - } -} - diff --git a/app/src/main/java/com/ea/nimble/bridge/IdentityPlainAuthenticationConductor.java b/app/src/main/java/com/ea/nimble/bridge/IdentityPlainAuthenticationConductor.java deleted file mode 100644 index fe19984..0000000 --- a/app/src/main/java/com/ea/nimble/bridge/IdentityPlainAuthenticationConductor.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Decompiled with CFR 0.152. - */ -package com.ea.nimble.bridge; - -import com.ea.nimble.bridge.BaseNativeCallback; -import com.ea.nimble.identity.INimbleIdentityPlainAuthenticationConductor; - -public class IdentityPlainAuthenticationConductor -implements INimbleIdentityPlainAuthenticationConductor { - private int m_id; - - public IdentityPlainAuthenticationConductor(int n2) { - this.m_id = n2; - } - - public void finalize() { - BaseNativeCallback.nativeFinalize(this.m_id); - } - - @Override - public void handleLogin() { - BaseNativeCallback.nativeCallback(this.m_id, new Object[0]); - } - - @Override - public void handleLogout() { - BaseNativeCallback.nativeCallback(this.m_id, new Object[]{null}); - } -} - diff --git a/app/src/main/java/com/ea/nimble/bridge/MTXNativeCallback.java b/app/src/main/java/com/ea/nimble/bridge/MTXNativeCallback.java deleted file mode 100644 index 99515a0..0000000 --- a/app/src/main/java/com/ea/nimble/bridge/MTXNativeCallback.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Decompiled with CFR 0.152. - */ -package com.ea.nimble.bridge; - -import com.ea.nimble.bridge.BaseNativeCallback; -import com.ea.nimble.mtx.INimbleMTX; -import com.ea.nimble.mtx.NimbleMTXTransaction; - -public class MTXNativeCallback -implements INimbleMTX.FinalizeTransactionCallback, -INimbleMTX.ItemGrantedCallback, -INimbleMTX.PurchaseTransactionCallback { - private int m_id; - - public MTXNativeCallback(int n2) { - this.m_id = n2; - } - - public void finalize() { - BaseNativeCallback.nativeFinalize(this.m_id); - } - - @Override - public void finalizeComplete(NimbleMTXTransaction nimbleMTXTransaction) { - BaseNativeCallback.nativeCallback(this.m_id, nimbleMTXTransaction); - } - - @Override - public void itemGrantedComplete(NimbleMTXTransaction nimbleMTXTransaction) { - BaseNativeCallback.nativeCallback(this.m_id, nimbleMTXTransaction); - } - - @Override - public void purchaseComplete(NimbleMTXTransaction nimbleMTXTransaction) { - BaseNativeCallback.nativeCallback(this.m_id, nimbleMTXTransaction, true); - } - - @Override - public void unverifiedReceiptReceived(NimbleMTXTransaction nimbleMTXTransaction) { - BaseNativeCallback.nativeCallback(this.m_id, nimbleMTXTransaction, false); - } -} - diff --git a/app/src/main/java/com/ea/nimble/friends/INimbleFriends.java b/app/src/main/java/com/ea/nimble/friends/INimbleFriends.java deleted file mode 100644 index d1d5798..0000000 --- a/app/src/main/java/com/ea/nimble/friends/INimbleFriends.java +++ /dev/null @@ -1,9 +0,0 @@ -package com.ea.nimble.friends; - -/* loaded from: stdlib.jar:com/ea/nimble/friends/INimbleFriends.class */ -public interface INimbleFriends { - public static final int IDENTITY_FRIEND_INFO_REQUEST_LIMIT = 20; - public static final String NIMBLE_NOTIFICATION_FRIENDS_LIST_UPDATE = "nimble.notification.friends.update"; - - NimbleFriendsList getFriendsList(String str, boolean z); -} diff --git a/app/src/main/java/com/ea/nimble/friends/INimbleOriginFriendsService.java b/app/src/main/java/com/ea/nimble/friends/INimbleOriginFriendsService.java deleted file mode 100644 index 6e19071..0000000 --- a/app/src/main/java/com/ea/nimble/friends/INimbleOriginFriendsService.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.ea.nimble.friends; - -import com.ea.nimble.Error; -import java.util.ArrayList; - -/* loaded from: stdlib.jar:com/ea/nimble/friends/INimbleOriginFriendsService.class */ -public interface INimbleOriginFriendsService { - - /* loaded from: stdlib.jar:com/ea/nimble/friends/INimbleOriginFriendsService$NimbleFriendInvitationCallback.class */ - public interface NimbleFriendInvitationCallback { - void onCallback(boolean z, Error error); - } - - /* loaded from: stdlib.jar:com/ea/nimble/friends/INimbleOriginFriendsService$NimbleUserSearchCallback.class */ - public interface NimbleUserSearchCallback { - void onCallback(ArrayList arrayList, Error error); - } - - void acceptFriendInvitation(String str, NimbleFriendInvitationCallback nimbleFriendInvitationCallback); - - void declineFriendInvitation(String str, NimbleFriendInvitationCallback nimbleFriendInvitationCallback); - - void listFriendInvitationsReceived(NimbleUserSearchCallback nimbleUserSearchCallback); - - void listFriendInvitationsSent(NimbleUserSearchCallback nimbleUserSearchCallback); - - void searchUserByDisplayName(String str, NimbleUserSearchCallback nimbleUserSearchCallback); - - void searchUserByEmail(String str, NimbleUserSearchCallback nimbleUserSearchCallback); - - void sendFriendInvitation(String str, String str2, NimbleFriendInvitationCallback nimbleFriendInvitationCallback); - - void sendInvitationOverEmail(ArrayList arrayList, String str, String str2, NimbleFriendInvitationCallback nimbleFriendInvitationCallback); - - void sendInvitationOverSMS(ArrayList arrayList, String str, NimbleFriendInvitationCallback nimbleFriendInvitationCallback); -} diff --git a/app/src/main/java/com/ea/nimble/friends/NimbleFacebookUser.java b/app/src/main/java/com/ea/nimble/friends/NimbleFacebookUser.java deleted file mode 100644 index 6fb2222..0000000 --- a/app/src/main/java/com/ea/nimble/friends/NimbleFacebookUser.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.ea.nimble.friends; - -import com.ea.nimble.Global; -import java.util.Date; -import org.json.JSONObject; - -class NimbleFacebookUser extends NimbleUser { - - public NimbleFacebookUser(JSONObject jSONObject) { - this.authenticatorId = Global.NIMBLE_AUTHENTICATOR_FACEBOOK; - this.userId = jSONObject.optString("id"); - this.displayName = jSONObject.optString("name"); - this.imageUrl = jSONObject.optJSONObject("picture").optJSONObject("data").optString(""); - this.refreshTimestamp = new Date(); - setPlayedCurrentGame(NimbleUser.PlayedCurrentGameFlag.PLAYED); - } -} diff --git a/app/src/main/java/com/ea/nimble/friends/NimbleFriends.java b/app/src/main/java/com/ea/nimble/friends/NimbleFriends.java deleted file mode 100644 index 221ebe1..0000000 --- a/app/src/main/java/com/ea/nimble/friends/NimbleFriends.java +++ /dev/null @@ -1,12 +0,0 @@ -package com.ea.nimble.friends; - -import com.ea.nimble.Base; - -/* loaded from: stdlib.jar:com/ea/nimble/friends/NimbleFriends.class */ -public class NimbleFriends { - public static final String NIMBLE_COMPONENT_ID_FRIENDS = "com.ea.nimble.friends"; - - public static INimbleFriends getComponent() { - return (INimbleFriends) Base.getComponent(NIMBLE_COMPONENT_ID_FRIENDS); - } -} diff --git a/app/src/main/java/com/ea/nimble/friends/NimbleFriendsError.java b/app/src/main/java/com/ea/nimble/friends/NimbleFriendsError.java deleted file mode 100644 index 140bb83..0000000 --- a/app/src/main/java/com/ea/nimble/friends/NimbleFriendsError.java +++ /dev/null @@ -1,64 +0,0 @@ -package com.ea.nimble.friends; - -import com.ea.nimble.Error; - -public class NimbleFriendsError extends Error { - public static final String NIMBLE_FRIENDS_ERROR_DOMAIN = "NimbleFriendsError"; - private static final long serialVersionUID = 1; - - /* loaded from: stdlib.jar:com/ea/nimble/friends/NimbleFriendsError$Code.class */ - public enum Code { - NIMBLE_FRIENDS_FACEBOOK_NOT_AVAILABLE(90000), - NIMBLE_FRIENDS_IDENTITY_NOT_AVAILABLE(90001), - NIMBLE_FRIENDS_FACEBOOK_USER_NOT_LOGGED_IN(90002), - NIMBLE_FRIENDS_EMAIL_NOT_AVAILABLE(90003), - NIMBLE_FRIENDS_SMS_NOT_AVAILABLE(90004), - NIMBLE_FRIENDS_EMAIL_LAST_REQUEST_NOT_FINISHED(90005), - NIMBLE_FRIENDS_SMS_LAST_REQUEST_NOT_FINISHED(90006), - NIMBLE_FRIENDS_SMS_NOT_SENT_OUT(90007), - NIMBLE_FRIENDS_NO_TARGETS_PROVIDED(90008), - NIMBLE_FRIENDS_SERVER_RETURNED_ERROR(90009), - NIMBLE_FRIENDS_REFRESH_SCOPE_INVALID(10001), - NIMBLE_FRIENDS_REFRESH_SCOPE_RANGE_EXCEED_LIMIT(10002), - NIMBLE_FRIENDS_REFRESH_SCOPE_INVALID_START_INDEX(10003), - NIMBLE_FRIENDS_REFRESH_FRIENDS_PROVIDER_NOT_AVAILABLE(10004), - NIMBLE_FRIENDS_REFRESH_NO_USER_IDS_LIST(10005), - NIMBLE_FRIENDS_REFRESH_IDENTITY_SERVER_ERROR(10006), - NIMBLE_FRIENDS_REFRESH_IDENTITY_SERVER_EMPTY_RESPONSE(10007), - NIMBLE_FRIENDS_REFRESH_FRIENDS_LIST_EMPTY(10008), - NIMBLE_FRIENDS_REFRESH_FRIENDS_LIST_NOT_UPDATED(10009), - NIMBLE_FRIENDS_REFRESH_AUTHENTICATOR_NOT_SUPPORTED(10010), - NIMBLE_FRIENDS_REFRESH_AUTHENTICATOR_NOT_LOGGED_IN(10011), - NIMBLE_FRIENDS_REFRESH_SCOPE_FAILED_TO_CREATE_GOS_REQUEST(10012), - NIMBLE_FRIENDS_FAILED_TO_CREATE_GOS_REQUEST(10012), - NIMBLE_FRIENDS_REFRESH_SCOPE_ERROR_PARSING_HTTP_RESPONSE(10013), - NIMBLE_FRIENDS_REFRESH_SCOPE_EMPTY_HTTP_RESPONSE(10014), - NIMBLE_FRIENDS_REFRESH_SCOPE_SERVER_RESPONSE_ERROR(10015), - NIMBLE_FRIENDS_REFRESH_SCOPE_FRIENDS_LIST_TYPE_UNSUPPORTED(10016), - NIMBLE_FRIENDS_REFRESH_TYPE_UNSUPPORTED(10017), - NIMBLE_FRIENDS_ORIGIN_SERVICES_SERVER_RESPONSE_ERROR(10018), - NIMBLE_FRIENDS_UNKNOWN_ERROR(0); - - private int m_value; - - Code(int i) { - this.m_value = i; - } - - public int intValue() { - return this.m_value; - } - } - - public NimbleFriendsError(int i, String str) { - super(NIMBLE_FRIENDS_ERROR_DOMAIN, i, str, null); - } - - public NimbleFriendsError(int i, String str, Throwable th) { - super(NIMBLE_FRIENDS_ERROR_DOMAIN, i, str, th); - } - - public NimbleFriendsError(Code code, String str) { - super(NIMBLE_FRIENDS_ERROR_DOMAIN, code.intValue(), str, null); - } -} diff --git a/app/src/main/java/com/ea/nimble/friends/NimbleFriendsImpl.java b/app/src/main/java/com/ea/nimble/friends/NimbleFriendsImpl.java deleted file mode 100644 index a701165..0000000 --- a/app/src/main/java/com/ea/nimble/friends/NimbleFriendsImpl.java +++ /dev/null @@ -1,105 +0,0 @@ -package com.ea.nimble.friends; - -import android.content.BroadcastReceiver; -import android.content.Context; -import android.content.Intent; -import com.ea.nimble.Base; -import com.ea.nimble.Component; -import com.ea.nimble.Global; -import com.ea.nimble.Log; -import com.ea.nimble.LogSource; -import com.ea.nimble.Utility; -import com.ea.nimble.identity.INimbleIdentity; -import com.ea.nimble.identity.INimbleIdentityAuthenticator; -import java.util.Hashtable; - -/* loaded from: stdlib.jar:com/ea/nimble/friends/NimbleFriendsImpl.class */ -public class NimbleFriendsImpl extends Component implements LogSource, INimbleFriends { - private Hashtable m_friends = new Hashtable<>(); - private BroadcastReceiver m_authenticatorLoginChangeReceiver = new BroadcastReceiver() { // from class: com.ea.nimble.friends.NimbleFriendsImpl.1 - @Override // android.content.BroadcastReceiver - public void onReceive(Context context, Intent intent) { - INimbleIdentityAuthenticator authenticatorById; - if (intent != null && intent.getExtras() != null && intent.getAction() != null && intent.getAction().equalsIgnoreCase(Global.NIMBLE_NOTIFICATION_IDENTITY_AUTHENTICATION_UPDATE)) { - String string = intent.getExtras().getString(Global.NIMBLE_IDENTITY_DICTIONARY_KEY_AUTHENTICATOR_ID); - if (Utility.validString(string) && (authenticatorById = ((INimbleIdentity) Base.getComponent("com.ea.nimble.identity")).getAuthenticatorById(string)) != null) { - if (authenticatorById.getState() == INimbleIdentityAuthenticator.NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_SUCCESS) { - if (NimbleFriendsImpl.this.m_friends.get(string) != null) { - return; - } - if (Global.NIMBLE_AUTHENTICATOR_FACEBOOK == string) { - NimbleFriendsImpl.this.m_friends.put(string, new NimbleFriendsListFacebook()); - } else if (Global.NIMBLE_AUTHENTICATOR_ORIGIN == string) { - NimbleFriendsImpl.this.m_friends.put(string, new NimbleFriendsListOrigin()); - } - } else if (NimbleFriendsImpl.this.m_friends.get(string) != null) { - ((NimbleFriendsListImpl) NimbleFriendsImpl.this.m_friends.get(string)).clear(); - NimbleFriendsImpl.this.m_friends.remove(string); - } - } - } - } - }; - - private static void initialize() { - Base.registerComponent(new NimbleFriendsImpl(), NimbleFriends.NIMBLE_COMPONENT_ID_FRIENDS); - } - - @Override // com.ea.nimble.Component - public void cleanup() { - Log.Helper.LOGV(this, "Component cleanup", new Object[0]); - try { - Utility.unregisterReceiver(this.m_authenticatorLoginChangeReceiver); - } catch (Exception e) { - } - } - - @Override // com.ea.nimble.Component - public String getComponentId() { - return NimbleFriends.NIMBLE_COMPONENT_ID_FRIENDS; - } - - @Override // com.ea.nimble.friends.INimbleFriends - public NimbleFriendsList getFriendsList(String str, boolean z) { - NimbleFriendsList friendsList; - synchronized (this) { - friendsList = this.m_friends.get(str) != null ? this.m_friends.get(str).getFriendsList(z) : null; - } - return friendsList; - } - - @Override // com.ea.nimble.LogSource - public String getLogSourceTitle() { - return "NimbleFriendsService"; - } - - @Override // com.ea.nimble.Component - public void restore() { - Log.Helper.LOGV(this, "Component restore", new Object[0]); - } - - @Override // com.ea.nimble.Component - public void resume() { - Log.Helper.LOGV(this, "Component resume", new Object[0]); - } - - @Override // com.ea.nimble.Component - public void setup() { - Log.Helper.LOGD(this, "Component setup", new Object[0]); - try { - Utility.registerReceiver(Global.NIMBLE_NOTIFICATION_IDENTITY_AUTHENTICATION_UPDATE, this.m_authenticatorLoginChangeReceiver); - } catch (Exception e) { - } - } - - @Override // com.ea.nimble.Component - public void suspend() { - Log.Helper.LOGV(this, "Component suspend", new Object[0]); - } - - /* JADX INFO: Access modifiers changed from: protected */ - @Override // com.ea.nimble.Component - public void teardown() { - Log.Helper.LOGV(this, "Component teardown", new Object[0]); - } -} diff --git a/app/src/main/java/com/ea/nimble/friends/NimbleFriendsList.java b/app/src/main/java/com/ea/nimble/friends/NimbleFriendsList.java deleted file mode 100644 index 26a554c..0000000 --- a/app/src/main/java/com/ea/nimble/friends/NimbleFriendsList.java +++ /dev/null @@ -1,65 +0,0 @@ -package com.ea.nimble.friends; - -import com.ea.nimble.friends.NimbleFriendsError; -import java.util.ArrayList; - -/* loaded from: stdlib.jar:com/ea/nimble/friends/NimbleFriendsList.class */ -public class NimbleFriendsList { - private NimbleFriendsListImpl m_friendsListImpl; - private FriendsListType m_type; - - /* loaded from: stdlib.jar:com/ea/nimble/friends/NimbleFriendsList$FriendsListType.class */ - public enum FriendsListType { - ALL_FRIENDS, - CURRENT_GAME_FRIENDS - } - - public NimbleFriendsList(NimbleFriendsListImpl nimbleFriendsListImpl, FriendsListType friendsListType) { - this.m_friendsListImpl = nimbleFriendsListImpl; - this.m_type = friendsListType; - } - - public NimbleUser getFriendProfile(String str) { - if (this.m_friendsListImpl != null) { - return this.m_friendsListImpl.m_friends.get(str); - } - return null; - } - - public ArrayList getFriends() { - if (this.m_friendsListImpl != null) { - return this.m_type == FriendsListType.CURRENT_GAME_FRIENDS ? this.m_friendsListImpl.m_playedFriendsList : this.m_friendsListImpl.m_friendsList; - } - return null; - } - - public int getRefreshPageSize() { - if (this.m_friendsListImpl != null) { - return this.m_friendsListImpl.getPageSize(); - } - return -1; - } - - public int getTotalFriendCount() { - return this.m_type == FriendsListType.CURRENT_GAME_FRIENDS ? this.m_friendsListImpl.m_totalPlayedFriends : this.m_friendsListImpl.m_totalFriends; - } - - FriendsListType getType() { - return this.m_type; - } - - public void refreshFriendsList(NimbleFriendsRefreshScope nimbleFriendsRefreshScope, NimbleFriendsRefreshCallback nimbleFriendsRefreshCallback) { - synchronized (this) { - if (this.m_friendsListImpl != null) { - this.m_friendsListImpl.refreshFriendsList(nimbleFriendsRefreshScope, nimbleFriendsRefreshCallback, this.m_type); - } else if (nimbleFriendsRefreshCallback != null) { - NimbleFriendsError nimbleFriendsError = new NimbleFriendsError(NimbleFriendsError.Code.NIMBLE_FRIENDS_REFRESH_FRIENDS_PROVIDER_NOT_AVAILABLE, "Specified Friends provider is not available. Failed to refresh Friends list."); - NimbleFriendsRefreshResult nimbleFriendsRefreshResult = new NimbleFriendsRefreshResult(); - nimbleFriendsRefreshResult.m_error = nimbleFriendsError; - nimbleFriendsRefreshResult.m_success = false; - nimbleFriendsRefreshResult.m_userList = null; - nimbleFriendsRefreshCallback.onCallback(null, nimbleFriendsRefreshScope, nimbleFriendsRefreshResult); - } - } - } -} diff --git a/app/src/main/java/com/ea/nimble/friends/NimbleFriendsListFacebook.java b/app/src/main/java/com/ea/nimble/friends/NimbleFriendsListFacebook.java deleted file mode 100644 index 31a1831..0000000 --- a/app/src/main/java/com/ea/nimble/friends/NimbleFriendsListFacebook.java +++ /dev/null @@ -1,99 +0,0 @@ -package com.ea.nimble.friends; - -import com.ea.nimble.Base; -import com.ea.nimble.Error; -import com.ea.nimble.Global; -import com.ea.nimble.IFacebook; -import com.ea.nimble.Log; -import com.ea.nimble.friends.NimbleFriendsError; -import com.ea.nimble.friends.NimbleFriendsList; -import java.util.List; -import org.json.JSONArray; -import org.json.JSONObject; - -/* loaded from: stdlib.jar:com/ea/nimble/friends/NimbleFriendsListFacebook.class */ -public class NimbleFriendsListFacebook extends NimbleFriendsListImpl { - private static final String FACEBOOK_COMPONENT_ID = "com.ea.nimble.facebook"; - - /* JADX INFO: Access modifiers changed from: package-private */ - public NimbleFriendsListFacebook() { - this.LOG_SOURCE_TITLE = "NimbleFriendsListFacebook"; - this.m_authenticatorId = Global.NIMBLE_AUTHENTICATOR_FACEBOOK; - Log.Helper.LOGV(this, "Constructed", new Object[0]); - this.m_pageSize = 1000; - this.m_nimbleFriendsList = new NimbleFriendsList(this, NimbleFriendsList.FriendsListType.ALL_FRIENDS); - this.m_nimblePlayedFriendsList = new NimbleFriendsList(this, NimbleFriendsList.FriendsListType.CURRENT_GAME_FRIENDS); - } - - @Override // com.ea.nimble.friends.NimbleFriendsListImpl - protected NimbleUser createNimbleUser(JSONObject jSONObject) { - return new NimbleFacebookUser(jSONObject); - } - - @Override // com.ea.nimble.friends.NimbleFriendsListImpl, com.ea.nimble.LogSource - public /* bridge */ /* synthetic */ String getLogSourceTitle() { - return super.getLogSourceTitle(); - } - - @Override // com.ea.nimble.friends.NimbleFriendsListImpl - protected void refreshFriendsListBasicInfo(final int i, final int i2, String str, final NimbleFriendsList.FriendsListType friendsListType, final NimbleFriendsRefreshCallback nimbleFriendsRefreshCallback, final NimbleFriendsRefreshBasicInfo nimbleFriendsRefreshBasicInfo) { - if (friendsListType == NimbleFriendsList.FriendsListType.ALL_FRIENDS) { - Log.Helper.LOGE(this, "Facebook no longer supports getting friends with ALL_FRIENDS flag", new Object[0]); - invokeCallbackWithBasicScopeError(nimbleFriendsRefreshBasicInfo, nimbleFriendsRefreshCallback, NimbleFriendsError.Code.NIMBLE_FRIENDS_REFRESH_SCOPE_FRIENDS_LIST_TYPE_UNSUPPORTED, "Facebook no longer supports getting friends with ALL_FRIENDS flag", friendsListType); - } else if (!isNimbleComponentAvailable("com.ea.nimble.facebook") || !((IFacebook) Base.getComponent("com.ea.nimble.facebook")).hasOpenSession()) { - Log.Helper.LOGE(this, "Unable to refresh friends from Facebook because NimbleFacebook is either unavailable or the session is not open", new Object[0]); - invokeCallbackWithBasicScopeError(nimbleFriendsRefreshBasicInfo, nimbleFriendsRefreshCallback, NimbleFriendsError.Code.NIMBLE_FRIENDS_FACEBOOK_USER_NOT_LOGGED_IN, "Unable to refresh friends from Facebook because NimbleFacebook is either unavailable or the session is not open", friendsListType); - } else { - ((IFacebook) Base.getComponent("com.ea.nimble.facebook")).retrieveFriends(i, i2, new IFacebook.FacebookFriendsCallback() { // from class: com.ea.nimble.friends.NimbleFriendsListFacebook.1 - @Override // com.ea.nimble.IFacebook.FacebookFriendsCallback - public void callback(IFacebook iFacebook, JSONArray jSONArray, Error error) { - if (error != null) { - Log.Helper.LOGE(this, String.format("Error in retrieving friends list from Facebook. Error :%s", error.toString()), new Object[0]); - if (nimbleFriendsRefreshCallback != null) { - NimbleFriendsRangeRefreshResult nimbleFriendsRangeRefreshResult = new NimbleFriendsRangeRefreshResult(); - nimbleFriendsRangeRefreshResult.m_success = false; - nimbleFriendsRangeRefreshResult.m_error = error; - nimbleFriendsRangeRefreshResult.m_userList = null; - nimbleFriendsRangeRefreshResult.m_startIndex = i; - nimbleFriendsRangeRefreshResult.m_size = i2; - nimbleFriendsRangeRefreshResult.m_friendListEndInRefresh = false; - if (friendsListType == NimbleFriendsList.FriendsListType.CURRENT_GAME_FRIENDS) { - nimbleFriendsRefreshCallback.onCallback(NimbleFriendsListFacebook.this.m_nimblePlayedFriendsList, nimbleFriendsRefreshBasicInfo, nimbleFriendsRangeRefreshResult); - } else { - nimbleFriendsRefreshCallback.onCallback(NimbleFriendsListFacebook.this.m_nimbleFriendsList, nimbleFriendsRefreshBasicInfo, nimbleFriendsRangeRefreshResult); - } - } - } else { - if (jSONArray == null || jSONArray.length() <= 0) { - Log.Helper.LOGD(NimbleFriendsListFacebook.this, "No friends retrieved from Facebook even though the operation was successful", new Object[0]); - if (nimbleFriendsRefreshCallback != null) { - NimbleFriendsRangeRefreshResult nimbleFriendsRangeRefreshResult2 = new NimbleFriendsRangeRefreshResult(); - nimbleFriendsRangeRefreshResult2.m_success = true; - nimbleFriendsRangeRefreshResult2.m_error = null; - nimbleFriendsRangeRefreshResult2.m_userList = null; - nimbleFriendsRangeRefreshResult2.m_startIndex = i; - nimbleFriendsRangeRefreshResult2.m_size = i2; - nimbleFriendsRangeRefreshResult2.m_friendListEndInRefresh = false; - if (friendsListType == NimbleFriendsList.FriendsListType.CURRENT_GAME_FRIENDS) { - nimbleFriendsRefreshCallback.onCallback(NimbleFriendsListFacebook.this.m_nimblePlayedFriendsList, nimbleFriendsRefreshBasicInfo, nimbleFriendsRangeRefreshResult2); - return; - } else { - nimbleFriendsRefreshCallback.onCallback(NimbleFriendsListFacebook.this.m_nimbleFriendsList, nimbleFriendsRefreshBasicInfo, nimbleFriendsRangeRefreshResult2); - return; - } - } - } - Log.Helper.LOGD(this, "Successfully retrieved friends for specified scope from Facebook. Proceeding with NimbleFriendList update", new Object[0]); - NimbleFriendsListFacebook.this.updateFriendsListBasicInfo(jSONArray, friendsListType, nimbleFriendsRefreshCallback, nimbleFriendsRefreshBasicInfo); - } - } - }); - } - } - - @Override // com.ea.nimble.friends.NimbleFriendsListImpl - protected void refreshFriendsListImageUrl(List list, NimbleFriendsList.FriendsListType friendsListType, NimbleFriendsRefreshCallback nimbleFriendsRefreshCallback, NimbleFriendsRefreshScope nimbleFriendsRefreshScope) { - Log.Helper.LOGI(this, "Facebook Friends Service does not support ImageUri refresh because Facebook friends already have Image URI information", new Object[0]); - invokeCallbackWithScopeError(nimbleFriendsRefreshScope, nimbleFriendsRefreshCallback, NimbleFriendsError.Code.NIMBLE_FRIENDS_REFRESH_TYPE_UNSUPPORTED, "Facebook Friends Service does not support ImageUri refresh because Facebook friends already have Image URI information", friendsListType); - } -} diff --git a/app/src/main/java/com/ea/nimble/friends/NimbleFriendsListImpl.java b/app/src/main/java/com/ea/nimble/friends/NimbleFriendsListImpl.java deleted file mode 100644 index a7e1fac..0000000 --- a/app/src/main/java/com/ea/nimble/friends/NimbleFriendsListImpl.java +++ /dev/null @@ -1,635 +0,0 @@ -package com.ea.nimble.friends; - -import android.annotation.SuppressLint; - -import com.ea.nimble.Base; -import com.ea.nimble.Error; -import com.ea.nimble.Global; -import com.ea.nimble.Log; -import com.ea.nimble.LogSource; -import com.ea.nimble.Network; -import com.ea.nimble.SynergyEnvironment; -import com.ea.nimble.Utility; -import com.ea.nimble.identity.INimbleIdentity; -import com.ea.nimble.identity.INimbleIdentityAuthenticator; - -import org.json.JSONArray; -import org.json.JSONObject; - -import java.util.ArrayList; -import java.util.Date; -import java.util.HashMap; -import java.util.Hashtable; -import java.util.List; - -@SuppressLint({"DefaultLocale"}) -/* loaded from: stdlib.jar:com/ea/nimble/friends/NimbleFriendsListImpl.class */ -public abstract class NimbleFriendsListImpl implements LogSource { - protected NimbleFriendsList m_nimbleFriendsList; - protected NimbleFriendsList m_nimblePlayedFriendsList; - protected Hashtable m_friends = new Hashtable<>(); - protected ArrayList m_friendsList = new ArrayList<>(); - protected ArrayList m_playedFriendsList = new ArrayList<>(); - protected int m_totalFriends = -1; - protected int m_totalPlayedFriends = -1; - protected String LOG_SOURCE_TITLE = "NimbleFriendsListImpl"; - protected int m_pageSize = 100; - protected String m_authenticatorId = ""; - - public NimbleFriendsListImpl() { - Log.Helper.LOGV(this, "No default implementation for NimbleFriendsListImpl - Must construct a typed-NimbleFriendsListImpl", new Object[0]); - } - - private Error environmentCheck() { - Log.Helper.LOGV(this, "Environment Check -->", new Object[0]); - if (Network.getComponent().getStatus() != Network.Status.OK) { - Log.Helper.LOGD(this, "Environment Check - Network unavailable", new Object[0]); - return new Error(Error.Code.NETWORK_NO_CONNECTION, "Friends component cannot do updates without network"); - } else if (SynergyEnvironment.getComponent().isDataAvailable()) { - return null; - } else { - Log.Helper.LOGD(this, "Environment Check - Synergy Environment Not Ready", new Object[0]); - return new Error(Error.Code.SYNERGY_GET_DIRECTION_TIMEOUT, "Friends component is still in initialization and not ready for operation"); - } - } - - public void clear() { - synchronized (this) { - if (this.m_friends != null) { - this.m_friends.clear(); - } - if (this.m_friendsList != null) { - this.m_friendsList.clear(); - } - if (this.m_playedFriendsList != null) { - this.m_playedFriendsList.clear(); - } - this.m_totalFriends = -1; - this.m_totalPlayedFriends = -1; - } - } - - protected abstract NimbleUser createNimbleUser(JSONObject jSONObject); - - public NimbleFriendsList getFriendsList(boolean z) { - synchronized (this) { - if (z) { - Log.Helper.LOGV(this, "Returning NimbleFriendsList with playedCurrentGameOnly flag returned", new Object[0]); - return this.m_nimblePlayedFriendsList; - } - Log.Helper.LOGV(this, "Returning NimbleFriendsList with all friends", new Object[0]); - return this.m_nimbleFriendsList; - } - } - - @Override // com.ea.nimble.LogSource - public String getLogSourceTitle() { - return this.LOG_SOURCE_TITLE; - } - - public int getPageSize() { - return this.m_pageSize; - } - - void invokeCallbackWithBasicScopeError(NimbleFriendsRefreshBasicInfo nimbleFriendsRefreshBasicInfo, NimbleFriendsRefreshCallback nimbleFriendsRefreshCallback, Error error, NimbleFriendsList.FriendsListType friendsListType) { - if (nimbleFriendsRefreshCallback != null) { - NimbleFriendsRangeRefreshResult nimbleFriendsRangeRefreshResult = new NimbleFriendsRangeRefreshResult(); - nimbleFriendsRangeRefreshResult.m_success = false; - nimbleFriendsRangeRefreshResult.m_error = error; - nimbleFriendsRangeRefreshResult.m_userList = null; - nimbleFriendsRangeRefreshResult.m_startIndex = nimbleFriendsRefreshBasicInfo.getStartIndex(); - nimbleFriendsRangeRefreshResult.m_size = nimbleFriendsRefreshBasicInfo.getRange(); - nimbleFriendsRangeRefreshResult.m_friendListEndInRefresh = false; - if (friendsListType == NimbleFriendsList.FriendsListType.ALL_FRIENDS) { - nimbleFriendsRangeRefreshResult.m_totalFriendCount = this.m_totalFriends; - nimbleFriendsRefreshCallback.onCallback(this.m_nimbleFriendsList, nimbleFriendsRefreshBasicInfo, nimbleFriendsRangeRefreshResult); - return; - } - nimbleFriendsRangeRefreshResult.m_totalFriendCount = this.m_totalPlayedFriends; - nimbleFriendsRefreshCallback.onCallback(this.m_nimblePlayedFriendsList, nimbleFriendsRefreshBasicInfo, nimbleFriendsRangeRefreshResult); - } - } - - void invokeCallbackWithBasicScopeError(NimbleFriendsRefreshBasicInfo nimbleFriendsRefreshBasicInfo, NimbleFriendsRefreshCallback nimbleFriendsRefreshCallback, NimbleFriendsError.Code code, String str, NimbleFriendsList.FriendsListType friendsListType) { - if (nimbleFriendsRefreshCallback != null) { - NimbleFriendsError nimbleFriendsError = new NimbleFriendsError(code, str); - NimbleFriendsRangeRefreshResult nimbleFriendsRangeRefreshResult = new NimbleFriendsRangeRefreshResult(); - nimbleFriendsRangeRefreshResult.m_success = false; - nimbleFriendsRangeRefreshResult.m_error = nimbleFriendsError; - nimbleFriendsRangeRefreshResult.m_userList = null; - nimbleFriendsRangeRefreshResult.m_startIndex = nimbleFriendsRefreshBasicInfo.getStartIndex(); - nimbleFriendsRangeRefreshResult.m_size = nimbleFriendsRefreshBasicInfo.getRange(); - nimbleFriendsRangeRefreshResult.m_friendListEndInRefresh = false; - if (friendsListType == NimbleFriendsList.FriendsListType.ALL_FRIENDS) { - nimbleFriendsRangeRefreshResult.m_totalFriendCount = this.m_totalFriends; - nimbleFriendsRefreshCallback.onCallback(this.m_nimbleFriendsList, nimbleFriendsRefreshBasicInfo, nimbleFriendsRangeRefreshResult); - return; - } - nimbleFriendsRangeRefreshResult.m_totalFriendCount = this.m_totalPlayedFriends; - nimbleFriendsRefreshCallback.onCallback(this.m_nimblePlayedFriendsList, nimbleFriendsRefreshBasicInfo, nimbleFriendsRangeRefreshResult); - } - } - - void invokeCallbackWithScopeError(NimbleFriendsRefreshScope nimbleFriendsRefreshScope, NimbleFriendsRefreshCallback nimbleFriendsRefreshCallback, Error error, NimbleFriendsList.FriendsListType friendsListType) { - if (nimbleFriendsRefreshCallback != null) { - NimbleFriendsRefreshResult nimbleFriendsRefreshResult = new NimbleFriendsRefreshResult(); - nimbleFriendsRefreshResult.m_success = false; - nimbleFriendsRefreshResult.m_error = error; - nimbleFriendsRefreshResult.m_userList = null; - if (friendsListType == NimbleFriendsList.FriendsListType.ALL_FRIENDS) { - nimbleFriendsRefreshCallback.onCallback(this.m_nimbleFriendsList, nimbleFriendsRefreshScope, nimbleFriendsRefreshResult); - } else { - nimbleFriendsRefreshCallback.onCallback(this.m_nimblePlayedFriendsList, nimbleFriendsRefreshScope, nimbleFriendsRefreshResult); - } - } - } - - void invokeCallbackWithScopeError(NimbleFriendsRefreshScope nimbleFriendsRefreshScope, NimbleFriendsRefreshCallback nimbleFriendsRefreshCallback, NimbleFriendsError.Code code, String str, NimbleFriendsList.FriendsListType friendsListType) { - if (nimbleFriendsRefreshCallback != null) { - NimbleFriendsError nimbleFriendsError = new NimbleFriendsError(code, str); - NimbleFriendsRefreshResult nimbleFriendsRefreshResult = new NimbleFriendsRefreshResult(); - nimbleFriendsRefreshResult.m_success = false; - nimbleFriendsRefreshResult.m_error = nimbleFriendsError; - nimbleFriendsRefreshResult.m_userList = null; - if (friendsListType == NimbleFriendsList.FriendsListType.ALL_FRIENDS) { - nimbleFriendsRefreshCallback.onCallback(this.m_nimbleFriendsList, nimbleFriendsRefreshScope, nimbleFriendsRefreshResult); - } else { - nimbleFriendsRefreshCallback.onCallback(this.m_nimblePlayedFriendsList, nimbleFriendsRefreshScope, nimbleFriendsRefreshResult); - } - } - } - - protected boolean isNimbleComponentAvailable(String str) { - boolean z = false; - if (Base.getComponent(str) != null) { - z = true; - } - return z; - } - - @SuppressLint({"DefaultLocale"}) - public void refreshFriendsList(NimbleFriendsRefreshScope nimbleFriendsRefreshScope, NimbleFriendsRefreshCallback nimbleFriendsRefreshCallback, NimbleFriendsList.FriendsListType friendsListType) { - int i; - Object obj; - String str; - int i2; - String str2; - Log.Helper.LOGV(this, "refreshFriendsList API called", new Object[0]); - Error environmentCheck = environmentCheck(); - if (environmentCheck == null) { - if (friendsListType == NimbleFriendsList.FriendsListType.ALL_FRIENDS) { - Log.Helper.LOGV(this, "Refresh API called for All Friends List", new Object[0]); - i = 0; - obj = "ALL_FRIENDS"; - if (this.m_friendsList != null) { - i = 0; - obj = "ALL_FRIENDS"; - if (this.m_friendsList.size() > 0) { - i = this.m_friendsList.size() - 1; - obj = "ALL_FRIENDS"; - } - } - } else { - Log.Helper.LOGV(this, "Refresh API called for Played Current Game Friends List", new Object[0]); - i = 0; - obj = "CURRENT_GAME_FRIENDS"; - if (this.m_playedFriendsList != null) { - i = 0; - obj = "CURRENT_GAME_FRIENDS"; - if (this.m_playedFriendsList.size() > 0) { - i = this.m_playedFriendsList.size() - 1; - obj = "CURRENT_GAME_FRIENDS"; - } - } - } - if (nimbleFriendsRefreshScope == null) { - Log.Helper.LOGW(this, "NimbleFriendsRefreshScope is null. Unable to process the request", new Object[0]); - invokeCallbackWithScopeError(nimbleFriendsRefreshScope, nimbleFriendsRefreshCallback, NimbleFriendsError.Code.NIMBLE_FRIENDS_REFRESH_SCOPE_INVALID, "NimbleFriendsRefreshScope is null. Unable to process the request", friendsListType); - } else if (nimbleFriendsRefreshScope instanceof NimbleFriendsRefreshBasicInfo) { - NimbleFriendsRefreshBasicInfo nimbleFriendsRefreshBasicInfo = (NimbleFriendsRefreshBasicInfo) nimbleFriendsRefreshScope; - int startIndex = nimbleFriendsRefreshBasicInfo.getStartIndex(); - int range = nimbleFriendsRefreshBasicInfo.getRange(); - if (nimbleFriendsRefreshBasicInfo.getNextPage()) { - Log.Helper.LOGV(this, "Refresh API is called to get the next page of friends", new Object[0]); - int i3 = this.m_pageSize; - if (friendsListType != NimbleFriendsList.FriendsListType.ALL_FRIENDS || this.m_friendsList == null || this.m_friendsList.size() <= 0) { - i2 = 0; - str2 = ""; - if (friendsListType == NimbleFriendsList.FriendsListType.CURRENT_GAME_FRIENDS) { - i2 = 0; - str2 = ""; - if (this.m_playedFriendsList != null) { - i2 = 0; - str2 = ""; - if (this.m_playedFriendsList.size() > 0) { - str2 = this.m_playedFriendsList.get(i); - i2 = i; - } - } - } - } else { - str2 = this.m_friendsList.get(i); - i2 = i; - } - Log.Helper.LOGD(this, String.format("Refreshing next page for Type = %s, Start Index = %d, Range = %d, Last UID: %s", obj, Integer.valueOf(i2), Integer.valueOf(i3), str2), new Object[0]); - refreshFriendsListBasicInfo(i2, i3, str2, friendsListType, nimbleFriendsRefreshCallback, nimbleFriendsRefreshBasicInfo); - } else if (startIndex <= 0) { - Log.Helper.LOGD(this, String.format("Start Index is less than or equal to 0 - get friends from 0 to page size for Type = %s", obj), new Object[0]); - refreshFriendsListBasicInfo(0, this.m_pageSize, "", friendsListType, nimbleFriendsRefreshCallback, nimbleFriendsRefreshBasicInfo); - } else if (range > this.m_pageSize || range <= 0) { - String format = String.format("Range (%d) either exceeds Page Size (%d) or is less than 1. Unable to process this request.", Integer.valueOf(range), Integer.valueOf(this.m_pageSize)); - Log.Helper.LOGW(this, format, new Object[0]); - invokeCallbackWithBasicScopeError(nimbleFriendsRefreshBasicInfo, nimbleFriendsRefreshCallback, NimbleFriendsError.Code.NIMBLE_FRIENDS_REFRESH_SCOPE_RANGE_EXCEED_LIMIT, format, friendsListType); - } else if (startIndex - i >= 1) { - String format2 = String.format("Start Index (%d) higher than currentsize (%d). Unable to process this request.", Integer.valueOf(startIndex), Integer.valueOf(i)); - Log.Helper.LOGW(this, format2, new Object[0]); - invokeCallbackWithBasicScopeError(nimbleFriendsRefreshBasicInfo, nimbleFriendsRefreshCallback, NimbleFriendsError.Code.NIMBLE_FRIENDS_REFRESH_SCOPE_INVALID_START_INDEX, format2, friendsListType); - } else if (startIndex + range > i + 1) { - String format3 = String.format("Range (%d) exceeds Available Size (%d). Unable to process this request.", Integer.valueOf(range), Integer.valueOf(i)); - Log.Helper.LOGW(this, format3, new Object[0]); - invokeCallbackWithBasicScopeError(nimbleFriendsRefreshBasicInfo, nimbleFriendsRefreshCallback, NimbleFriendsError.Code.NIMBLE_FRIENDS_REFRESH_SCOPE_RANGE_EXCEED_LIMIT, format3, friendsListType); - } else if (startIndex > 0) { - if (friendsListType != NimbleFriendsList.FriendsListType.ALL_FRIENDS || this.m_friendsList == null || this.m_friendsList.size() <= 0 || startIndex >= this.m_friendsList.size()) { - str = ""; - if (friendsListType == NimbleFriendsList.FriendsListType.CURRENT_GAME_FRIENDS) { - str = ""; - if (this.m_playedFriendsList != null) { - str = ""; - if (this.m_playedFriendsList.size() > 0) { - str = ""; - if (startIndex < this.m_playedFriendsList.size()) { - str = this.m_playedFriendsList.get(startIndex - 1); - } - } - } - } - } else { - str = this.m_friendsList.get(startIndex - 1); - } - if (str.length() > 0) { - Log.Helper.LOGD(this, String.format("Refreshing friends by range for Type = %s, Start Index = %d, Range = %d, Last UID = %s", obj, Integer.valueOf(startIndex), Integer.valueOf(range), str), new Object[0]); - refreshFriendsListBasicInfo(startIndex, range, str, friendsListType, nimbleFriendsRefreshCallback, nimbleFriendsRefreshBasicInfo); - return; - } - String format4 = String.format("Unable to process refresh request because we are unable to retrieve the last UID before start index %d.", Integer.valueOf(startIndex)); - Log.Helper.LOGW(this, format4, new Object[0]); - invokeCallbackWithBasicScopeError(nimbleFriendsRefreshBasicInfo, nimbleFriendsRefreshCallback, NimbleFriendsError.Code.NIMBLE_FRIENDS_REFRESH_SCOPE_INVALID, format4, friendsListType); - } else { - Log.Helper.LOGD(this, String.format("Refreshing friends by range for Type = %s, Range = %d with starting index at 0 and no last UID", obj, Integer.valueOf(range)), new Object[0]); - refreshFriendsListBasicInfo(0, range, "", friendsListType, nimbleFriendsRefreshCallback, nimbleFriendsRefreshBasicInfo); - } - } else if (nimbleFriendsRefreshScope instanceof NimbleFriendsRefreshIdentityInfo) { - ArrayList targetedFriendIds = ((NimbleFriendsRefreshIdentityInfo) nimbleFriendsRefreshScope).getTargetedFriendIds(); - if (targetedFriendIds == null || targetedFriendIds.size() <= 0) { - Log.Helper.LOGW(this, "No user IDs provided for NimbleFriendsRefreshIdentityInfo scope. Unable to process request", new Object[0]); - invokeCallbackWithScopeError(nimbleFriendsRefreshScope, nimbleFriendsRefreshCallback, NimbleFriendsError.Code.NIMBLE_FRIENDS_REFRESH_NO_USER_IDS_LIST, "No user IDs provided for NimbleFriendsRefreshIdentityInfo scope. Unable to process request", friendsListType); - } else if (targetedFriendIds.size() > 20 || targetedFriendIds.size() > i + 1) { - Log.Helper.LOGW(this, "Number of user IDs provided for NimbleFriendsRefreshIdentityInfo exceeds allowed limits. Unable to process request", new Object[0]); - invokeCallbackWithScopeError(nimbleFriendsRefreshScope, nimbleFriendsRefreshCallback, NimbleFriendsError.Code.NIMBLE_FRIENDS_REFRESH_SCOPE_RANGE_EXCEED_LIMIT, "Number of user IDs provided for NimbleFriendsRefreshIdentityInfo exceeds allowed limits. Unable to process request", friendsListType); - } else { - Log.Helper.LOGD(this, "Refreshing identity info of %d friends of type %s", Integer.valueOf(targetedFriendIds.size()), obj); - refreshFriendsListIdentityInfo(targetedFriendIds, friendsListType, nimbleFriendsRefreshScope, nimbleFriendsRefreshCallback); - } - } else if (nimbleFriendsRefreshScope instanceof NimbleFriendsRefreshImageUrl) { - ArrayList targetedFriendIds2 = ((NimbleFriendsRefreshImageUrl) nimbleFriendsRefreshScope).getTargetedFriendIds(); - if (targetedFriendIds2 == null || targetedFriendIds2.size() <= 0) { - Log.Helper.LOGW(this, "No user IDs provided for NimbleFriendsRefreshImageUrl scope. Unable to process request", new Object[0]); - invokeCallbackWithScopeError(nimbleFriendsRefreshScope, nimbleFriendsRefreshCallback, NimbleFriendsError.Code.NIMBLE_FRIENDS_REFRESH_NO_USER_IDS_LIST, "No user IDs provided for NimbleFriendsRefreshImageUrl scope. Unable to process request", friendsListType); - } else if (targetedFriendIds2.size() > i + 1 || targetedFriendIds2.size() > 20) { - Log.Helper.LOGW(this, "Number of user IDs provided for NimbleFriendsRefreshImageUrl is more than the page size. Unable to process request", new Object[0]); - invokeCallbackWithScopeError(nimbleFriendsRefreshScope, nimbleFriendsRefreshCallback, NimbleFriendsError.Code.NIMBLE_FRIENDS_REFRESH_SCOPE_RANGE_EXCEED_LIMIT, "Number of user IDs provided for NimbleFriendsRefreshImageUrl is more than the page size. Unable to process request", friendsListType); - } else { - Log.Helper.LOGD(this, "Refreshing image url of %d friends of type %s", Integer.valueOf(targetedFriendIds2.size()), obj); - refreshFriendsListImageUrl(targetedFriendIds2, friendsListType, nimbleFriendsRefreshCallback, nimbleFriendsRefreshScope); - } - } - } else if (nimbleFriendsRefreshCallback != null) { - NimbleFriendsRefreshResult nimbleFriendsRefreshResult = new NimbleFriendsRefreshResult(); - nimbleFriendsRefreshResult.m_error = environmentCheck; - nimbleFriendsRefreshResult.m_success = false; - nimbleFriendsRefreshResult.m_userList = null; - nimbleFriendsRefreshCallback.onCallback(null, nimbleFriendsRefreshScope, nimbleFriendsRefreshResult); - } - } - - protected abstract void refreshFriendsListBasicInfo(int i, int i2, String str, NimbleFriendsList.FriendsListType friendsListType, NimbleFriendsRefreshCallback nimbleFriendsRefreshCallback, NimbleFriendsRefreshBasicInfo nimbleFriendsRefreshBasicInfo); - - protected void refreshFriendsListIdentityInfo(ArrayList arrayList, final NimbleFriendsList.FriendsListType friendsListType, final NimbleFriendsRefreshScope nimbleFriendsRefreshScope, final NimbleFriendsRefreshCallback nimbleFriendsRefreshCallback) { - Log.Helper.LOGD(this, "Preparing to make the call to C&I to get the pid info", new Object[0]); - if (!isNimbleComponentAvailable("com.ea.nimble.identity")) { - Log.Helper.LOGE(this, "Unable to refresh friends Identity information because NimbleIdentity is not available", new Object[0]); - invokeCallbackWithScopeError(nimbleFriendsRefreshScope, nimbleFriendsRefreshCallback, NimbleFriendsError.Code.NIMBLE_FRIENDS_IDENTITY_NOT_AVAILABLE, "Unable to refresh friends Identity information because NimbleIdentity is not available", friendsListType); - return; - } - try { - INimbleIdentity iNimbleIdentity = (INimbleIdentity) Base.getComponent("com.ea.nimble.identity"); - if (iNimbleIdentity.getAuthenticatorById(this.m_authenticatorId).getState() != INimbleIdentityAuthenticator.NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_SUCCESS) { - String format = String.format("Authenticator (%s) is not logged in or is unavailable", this.m_authenticatorId); - Log.Helper.LOGE(this, format, new Object[0]); - invokeCallbackWithScopeError(nimbleFriendsRefreshScope, nimbleFriendsRefreshCallback, NimbleFriendsError.Code.NIMBLE_FRIENDS_REFRESH_AUTHENTICATOR_NOT_LOGGED_IN, format, friendsListType); - return; - } - iNimbleIdentity.getAuthenticatorById(this.m_authenticatorId).requestIdentityForFriends(arrayList, new INimbleIdentityAuthenticator.NimbleIdentityFriendsIdentityInfoCallback() { // from class: com.ea.nimble.friends.NimbleFriendsListImpl.1 - @Override // com.ea.nimble.identity.INimbleIdentityAuthenticator.NimbleIdentityFriendsIdentityInfoCallback - public void onCallback(INimbleIdentityAuthenticator iNimbleIdentityAuthenticator, JSONObject jSONObject, Error error) { - if (error != null) { - Log.Helper.LOGE(this, "Server error when retrieving Pid Info. Error: " + error.toString(), new Object[0]); - NimbleFriendsListImpl.this.invokeCallbackWithScopeError(nimbleFriendsRefreshScope, nimbleFriendsRefreshCallback, NimbleFriendsError.Code.NIMBLE_FRIENDS_REFRESH_IDENTITY_SERVER_ERROR, error.toString(), friendsListType); - return; - } - Log.Helper.LOGD(this, "No errors when retrieving Pid Info response from C&I server", new Object[0]); - ArrayList parseJSONObjectToArrayOfUserInfo = NimbleFriendsUtility.parseJSONObjectToArrayOfUserInfo(jSONObject); - if (parseJSONObjectToArrayOfUserInfo == null || parseJSONObjectToArrayOfUserInfo.size() == 0) { - Log.Helper.LOGW(this, "Response for Pid Info request is empty. No Pids were updated for this request. It is probably because the selected friends do not have any Pids associated with them", new Object[0]); - NimbleFriendsListImpl.this.invokeCallbackWithScopeError(nimbleFriendsRefreshScope, nimbleFriendsRefreshCallback, NimbleFriendsError.Code.NIMBLE_FRIENDS_REFRESH_IDENTITY_SERVER_EMPTY_RESPONSE, "Response for Pid Info request is empty. No Pids were updated for this request. It is probably because the selected friends do not have any Pids associated with them", friendsListType); - return; - } - Log.Helper.LOGD(this, "Successfully retrieved non-empty updated pid info from Identity server.", new Object[0]); - NimbleFriendsListImpl.this.updateFriendsListIdentityInfo(parseJSONObjectToArrayOfUserInfo, friendsListType, nimbleFriendsRefreshCallback, nimbleFriendsRefreshScope); - } - }); - } catch (Exception e) { - String format2 = String.format("Authenticator (%s) does not support Identity Refresh for Friends List", this.m_authenticatorId); - Log.Helper.LOGE(this, format2, new Object[0]); - invokeCallbackWithScopeError(nimbleFriendsRefreshScope, nimbleFriendsRefreshCallback, NimbleFriendsError.Code.NIMBLE_FRIENDS_REFRESH_AUTHENTICATOR_NOT_SUPPORTED, format2, friendsListType); - } - } - - protected abstract void refreshFriendsListImageUrl(List list, NimbleFriendsList.FriendsListType friendsListType, NimbleFriendsRefreshCallback nimbleFriendsRefreshCallback, NimbleFriendsRefreshScope nimbleFriendsRefreshScope); - - protected void sendUpdateNotification() { - HashMap hashMap = new HashMap(); - if (Base.getComponent("com.ea.nimble.identity") != null) { - hashMap.put(Global.NIMBLE_IDENTITY_DICTIONARY_KEY_AUTHENTICATOR_ID, this.m_authenticatorId); - } else { - hashMap.put(Global.NIMBLE_IDENTITY_DICTIONARY_KEY_AUTHENTICATOR_ID, this.m_authenticatorId); - } - Utility.sendBroadcast(INimbleFriends.NIMBLE_NOTIFICATION_FRIENDS_LIST_UPDATE, hashMap); - } - - protected void d(ArrayList arrayList, NimbleFriendsList.FriendsListType friendsListType, NimbleFriendsRefreshCallback nimbleFriendsRefreshCallback, NimbleFriendsRefreshScope nimbleFriendsRefreshScope) { - boolean z; - synchronized (this) { - ArrayList arrayList2 = new ArrayList<>(); - if (this.m_friends == null || this.m_friends.size() <= 0) { - Log.Helper.LOGE(this, "Current Friends list is empty. Unable to process the PID update", new Object[0]); - invokeCallbackWithScopeError(nimbleFriendsRefreshScope, nimbleFriendsRefreshCallback, NimbleFriendsError.Code.NIMBLE_FRIENDS_REFRESH_FRIENDS_LIST_EMPTY, "Current Friends list is empty. Unable to process the PID update", friendsListType); - } else if (arrayList == null || arrayList.size() <= 0) { - Log.Helper.LOGE(this, "Updated users array for Avatar info is empty", new Object[0]); - invokeCallbackWithScopeError(nimbleFriendsRefreshScope, nimbleFriendsRefreshCallback, NimbleFriendsError.Code.NIMBLE_FRIENDS_REFRESH_IDENTITY_SERVER_EMPTY_RESPONSE, "Updated users array for Avatar info is empty", friendsListType); - } else { - for (int i = 0; i < arrayList.size(); i++) { - NimbleUser nimbleUser = this.m_friends.get(arrayList.get(i).getUserId()); - String imageUrl = arrayList.get(i).getImageUrl(); - if (nimbleUser != null) { - String imageUrl2 = nimbleUser.getImageUrl(); - if (!Utility.validString(imageUrl2) && Utility.validString(imageUrl)) { - z = true; - } else if (!Utility.validString(imageUrl2) || Utility.validString(imageUrl)) { - z = false; - if (Utility.validString(imageUrl2)) { - z = false; - if (Utility.validString(imageUrl)) { - z = false; - if (!imageUrl2.equalsIgnoreCase(imageUrl)) { - z = true; - } - } - } - } else { - z = true; - } - if (z) { - NimbleUser nimbleUser2 = new NimbleUser(nimbleUser); - nimbleUser2.setImageUrl(imageUrl); - this.m_friends.put(nimbleUser2.getUserId(), nimbleUser2); - arrayList2.add(nimbleUser2); - } - } - } - if (arrayList2.size() == 0) { - Log.Helper.LOGD(this, "No Avatar Info updates were made to the Friends List", new Object[0]); - invokeCallbackWithScopeError(nimbleFriendsRefreshScope, nimbleFriendsRefreshCallback, NimbleFriendsError.Code.NIMBLE_FRIENDS_REFRESH_FRIENDS_LIST_NOT_UPDATED, "No Avatar Info updates were made to the Friends List", friendsListType); - } else { - Log.Helper.LOGD(this, String.format("%d Friends were updated for Avatar Info", Integer.valueOf(arrayList2.size())), new Object[0]); - sendUpdateNotification(); - if (nimbleFriendsRefreshCallback != null) { - Log.Helper.LOGD(this, "Friends list was updated. Invoking the callback", new Object[0]); - NimbleFriendsRefreshResult nimbleFriendsRefreshResult = new NimbleFriendsRefreshResult(); - nimbleFriendsRefreshResult.m_success = true; - nimbleFriendsRefreshResult.m_error = null; - nimbleFriendsRefreshResult.m_userList = arrayList2; - if (friendsListType == NimbleFriendsList.FriendsListType.ALL_FRIENDS) { - nimbleFriendsRefreshCallback.onCallback(this.m_nimbleFriendsList, nimbleFriendsRefreshScope, nimbleFriendsRefreshResult); - } else { - nimbleFriendsRefreshCallback.onCallback(this.m_nimblePlayedFriendsList, nimbleFriendsRefreshScope, nimbleFriendsRefreshResult); - } - } - } - } - } - } - - protected void updateFriendsListBasicInfo(ArrayList arrayList, NimbleFriendsList.FriendsListType friendsListType, NimbleFriendsRefreshCallback nimbleFriendsRefreshCallback, NimbleFriendsRefreshBasicInfo nimbleFriendsRefreshBasicInfo) { - synchronized (this) { - ArrayList arrayList2 = new ArrayList<>(); - if (arrayList == null || arrayList.size() <= 0) { - Log.Helper.LOGD(this, "Even though the retrieval of Friends list was successful, the retrieved Friend list is empty", new Object[0]); - if (nimbleFriendsRefreshCallback != null) { - NimbleFriendsRangeRefreshResult nimbleFriendsRangeRefreshResult = new NimbleFriendsRangeRefreshResult(); - nimbleFriendsRangeRefreshResult.m_success = true; - nimbleFriendsRangeRefreshResult.m_error = null; - nimbleFriendsRangeRefreshResult.m_userList = null; - nimbleFriendsRangeRefreshResult.m_startIndex = nimbleFriendsRefreshBasicInfo.getStartIndex(); - nimbleFriendsRangeRefreshResult.m_size = nimbleFriendsRefreshBasicInfo.getRange(); - nimbleFriendsRangeRefreshResult.m_friendListEndInRefresh = false; - if (friendsListType == NimbleFriendsList.FriendsListType.ALL_FRIENDS) { - nimbleFriendsRangeRefreshResult.m_totalFriendCount = this.m_totalFriends; - nimbleFriendsRefreshCallback.onCallback(this.m_nimbleFriendsList, nimbleFriendsRefreshBasicInfo, nimbleFriendsRangeRefreshResult); - } else { - nimbleFriendsRangeRefreshResult.m_totalFriendCount = this.m_totalPlayedFriends; - nimbleFriendsRefreshCallback.onCallback(this.m_nimblePlayedFriendsList, nimbleFriendsRefreshBasicInfo, nimbleFriendsRangeRefreshResult); - } - } - } else { - Log.Helper.LOGV(this, "Retrieved " + arrayList.size() + "friends.", new Object[0]); - for (int i = 0; i < arrayList.size(); i++) { - if (arrayList.get(i) != null) { - updateInternalCache(arrayList.get(i), friendsListType, arrayList2); - } - } - if (friendsListType == NimbleFriendsList.FriendsListType.CURRENT_GAME_FRIENDS) { - this.m_totalPlayedFriends = this.m_playedFriendsList.size(); - } else { - this.m_totalFriends = this.m_friendsList.size(); - } - if (nimbleFriendsRefreshCallback != null) { - Log.Helper.LOGD(this, "Friends list was updated. Invoking the callback", new Object[0]); - NimbleFriendsRangeRefreshResult nimbleFriendsRangeRefreshResult2 = new NimbleFriendsRangeRefreshResult(); - nimbleFriendsRangeRefreshResult2.m_success = true; - nimbleFriendsRangeRefreshResult2.m_error = null; - nimbleFriendsRangeRefreshResult2.m_userList = arrayList2; - nimbleFriendsRangeRefreshResult2.m_startIndex = nimbleFriendsRefreshBasicInfo.getStartIndex(); - nimbleFriendsRangeRefreshResult2.m_size = nimbleFriendsRefreshBasicInfo.getRange(); - if (arrayList2.size() > 0) { - nimbleFriendsRangeRefreshResult2.m_friendListEndInRefresh = true; - } else { - nimbleFriendsRangeRefreshResult2.m_friendListEndInRefresh = false; - } - if (friendsListType == NimbleFriendsList.FriendsListType.ALL_FRIENDS) { - nimbleFriendsRangeRefreshResult2.m_totalFriendCount = this.m_totalFriends; - nimbleFriendsRefreshCallback.onCallback(this.m_nimbleFriendsList, nimbleFriendsRefreshBasicInfo, nimbleFriendsRangeRefreshResult2); - } else { - nimbleFriendsRangeRefreshResult2.m_totalFriendCount = this.m_totalPlayedFriends; - nimbleFriendsRefreshCallback.onCallback(this.m_nimblePlayedFriendsList, nimbleFriendsRefreshBasicInfo, nimbleFriendsRangeRefreshResult2); - } - } - Log.Helper.LOGD(this, "Friends list was upodated, send the update notification", new Object[0]); - sendUpdateNotification(); - } - } - } - - protected void updateFriendsListBasicInfo(JSONArray jSONArray, NimbleFriendsList.FriendsListType friendsListType, NimbleFriendsRefreshCallback nimbleFriendsRefreshCallback, NimbleFriendsRefreshBasicInfo nimbleFriendsRefreshBasicInfo) { - synchronized (this) { - ArrayList arrayList = new ArrayList<>(); - if (jSONArray == null || jSONArray.length() <= 0) { - Log.Helper.LOGD(this, "Even though the retrieval of Friends list was successful, the retrieved Friend list is empty", new Object[0]); - if (nimbleFriendsRefreshCallback != null) { - NimbleFriendsRangeRefreshResult nimbleFriendsRangeRefreshResult = new NimbleFriendsRangeRefreshResult(); - nimbleFriendsRangeRefreshResult.m_success = true; - nimbleFriendsRangeRefreshResult.m_error = null; - nimbleFriendsRangeRefreshResult.m_userList = null; - nimbleFriendsRangeRefreshResult.m_startIndex = nimbleFriendsRefreshBasicInfo.getStartIndex(); - nimbleFriendsRangeRefreshResult.m_size = nimbleFriendsRefreshBasicInfo.getRange(); - nimbleFriendsRangeRefreshResult.m_friendListEndInRefresh = false; - if (friendsListType == NimbleFriendsList.FriendsListType.ALL_FRIENDS) { - nimbleFriendsRangeRefreshResult.m_totalFriendCount = this.m_totalFriends; - nimbleFriendsRefreshCallback.onCallback(this.m_nimbleFriendsList, nimbleFriendsRefreshBasicInfo, nimbleFriendsRangeRefreshResult); - } else { - nimbleFriendsRangeRefreshResult.m_totalFriendCount = this.m_totalPlayedFriends; - nimbleFriendsRefreshCallback.onCallback(this.m_nimblePlayedFriendsList, nimbleFriendsRefreshBasicInfo, nimbleFriendsRangeRefreshResult); - } - } - } else { - Log.Helper.LOGV(this, "Retrieved " + jSONArray.length() + "friends.", new Object[0]); - for (int i = 0; i < jSONArray.length(); i++) { - if (jSONArray.optJSONObject(i) != null) { - updateInternalCache(createNimbleUser(jSONArray.optJSONObject(i)), friendsListType, arrayList); - } - } - if (friendsListType == NimbleFriendsList.FriendsListType.CURRENT_GAME_FRIENDS) { - this.m_totalPlayedFriends = this.m_playedFriendsList.size(); - } else { - this.m_totalFriends = this.m_friendsList.size(); - } - if (nimbleFriendsRefreshCallback != null) { - Log.Helper.LOGD(this, "Friends list was updated. Invoking the callback", new Object[0]); - NimbleFriendsRangeRefreshResult nimbleFriendsRangeRefreshResult2 = new NimbleFriendsRangeRefreshResult(); - nimbleFriendsRangeRefreshResult2.m_success = true; - nimbleFriendsRangeRefreshResult2.m_error = null; - nimbleFriendsRangeRefreshResult2.m_userList = arrayList; - nimbleFriendsRangeRefreshResult2.m_startIndex = nimbleFriendsRefreshBasicInfo.getStartIndex(); - nimbleFriendsRangeRefreshResult2.m_size = nimbleFriendsRefreshBasicInfo.getRange(); - if (arrayList.size() > 0) { - nimbleFriendsRangeRefreshResult2.m_friendListEndInRefresh = true; - } else { - nimbleFriendsRangeRefreshResult2.m_friendListEndInRefresh = false; - } - if (friendsListType == NimbleFriendsList.FriendsListType.ALL_FRIENDS) { - nimbleFriendsRangeRefreshResult2.m_totalFriendCount = this.m_totalFriends; - nimbleFriendsRefreshCallback.onCallback(this.m_nimbleFriendsList, nimbleFriendsRefreshBasicInfo, nimbleFriendsRangeRefreshResult2); - } else { - nimbleFriendsRangeRefreshResult2.m_totalFriendCount = this.m_totalPlayedFriends; - nimbleFriendsRefreshCallback.onCallback(this.m_nimblePlayedFriendsList, nimbleFriendsRefreshBasicInfo, nimbleFriendsRangeRefreshResult2); - } - } - Log.Helper.LOGD(this, "Friends list was upodated, send the update notification", new Object[0]); - sendUpdateNotification(); - } - } - } - - protected void updateFriendsListIdentityInfo(ArrayList arrayList, NimbleFriendsList.FriendsListType friendsListType, NimbleFriendsRefreshCallback nimbleFriendsRefreshCallback, NimbleFriendsRefreshScope nimbleFriendsRefreshScope) { - synchronized (this) { - ArrayList arrayList2 = new ArrayList<>(); - if (this.m_friends == null || this.m_friends.size() <= 0) { - Log.Helper.LOGE(this, "Current Friends list is empty. Unable to process the PID update", new Object[0]); - invokeCallbackWithScopeError(nimbleFriendsRefreshScope, nimbleFriendsRefreshCallback, NimbleFriendsError.Code.NIMBLE_FRIENDS_REFRESH_FRIENDS_LIST_EMPTY, "Current Friends list is empty. Unable to process the PID update", friendsListType); - } else if (arrayList == null || arrayList.size() <= 0) { - Log.Helper.LOGE(this, "Updated friends array is empty", new Object[0]); - invokeCallbackWithScopeError(nimbleFriendsRefreshScope, nimbleFriendsRefreshCallback, NimbleFriendsError.Code.NIMBLE_FRIENDS_REFRESH_IDENTITY_SERVER_EMPTY_RESPONSE, "Updated friends array is empty", friendsListType); - } else { - for (int i = 0; i < arrayList.size(); i++) { - NimbleUser nimbleUser = this.m_friends.get(arrayList.get(i).getExternalRefValue()); - if (nimbleUser != null && nimbleUser.getPid() == null) { - NimbleUser nimbleUser2 = new NimbleUser(nimbleUser); - nimbleUser2.setPid(arrayList.get(i).getPidId()); - nimbleUser2.setPersonaId(arrayList.get(i).getPersonaId()); - this.m_friends.put(arrayList.get(i).getExternalRefValue(), nimbleUser2); - arrayList2.add(nimbleUser2); - } - } - if (arrayList2.size() == 0) { - Log.Helper.LOGD(this, "No Pid Info updates were made to the Friends List", new Object[0]); - invokeCallbackWithScopeError(nimbleFriendsRefreshScope, nimbleFriendsRefreshCallback, NimbleFriendsError.Code.NIMBLE_FRIENDS_REFRESH_FRIENDS_LIST_NOT_UPDATED, "No Pid Info updates were made to the Friends List", friendsListType); - } else { - Log.Helper.LOGD(this, String.format("%d Friends were updated for Identity Scope", Integer.valueOf(arrayList2.size())), new Object[0]); - sendUpdateNotification(); - if (nimbleFriendsRefreshCallback != null) { - Log.Helper.LOGD(this, "Friends list was updated. Invoking the callback", new Object[0]); - NimbleFriendsRefreshResult nimbleFriendsRefreshResult = new NimbleFriendsRefreshResult(); - nimbleFriendsRefreshResult.m_success = true; - nimbleFriendsRefreshResult.m_error = null; - nimbleFriendsRefreshResult.m_userList = arrayList2; - if (friendsListType == NimbleFriendsList.FriendsListType.ALL_FRIENDS) { - nimbleFriendsRefreshCallback.onCallback(this.m_nimbleFriendsList, nimbleFriendsRefreshScope, nimbleFriendsRefreshResult); - } else { - nimbleFriendsRefreshCallback.onCallback(this.m_nimblePlayedFriendsList, nimbleFriendsRefreshScope, nimbleFriendsRefreshResult); - } - } - } - } - } - } - - protected void updateInternalCache(NimbleUser nimbleUser, NimbleFriendsList.FriendsListType friendsListType, ArrayList arrayList) { - if (this.m_friends == null || nimbleUser == null || nimbleUser.getUserId() == null) { - Log.Helper.LOGI(this, "updateInternalCache - Cannot update internal cache because the friend map or the new friend is null", new Object[0]); - return; - } - boolean z = true; - if (friendsListType == NimbleFriendsList.FriendsListType.CURRENT_GAME_FRIENDS) { - z = false; - } - if (this.m_friends.get(nimbleUser.getUserId()) == null) { - if (z) { - nimbleUser.addedToAllFriends = true; - this.m_friendsList.add(nimbleUser.getUserId()); - if (nimbleUser.getPlayedCurrentGame() == NimbleUser.PlayedCurrentGameFlag.PLAYED) { - this.m_playedFriendsList.add(nimbleUser.getUserId()); - } - } else { - nimbleUser.addedToAllFriends = false; - this.m_playedFriendsList.add(nimbleUser.getUserId()); - } - this.m_friends.put(nimbleUser.getUserId(), nimbleUser); - arrayList.add(nimbleUser); - return; - } - NimbleUser nimbleUser2 = this.m_friends.get(nimbleUser.getUserId()); - if (z && !nimbleUser2.addedToAllFriends) { - nimbleUser.addedToAllFriends = true; - this.m_friends.put(nimbleUser.getUserId(), nimbleUser); - this.m_friendsList.add(nimbleUser.getUserId()); - } - if (nimbleUser2.isUserUpdated(nimbleUser)) { - nimbleUser.setPersonaId(nimbleUser2.getPersonaId()); - nimbleUser.setPid(nimbleUser2.getPid()); - nimbleUser.addedToAllFriends = nimbleUser2.addedToAllFriends; - nimbleUser.setRefreshTimestamp(new Date()); - this.m_friends.put(nimbleUser.getUserId(), nimbleUser); - arrayList.add(nimbleUser); - } - } -} diff --git a/app/src/main/java/com/ea/nimble/friends/NimbleFriendsListOrigin.java b/app/src/main/java/com/ea/nimble/friends/NimbleFriendsListOrigin.java deleted file mode 100644 index 43dd5d0..0000000 --- a/app/src/main/java/com/ea/nimble/friends/NimbleFriendsListOrigin.java +++ /dev/null @@ -1,418 +0,0 @@ -package com.ea.nimble.friends; - -import com.ea.nimble.Base; -import com.ea.nimble.Error; -import com.ea.nimble.Global; -import com.ea.nimble.HttpRequest; -import com.ea.nimble.IHttpRequest; -import com.ea.nimble.Log; -import com.ea.nimble.Network; -import com.ea.nimble.NetworkConnectionCallback; -import com.ea.nimble.NetworkConnectionHandle; -import com.ea.nimble.SynergyEnvironment; -import com.ea.nimble.Utility; -import com.ea.nimble.identity.INimbleIdentity; -import com.ea.nimble.identity.INimbleIdentityAuthenticator; -import com.ea.nimble.identity.NimbleIdentityPidInfo; - -import org.json.JSONArray; -import org.json.JSONException; -import org.json.JSONObject; -import org.xmlpull.v1.XmlPullParser; -import org.xmlpull.v1.XmlPullParserFactory; - -import java.io.InputStream; -import java.net.MalformedURLException; -import java.net.URL; -import java.util.ArrayList; -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Scanner; - -/* loaded from: stdlib.jar:com/ea/nimble/friends/.class */ -public class NimbleFriendsListOrigin extends NimbleFriendsListImpl { - private NimbleFriendsError lastError = null; - private static String GET_FRIENDS_URI_PARAMS = "/friends/2/users/%s/friends?start=%d&size=%d&names=%s"; - private static String GET_FRIENDS_AVATAR_URI = "/avatar/user/%s/avatars"; - - /* JADX INFO: Access modifiers changed from: package-private */ - public NimbleFriendsListOrigin() { - this.LOG_SOURCE_TITLE = ""; - this.m_authenticatorId = Global.NIMBLE_AUTHENTICATOR_ORIGIN; - Log.Helper.LOGV(this, "Constructed"); - this.m_pageSize = 20; - this.m_nimbleFriendsList = new NimbleFriendsList(this, NimbleFriendsList.FriendsListType.ALL_FRIENDS); - this.m_nimblePlayedFriendsList = new NimbleFriendsList(this, NimbleFriendsList.FriendsListType.CURRENT_GAME_FRIENDS); - } - - private String getMdmAppKey() { - return SynergyEnvironment.getComponent().getGosMdmAppKey(); - } - - private String getOriginAvatarsUrlFromSynergy() { - String serverUrlWithKey = SynergyEnvironment.getComponent().getServerUrlWithKey(SynergyEnvironment.SERVER_URL_KEY_ORIGIN_AVATAR); - if (serverUrlWithKey == null || serverUrlWithKey.length() <= 0) { - return null; - } - String str = serverUrlWithKey; - if (serverUrlWithKey.charAt(serverUrlWithKey.length() - 1) == '/') { - str = serverUrlWithKey.substring(0, serverUrlWithKey.length() - 1); - } - return str; - } - - private String getOriginFriendsUrlFromSynergy() { - String serverUrlWithKey = SynergyEnvironment.getComponent().getServerUrlWithKey(SynergyEnvironment.SERVER_URL_KEY_EADP_FRIENDS_HOST); - if (serverUrlWithKey == null || serverUrlWithKey.length() <= 0) { - return null; - } - String str = serverUrlWithKey; - if (serverUrlWithKey.charAt(serverUrlWithKey.length() - 1) == '/') { - str = serverUrlWithKey.substring(0, serverUrlWithKey.length() - 1); - } - return str; - } - - private HttpRequest makeGetFriendsAvatarInfoRequest(String str, String str2, List list) { - MalformedURLException e; - String originAvatarsUrlFromSynergy = getOriginAvatarsUrlFromSynergy(); - if (str == null || str.length() <= 0 || list == null || list.size() <= 0 || list.size() > 20 || originAvatarsUrlFromSynergy == null || originAvatarsUrlFromSynergy.length() <= 0) { - return null; - } - HttpRequest httpRequest = null; - StringBuilder sb = new StringBuilder(); - for (String str3 : list) { - sb.append(str3); - sb.append(";"); - } - sb.deleteCharAt(sb.length() - 1); - try { - HttpRequest httpRequest2 = new HttpRequest(new URL(originAvatarsUrlFromSynergy + String.format(GET_FRIENDS_AVATAR_URI, sb.toString()))); - httpRequest2.method = IHttpRequest.Method.GET; - HashMap hashMap = new HashMap<>(); - hashMap.put("AuthToken", str); - httpRequest2.headers = hashMap; - return httpRequest2; - } catch (MalformedURLException e3) { - e = e3; - } - return new HttpRequest(); - } - - private HttpRequest makeGetFriendsRequest(int i, int i2, boolean z, String str, String str2, String str3) { - MalformedURLException e; - String originFriendsUrlFromSynergy = getOriginFriendsUrlFromSynergy(); - String mdmAppKey = getMdmAppKey(); - if (str == null || str.length() <= 0) { - Log.Helper.LOGE(this, "Failed to create GOS friends request because access token for Origin is null or invalid"); - return null; - } else if (originFriendsUrlFromSynergy == null || originFriendsUrlFromSynergy.length() <= 0) { - Log.Helper.LOGE(this, "Failed to create GOS friends request because GOS request URL is null or invalid"); - return null; - } else if (mdmAppKey == null || mdmAppKey.length() <= 0) { - Log.Helper.LOGE(this, "Failed to create GOS friends request because MDM App Key is null or invalid"); - return null; - } else if (str3 == null || str3.length() <= 0) { - Log.Helper.LOGE(this, "Failed to create GOS friends request because Origin user's PID is null or invalid"); - return null; - } else { - String str4 = str2 + " " + str; - HttpRequest httpRequest = null; - try { - HttpRequest httpRequest2 = new HttpRequest(new URL(originFriendsUrlFromSynergy + (z ? String.format(GET_FRIENDS_URI_PARAMS, str3, Integer.valueOf(i), Integer.valueOf(i2), "true") : String.format(GET_FRIENDS_URI_PARAMS, str3, Integer.valueOf(i), Integer.valueOf(i2), "false")))); - httpRequest2.method = IHttpRequest.Method.GET; - HashMap hashMap = new HashMap<>(); - hashMap.put("Authorization", str4); - hashMap.put("X-Application-Key", mdmAppKey); - hashMap.put("X-Api-Version", "2"); - httpRequest2.headers = hashMap; - return httpRequest2; - } catch (MalformedURLException e3) { - e = e3; - } - } - return new HttpRequest(); - } - - /* JADX INFO: Access modifiers changed from: private */ - public ArrayList parseAvatarInfoXml(NetworkConnectionHandle networkConnectionHandle) throws Error { - Exception e; - this.lastError = null; - int statusCode = networkConnectionHandle.getResponse().getStatusCode(); - if (statusCode != 200) { - switch (statusCode) { - case Log.LEVEL_WARN /* 400 */: - this.lastError = new NimbleFriendsError(NimbleFriendsError.Code.NIMBLE_FRIENDS_REFRESH_SCOPE_SERVER_RESPONSE_ERROR, String.format("Avatar Info HTTP Resonse Error. Description: %s", "The indicated parameter is empty or invalid.")); - break; - case 401: - this.lastError = new NimbleFriendsError(NimbleFriendsError.Code.NIMBLE_FRIENDS_REFRESH_SCOPE_SERVER_RESPONSE_ERROR, String.format("Avatar Info HTTP Resonse Error. Description: %s", "The specified AuthToken is empty or invalid.")); - break; - default: - this.lastError = new NimbleFriendsError(NimbleFriendsError.Code.NIMBLE_FRIENDS_REFRESH_SCOPE_SERVER_RESPONSE_ERROR, "Avatar Info HTTP Resonse Error"); - break; - } - throw this.lastError; - } - InputStream dataStream = networkConnectionHandle.getResponse().getDataStream(); - if (dataStream == null || dataStream.toString().length() == 0) { - throw new NimbleFriendsError(networkConnectionHandle.getResponse().getStatusCode(), networkConnectionHandle.getResponse().getError().getMessage()); - } - try { - XmlPullParser newPullParser = XmlPullParserFactory.newInstance().newPullParser(); - newPullParser.setFeature("http://xmlpull.org/v1/doc/features.html#process-namespaces", false); - newPullParser.setInput(dataStream, null); - NimbleUser nimbleUser = null; - ArrayList arrayList = null; - for (int eventType = newPullParser.getEventType(); eventType != 1; eventType = newPullParser.next()) { - switch (eventType) { - case 0: - try { - arrayList = new ArrayList<>(); - break; - } catch (Exception e2) { - e = e2; - Log.Helper.LOGE(this, String.format("Parsing of GOS Avatar Info XML raised an exception. Details: %s", e.getMessage())); - e.printStackTrace(); - this.lastError = new NimbleFriendsError(NimbleFriendsError.Code.NIMBLE_FRIENDS_REFRESH_SCOPE_ERROR_PARSING_HTTP_RESPONSE, "Failed to parse the response XML from GOS Avatar service"); - throw this.lastError; - } - case 2: - String name = newPullParser.getName(); - if (name.equalsIgnoreCase("user")) { - nimbleUser = new NimbleUser(); - try { - nimbleUser.setAuthenticatorId(Global.NIMBLE_AUTHENTICATOR_ORIGIN); - break; - } catch (Exception e3) { - e = e3; - Log.Helper.LOGE(this, String.format("Parsing of GOS Avatar Info XML raised an exception. Details: %s", e.getMessage())); - e.printStackTrace(); - this.lastError = new NimbleFriendsError(NimbleFriendsError.Code.NIMBLE_FRIENDS_REFRESH_SCOPE_ERROR_PARSING_HTTP_RESPONSE, "Failed to parse the response XML from GOS Avatar service"); - throw this.lastError; - } - } else if (nimbleUser == null) { - continue; - } else if (name.equalsIgnoreCase("userId")) { - String nextText = newPullParser.nextText(); - nimbleUser.setUserId(nextText); - nimbleUser.setPid(nextText); - continue; - } else if (name.equalsIgnoreCase("link")) { - nimbleUser.setImageUrl(newPullParser.nextText()); - continue; - } else { - continue; - } - case 3: - if (newPullParser.getName().equalsIgnoreCase("user") && nimbleUser != null) { - arrayList.add(nimbleUser); - nimbleUser = null; - continue; - } - break; - } - } - return arrayList; - } catch (Exception e4) { - e = e4; - } - return new ArrayList<>(); - } - - /* JADX INFO: Access modifiers changed from: private */ - public ArrayList parseBodyJSONData(NetworkConnectionHandle networkConnectionHandle) throws Error { - InputStream dataStream = networkConnectionHandle.getResponse().getDataStream(); - this.lastError = null; - if (dataStream == null || dataStream.toString().length() == 0) { - throw new NimbleFriendsError(networkConnectionHandle.getResponse().getStatusCode(), networkConnectionHandle.getResponse().getError().getMessage()); - } - Scanner useDelimiter = new Scanner(dataStream).useDelimiter("\\A"); - String str = ""; - if (useDelimiter.hasNext()) { - str = useDelimiter.next(); - } - useDelimiter.close(); - ArrayList arrayList = new ArrayList<>(); - if (str == null || str.length() <= 0) { - Log.Helper.LOGE(this, "Generic Server error when retrieving GOS Friends."); - this.lastError = new NimbleFriendsError(NimbleFriendsError.Code.NIMBLE_FRIENDS_REFRESH_SCOPE_SERVER_RESPONSE_ERROR, "Generic Server error when retrieving GOS Friends."); - return arrayList; - } - try { - JSONObject jSONObject = new JSONObject(str); - ArrayList arrayList2 = arrayList; - if (jSONObject != null) { - if (jSONObject.optJSONObject("error") == null) { - JSONArray optJSONArray = jSONObject.optJSONArray("entries"); - if (optJSONArray != null && optJSONArray.length() > 0) { - int i = 0; - while (true) { - arrayList2 = arrayList; - if (i >= optJSONArray.length()) { - break; - } - JSONObject jSONObject2 = optJSONArray.getJSONObject(i); - if (jSONObject2 != null) { - NimbleUser createNimbleUser = createNimbleUser(jSONObject2); - if (createNimbleUser.getUserId() != null && createNimbleUser.getUserId().length() > 0) { - arrayList.add(createNimbleUser); - } - } - i++; - } - } else if (optJSONArray == null || optJSONArray.length() != 0) { - JSONObject jSONObject3 = jSONObject.getJSONObject("error"); - if (jSONObject3 != null) { - int optInt = jSONObject3.optInt("code", -1); - String optString = jSONObject3.optString("type", ""); - Log.Helper.LOGE(this, String.format("Server error when retrieving GOS Friends. Code = %d, Message = %s", Integer.valueOf(optInt), optString)); - this.lastError = new NimbleFriendsError(optInt, optString); - return arrayList; - } - Log.Helper.LOGE(this, "Generic Server error when retrieving GOS Friends."); - this.lastError = new NimbleFriendsError(NimbleFriendsError.Code.NIMBLE_FRIENDS_REFRESH_SCOPE_SERVER_RESPONSE_ERROR, "Generic Server error when retrieving GOS Friends."); - return arrayList; - } else { - Log.Helper.LOGD(this, "GOS response indicates there are no friends for this Origin user"); - this.lastError = null; - return arrayList; - } - } else { - JSONObject optJSONObject = jSONObject.optJSONObject("error"); - String optString2 = optJSONObject.optString("type"); - int optInt2 = optJSONObject.optInt("code", -1); - if (optString2 != null && optString2.length() > 0) { - this.lastError = new NimbleFriendsError(NimbleFriendsError.Code.NIMBLE_FRIENDS_REFRESH_SCOPE_SERVER_RESPONSE_ERROR, String.format("Code: %d, Type: %s", Integer.valueOf(optInt2), optString2)); - } - arrayList2 = null; - } - } - return arrayList2; - } catch (JSONException e) { - Log.Helper.LOGE(this, String.format("Exception when parsing JSON response. Error: %s", e.getMessage())); - this.lastError = new NimbleFriendsError(NimbleFriendsError.Code.NIMBLE_FRIENDS_REFRESH_SCOPE_SERVER_RESPONSE_ERROR, e.getMessage()); - return arrayList; - } - } - - /* JADX INFO: Access modifiers changed from: private */ - public void sendGosRefreshAvatarsRequest(String str, String str2, List list, final NimbleFriendsList.FriendsListType friendsListType, final NimbleFriendsRefreshCallback nimbleFriendsRefreshCallback, final NimbleFriendsRefreshScope nimbleFriendsRefreshScope) { - try { - HttpRequest makeGetFriendsAvatarInfoRequest = makeGetFriendsAvatarInfoRequest(str, str2, list); - if (makeGetFriendsAvatarInfoRequest == null) { - Log.Helper.LOGE(this, "Failed to create HTTP Request for GOS getAvatarInfo"); - invokeCallbackWithScopeError(nimbleFriendsRefreshScope, nimbleFriendsRefreshCallback, NimbleFriendsError.Code.NIMBLE_FRIENDS_REFRESH_SCOPE_FAILED_TO_CREATE_GOS_REQUEST, "Failed to create HTTP Request for GOS getAvatarInfo", friendsListType); - return; - } - Network.getComponent().sendRequest(makeGetFriendsAvatarInfoRequest, new NetworkConnectionCallback() { // from class: com.ea.nimble.friends..4 - @Override // com.ea.nimble.NetworkConnectionCallback - public void callback(NetworkConnectionHandle networkConnectionHandle) { - - } - }); - } catch (Exception e) { - Log.Helper.LOGE(this, String.format("Exception raised when creating GoS Avatar URL refresh request. Exception: %s", e.getMessage())); - invokeCallbackWithScopeError(nimbleFriendsRefreshScope, nimbleFriendsRefreshCallback, new NimbleFriendsError(NimbleFriendsError.Code.NIMBLE_FRIENDS_REFRESH_SCOPE_ERROR_PARSING_HTTP_RESPONSE, "Failed to process request for Avatar Info"), friendsListType); - } - } - - /* JADX INFO: Access modifiers changed from: private */ - public void sendGosRefreshFriendsRequest(int i, int i2, String str, String str2, String str3, final NimbleFriendsList.FriendsListType friendsListType, final NimbleFriendsRefreshCallback nimbleFriendsRefreshCallback, final NimbleFriendsRefreshBasicInfo nimbleFriendsRefreshBasicInfo) { - try { - HttpRequest makeGetFriendsRequest = makeGetFriendsRequest(i, i2, true, str, str2, str3); - if (makeGetFriendsRequest == null) { - try { - Log.Helper.LOGE(this, "Failed to create HTTP Request for GOS getFriendsList"); - invokeCallbackWithBasicScopeError(nimbleFriendsRefreshBasicInfo, nimbleFriendsRefreshCallback, NimbleFriendsError.Code.NIMBLE_FRIENDS_REFRESH_SCOPE_FAILED_TO_CREATE_GOS_REQUEST, "Failed to create HTTP Request for GOS getFriendsList", friendsListType); - } catch (Exception e) { - String format = String.format("Authenticator (%s) does not support Identity Refresh for Friends List", this.m_authenticatorId); - Log.Helper.LOGE(this, format); - invokeCallbackWithBasicScopeError(nimbleFriendsRefreshBasicInfo, nimbleFriendsRefreshCallback, NimbleFriendsError.Code.NIMBLE_FRIENDS_REFRESH_AUTHENTICATOR_NOT_SUPPORTED, format, friendsListType); - } - } else { - Network.getComponent().sendRequest(makeGetFriendsRequest, networkConnectionHandle -> { }); - } - } catch (Exception e2) { - } - } - - @Override // com.ea.nimble.friends.NimbleFriendsListImpl - protected NimbleUser createNimbleUser(JSONObject jSONObject) { - NimbleUser nimbleUser = new NimbleUser(); - try { - nimbleUser.setAuthenticatorId(this.m_authenticatorId); - nimbleUser.setDisplayName(jSONObject.optString("displayName", "")); - nimbleUser.setFriendType(jSONObject.optString("friendType", "")); - nimbleUser.setUserId(String.valueOf(jSONObject.optLong("userId"))); - nimbleUser.setPersonaId(String.valueOf(jSONObject.optLong("personaId"))); - nimbleUser.setPid(String.valueOf(jSONObject.optLong("userId"))); - if (jSONObject.optLong("timestamp", 0) != 0) { - nimbleUser.setRefreshTimestamp(new Date(jSONObject.optLong("timestamp") * 1000)); - } - return nimbleUser; - } catch (Exception e) { - Log.Helper.LOGW(this, String.format("Exception when parsing JSON for Friends. Message: %s", e.getMessage())); - return nimbleUser; - } - } - - @Override // com.ea.nimble.friends.NimbleFriendsListImpl, com.ea.nimble.LogSource - public /* bridge */ /* synthetic */ String getLogSourceTitle() { - return super.getLogSourceTitle(); - } - - @Override // com.ea.nimble.friends.NimbleFriendsListImpl - protected void refreshFriendsListBasicInfo(final int i, final int i2, String str, final NimbleFriendsList.FriendsListType friendsListType, final NimbleFriendsRefreshCallback nimbleFriendsRefreshCallback, final NimbleFriendsRefreshBasicInfo nimbleFriendsRefreshBasicInfo) { - if (friendsListType == NimbleFriendsList.FriendsListType.CURRENT_GAME_FRIENDS) { - Log.Helper.LOGE(this, "Origin Friends Service does not support getting friends with PlayedCurrentGame flag"); - invokeCallbackWithBasicScopeError(nimbleFriendsRefreshBasicInfo, nimbleFriendsRefreshCallback, NimbleFriendsError.Code.NIMBLE_FRIENDS_REFRESH_SCOPE_FRIENDS_LIST_TYPE_UNSUPPORTED, "Origin Friends Service does not support getting friends with PlayedCurrentGame flag", friendsListType); - } else if (!isNimbleComponentAvailable("com.ea.nimble.identity")) { - Log.Helper.LOGE(this, "Unable to refresh friends Identity information because NimbleIdentity is not available"); - invokeCallbackWithBasicScopeError(nimbleFriendsRefreshBasicInfo, nimbleFriendsRefreshCallback, NimbleFriendsError.Code.NIMBLE_FRIENDS_IDENTITY_NOT_AVAILABLE, "Unable to refresh friends Identity information because NimbleIdentity is not available", friendsListType); - } else { - INimbleIdentity iNimbleIdentity = (INimbleIdentity) Base.getComponent("com.ea.nimble.identity"); - NimbleIdentityPidInfo pidInfo = iNimbleIdentity.getAuthenticatorById(this.m_authenticatorId).getPidInfo(); - String str2 = null; - if (pidInfo != null) { - str2 = pidInfo.getPid(); - } - if (!Utility.validString(str2)) { - invokeCallbackWithBasicScopeError(nimbleFriendsRefreshBasicInfo, nimbleFriendsRefreshCallback, NimbleFriendsError.Code.NIMBLE_FRIENDS_REFRESH_AUTHENTICATOR_NOT_LOGGED_IN, "Origin PID for the current user is not available.", friendsListType); - } else { - // from class: com.ea.nimble.friends..1 -// com.ea.nimble.identity.INimbleIdentityAuthenticator.NimbleAuthenticatorAccessTokenCallback - iNimbleIdentity.getAuthenticatorById(this.m_authenticatorId).requestAccessToken((iNimbleIdentityAuthenticator, str3, str4, error) -> { - - }); - } - } - } - - @Override // com.ea.nimble.friends.NimbleFriendsListImpl - protected void refreshFriendsListIdentityInfo(ArrayList arrayList, NimbleFriendsList.FriendsListType friendsListType, NimbleFriendsRefreshScope nimbleFriendsRefreshScope, NimbleFriendsRefreshCallback nimbleFriendsRefreshCallback) { - Log.Helper.LOGI(this, "Origin Friends Service does not support IdentityInfo refresh because Origin friends already have Identity information"); - invokeCallbackWithScopeError(nimbleFriendsRefreshScope, nimbleFriendsRefreshCallback, NimbleFriendsError.Code.NIMBLE_FRIENDS_REFRESH_TYPE_UNSUPPORTED, "Origin Friends Service does not support IdentityInfo refresh because Origin friends already have Identity information", friendsListType); - } - - @Override // com.ea.nimble.friends.NimbleFriendsListImpl - protected void refreshFriendsListImageUrl(final List list, final NimbleFriendsList.FriendsListType friendsListType, final NimbleFriendsRefreshCallback nimbleFriendsRefreshCallback, final NimbleFriendsRefreshScope nimbleFriendsRefreshScope) { - if (!isNimbleComponentAvailable("com.ea.nimble.identity")) { - Log.Helper.LOGE(this, "Unable to refresh friends Avatar information because NimbleIdentity is not available"); - invokeCallbackWithScopeError(nimbleFriendsRefreshScope, nimbleFriendsRefreshCallback, NimbleFriendsError.Code.NIMBLE_FRIENDS_IDENTITY_NOT_AVAILABLE, "Unable to refresh friends Avatar information because NimbleIdentity is not available", friendsListType); - return; - } - INimbleIdentity iNimbleIdentity = (INimbleIdentity) Base.getComponent("com.ea.nimble.identity"); - if (iNimbleIdentity == null) { - Log.Helper.LOGE(this, "Identity Component not found. Not able to get friends Avatars."); - invokeCallbackWithScopeError(nimbleFriendsRefreshScope, nimbleFriendsRefreshCallback, NimbleFriendsError.Code.NIMBLE_FRIENDS_IDENTITY_NOT_AVAILABLE, "Identity Component not found. Not able to get friends Avatars.", friendsListType); - return; - } - iNimbleIdentity.getAuthenticatorById(this.m_authenticatorId).requestAccessToken(new INimbleIdentityAuthenticator.NimbleAuthenticatorAccessTokenCallback() { // from class: com.ea.nimble.friends..3 - @Override // com.ea.nimble.identity.INimbleIdentityAuthenticator.NimbleAuthenticatorAccessTokenCallback - public void AccessTokenCallback(INimbleIdentityAuthenticator iNimbleIdentityAuthenticator, String str, String str2, Error error) { - - } - }); - } -} diff --git a/app/src/main/java/com/ea/nimble/friends/NimbleFriendsRangeRefreshResult.java b/app/src/main/java/com/ea/nimble/friends/NimbleFriendsRangeRefreshResult.java deleted file mode 100644 index 037ec34..0000000 --- a/app/src/main/java/com/ea/nimble/friends/NimbleFriendsRangeRefreshResult.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.ea.nimble.friends; - -/* loaded from: stdlib.jar:com/ea/nimble/friends/NimbleFriendsRangeRefreshResult.class */ -public class NimbleFriendsRangeRefreshResult extends NimbleFriendsRefreshResult { - protected boolean m_friendListEndInRefresh; - protected int m_size; - protected int m_startIndex; - protected int m_totalFriendCount; - - public int getRefreshSize() { - return this.m_size; - } - - public int getRefreshStartIndex() { - return this.m_startIndex; - } - - public int getTotalFriendCount() { - return this.m_totalFriendCount; - } - - public boolean isFriendListEndInRefresh() { - return this.m_friendListEndInRefresh; - } -} diff --git a/app/src/main/java/com/ea/nimble/friends/NimbleFriendsRefreshBasicInfo.java b/app/src/main/java/com/ea/nimble/friends/NimbleFriendsRefreshBasicInfo.java deleted file mode 100644 index f26aaf3..0000000 --- a/app/src/main/java/com/ea/nimble/friends/NimbleFriendsRefreshBasicInfo.java +++ /dev/null @@ -1,39 +0,0 @@ -package com.ea.nimble.friends; - -/* loaded from: stdlib.jar:com/ea/nimble/friends/NimbleFriendsRefreshBasicInfo.class */ -public class NimbleFriendsRefreshBasicInfo extends NimbleFriendsRefreshScope { - private boolean m_nextPage; - private int m_range; - private int m_startIndex; - - public NimbleFriendsRefreshBasicInfo() { - this.m_startIndex = -1; - this.m_range = -1; - this.m_nextPage = false; - this.m_nextPage = true; - } - - public NimbleFriendsRefreshBasicInfo(int i, int i2) { - this.m_startIndex = -1; - this.m_range = -1; - this.m_nextPage = false; - this.m_startIndex = i; - this.m_range = i2; - this.m_nextPage = false; - } - - /* JADX INFO: Access modifiers changed from: package-private */ - public boolean getNextPage() { - return this.m_nextPage; - } - - /* JADX INFO: Access modifiers changed from: package-private */ - public int getRange() { - return this.m_range; - } - - /* JADX INFO: Access modifiers changed from: package-private */ - public int getStartIndex() { - return this.m_startIndex; - } -} diff --git a/app/src/main/java/com/ea/nimble/friends/NimbleFriendsRefreshCallback.java b/app/src/main/java/com/ea/nimble/friends/NimbleFriendsRefreshCallback.java deleted file mode 100644 index 0c27943..0000000 --- a/app/src/main/java/com/ea/nimble/friends/NimbleFriendsRefreshCallback.java +++ /dev/null @@ -1,6 +0,0 @@ -package com.ea.nimble.friends; - -/* loaded from: stdlib.jar:com/ea/nimble/friends/NimbleFriendsRefreshCallback.class */ -public interface NimbleFriendsRefreshCallback { - void onCallback(NimbleFriendsList nimbleFriendsList, NimbleFriendsRefreshScope nimbleFriendsRefreshScope, NimbleFriendsRefreshResult nimbleFriendsRefreshResult); -} diff --git a/app/src/main/java/com/ea/nimble/friends/NimbleFriendsRefreshIdentityInfo.java b/app/src/main/java/com/ea/nimble/friends/NimbleFriendsRefreshIdentityInfo.java deleted file mode 100644 index 0827909..0000000 --- a/app/src/main/java/com/ea/nimble/friends/NimbleFriendsRefreshIdentityInfo.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.ea.nimble.friends; - -import java.util.ArrayList; - -/* loaded from: stdlib.jar:com/ea/nimble/friends/NimbleFriendsRefreshIdentityInfo.class */ -public class NimbleFriendsRefreshIdentityInfo extends NimbleFriendsRefreshScope { - private ArrayList userIds; - - public NimbleFriendsRefreshIdentityInfo(ArrayList arrayList) { - this.userIds = arrayList; - } - - public ArrayList getTargetedFriendIds() { - return this.userIds; - } -} diff --git a/app/src/main/java/com/ea/nimble/friends/NimbleFriendsRefreshImageUrl.java b/app/src/main/java/com/ea/nimble/friends/NimbleFriendsRefreshImageUrl.java deleted file mode 100644 index 1ad50d3..0000000 --- a/app/src/main/java/com/ea/nimble/friends/NimbleFriendsRefreshImageUrl.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.ea.nimble.friends; - -import java.util.ArrayList; - -/* loaded from: stdlib.jar:com/ea/nimble/friends/NimbleFriendsRefreshImageUrl.class */ -public class NimbleFriendsRefreshImageUrl extends NimbleFriendsRefreshScope { - private ArrayList userIds; - - public NimbleFriendsRefreshImageUrl(ArrayList arrayList) { - this.userIds = arrayList; - } - - public ArrayList getTargetedFriendIds() { - return this.userIds; - } -} diff --git a/app/src/main/java/com/ea/nimble/friends/NimbleFriendsRefreshResult.java b/app/src/main/java/com/ea/nimble/friends/NimbleFriendsRefreshResult.java deleted file mode 100644 index 89e9de6..0000000 --- a/app/src/main/java/com/ea/nimble/friends/NimbleFriendsRefreshResult.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.ea.nimble.friends; - -import com.ea.nimble.Error; -import java.util.ArrayList; -import java.util.List; - -/* loaded from: stdlib.jar:com/ea/nimble/friends/NimbleFriendsRefreshResult.class */ -public class NimbleFriendsRefreshResult { - protected Error m_error; - protected boolean m_success; - protected ArrayList m_userList = new ArrayList<>(); - - public Error getError() { - return this.m_error; - } - - public List getUpdatedFriends() { - return this.m_userList; - } - - public boolean isSuccess() { - return this.m_success; - } -} diff --git a/app/src/main/java/com/ea/nimble/friends/NimbleFriendsRefreshScope.java b/app/src/main/java/com/ea/nimble/friends/NimbleFriendsRefreshScope.java deleted file mode 100644 index 01bb391..0000000 --- a/app/src/main/java/com/ea/nimble/friends/NimbleFriendsRefreshScope.java +++ /dev/null @@ -1,5 +0,0 @@ -package com.ea.nimble.friends; - -/* loaded from: stdlib.jar:com/ea/nimble/friends/NimbleFriendsRefreshScope.class */ -public abstract class NimbleFriendsRefreshScope { -} diff --git a/app/src/main/java/com/ea/nimble/friends/NimbleFriendsUtility.java b/app/src/main/java/com/ea/nimble/friends/NimbleFriendsUtility.java deleted file mode 100644 index 68529f7..0000000 --- a/app/src/main/java/com/ea/nimble/friends/NimbleFriendsUtility.java +++ /dev/null @@ -1,65 +0,0 @@ -package com.ea.nimble.friends; - -import com.ea.nimble.Base; -import com.ea.nimble.Error; -import com.ea.nimble.NetworkConnectionHandle; -import java.io.InputStream; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Scanner; -import org.json.JSONArray; -import org.json.JSONException; -import org.json.JSONObject; - -class NimbleFriendsUtility { - NimbleFriendsUtility() { - } - - protected static JSONArray cutJSONArray(JSONArray jSONArray, int i) { - return null; - } - - protected static boolean isNimbleComponentAvailable(String str) { - boolean z = false; - if (Base.getComponent(str) != null) { - z = true; - } - return z; - } - - public static HashMap parseBodyJSONData(NetworkConnectionHandle networkConnectionHandle) throws Error { - return null; - } - - /* JADX INFO: Access modifiers changed from: protected */ - public static ArrayList parseJSONObjectToArrayOfUserInfo(JSONObject jSONObject) { - ArrayList arrayList = null; - if (jSONObject != null) { - if (jSONObject.optJSONObject("pidInfos") == null) { - arrayList = null; - } else { - JSONArray optJSONArray = jSONObject.optJSONObject("pidInfos").optJSONArray("pidInfo"); - arrayList = null; - if (optJSONArray != null) { - ArrayList arrayList2 = new ArrayList<>(); - int i = 0; - while (true) { - arrayList = arrayList2; - if (i >= optJSONArray.length()) { - break; - } - try { - UserInfoFromIdentity userInfoFromIdentity = new UserInfoFromIdentity(optJSONArray.getJSONObject(i)); - if (!(userInfoFromIdentity.getPidId() == null || userInfoFromIdentity.getPidId() == "" || userInfoFromIdentity.getExternalRefValue() == null || userInfoFromIdentity.getExternalRefValue() == "")) { - arrayList2.add(userInfoFromIdentity); - } - } catch (JSONException e) { - } - i++; - } - } - } - } - return arrayList; - } -} diff --git a/app/src/main/java/com/ea/nimble/friends/NimbleOriginFriendsService.java b/app/src/main/java/com/ea/nimble/friends/NimbleOriginFriendsService.java deleted file mode 100644 index d121493..0000000 --- a/app/src/main/java/com/ea/nimble/friends/NimbleOriginFriendsService.java +++ /dev/null @@ -1,12 +0,0 @@ -package com.ea.nimble.friends; - -import com.ea.nimble.Base; - -/* loaded from: stdlib.jar:com/ea/nimble/friends/NimbleOriginFriendsService.class */ -public class NimbleOriginFriendsService { - public static final String NIMBLE_COMPONENT_ID_FRIENDS_ORIGIN = "com.ea.nimble.friends.originfriendsservice"; - - public static INimbleOriginFriendsService getComponent() { - return (INimbleOriginFriendsService) Base.getComponent(NIMBLE_COMPONENT_ID_FRIENDS_ORIGIN); - } -} diff --git a/app/src/main/java/com/ea/nimble/friends/NimbleOriginFriendsServiceImpl.java b/app/src/main/java/com/ea/nimble/friends/NimbleOriginFriendsServiceImpl.java deleted file mode 100644 index 55c1d7a..0000000 --- a/app/src/main/java/com/ea/nimble/friends/NimbleOriginFriendsServiceImpl.java +++ /dev/null @@ -1,1209 +0,0 @@ -package com.ea.nimble.friends; - -import com.ea.nimble.Base; -import com.ea.nimble.Component; -import com.ea.nimble.Error; -import com.ea.nimble.Global; -import com.ea.nimble.HttpRequest; -import com.ea.nimble.IHttpRequest; -import com.ea.nimble.Log; -import com.ea.nimble.LogSource; -import com.ea.nimble.Network; -import com.ea.nimble.NetworkConnectionCallback; -import com.ea.nimble.NetworkConnectionHandle; -import com.ea.nimble.SynergyEnvironment; -import com.ea.nimble.identity.INimbleIdentity; -import com.ea.nimble.identity.INimbleIdentityAuthenticator; -import com.ea.nimble.identity.NimbleIdentityPidInfo; - -import org.json.JSONArray; -import org.json.JSONException; -import org.json.JSONObject; - -import java.io.ByteArrayOutputStream; -import java.io.InputStream; -import java.net.MalformedURLException; -import java.net.URL; -import java.util.ArrayList; -import java.util.Date; -import java.util.HashMap; -import java.util.Scanner; - -public class NimbleOriginFriendsServiceImpl extends Component implements LogSource, INimbleOriginFriendsService { - private static final String GET_RECEIVED_INVITATION_LIST_URI = "/friends/2/users/%s/invitations/inbound"; - private static final String GET_SENT_INVITATION_LIST_URI = "/friends/2/users/%s/invitations/outbound"; - private static final String POST_SEND_FRIEND_INVITATION_URI = "/friends/2/users/%s/invitations/outbound/%s"; - private static final String RESPOND_TO_FRIEND_INVITATION_URI = "/friends/2/users/%s/invitations/inbound/%s"; - private static final String SEARCH_USER_BY_DISPLAY_NAME_URI = "/proxy/identity/personas?displayName=%s*"; - private static final String SEARCH_USER_BY_EMAIL_URI = "/proxy/identity/pids?email=%s"; - private static int SMS_REQUEST_CODE = 6697; - private static int EMAIL_REQUEST_CODE = 6698; - - public enum UserSearchCriteria { - EMAIL, - DISPLAY_NAME - } - - private NimbleUser createNimbleUserFromGosJson(JSONObject jSONObject) { - NimbleUser nimbleUser = new NimbleUser(); - try { - nimbleUser.setAuthenticatorId(Global.NIMBLE_AUTHENTICATOR_ORIGIN); - nimbleUser.setDisplayName(jSONObject.optString("displayName", "")); - nimbleUser.setFriendType(jSONObject.optString("friendType", "")); - nimbleUser.setUserId(String.valueOf(jSONObject.optLong("userId", 0))); - nimbleUser.setPersonaId(String.valueOf(jSONObject.optLong("personaId", 0))); - nimbleUser.setPid(String.valueOf(jSONObject.optLong("userId", 0))); - if (jSONObject.optLong("timestamp", 0) != 0) { - nimbleUser.setRefreshTimestamp(new Date(jSONObject.optLong("timestamp") * 1000)); - } - return nimbleUser; - } catch (Exception e) { - Log.Helper.LOGW(this, String.format("Exception when parsing JSON response. Message: %s", e.getMessage())); - return null; - } - } - - private NimbleUser createNimbleUserFromNexusJson(JSONObject jSONObject) { - NimbleUser nimbleUser = new NimbleUser(); - try { - nimbleUser.setAuthenticatorId(Global.NIMBLE_AUTHENTICATOR_ORIGIN); - nimbleUser.setDisplayName(jSONObject.optString("displayName", "")); - nimbleUser.setFriendType(""); - nimbleUser.setUserId(String.valueOf(jSONObject.optLong("pidId", 0))); - nimbleUser.setPersonaId(String.valueOf(jSONObject.optLong("personaId", 0))); - nimbleUser.setPid(String.valueOf(jSONObject.optLong("pidId", 0))); - if (jSONObject.optLong("timestamp", 0) != 0) { - nimbleUser.setRefreshTimestamp(new Date(jSONObject.optLong("timestamp") * 1000)); - } - return nimbleUser; - } catch (Exception e) { - Log.Helper.LOGW(this, String.format("Exception when parsing JSON response. Message: %s", e.getMessage())); - return null; - } - } - - protected static String getIdentityProxyUrlFromSynergy() { - String str; - String serverUrlWithKey = SynergyEnvironment.getComponent().getServerUrlWithKey(SynergyEnvironment.SERVER_URL_KEY_IDENTITY_PROXY); - if (serverUrlWithKey == null || serverUrlWithKey.length() <= 0) { - str = null; - } else { - str = serverUrlWithKey; - if (serverUrlWithKey.charAt(serverUrlWithKey.length() - 1) == '/') { - return serverUrlWithKey.substring(0, serverUrlWithKey.length() - 1); - } - } - return str; - } - - private String getMdmAppKey() { - return SynergyEnvironment.getComponent().getGosMdmAppKey(); - } - - private String getOriginFriendsUrlFromSynergy() { - String serverUrlWithKey = SynergyEnvironment.getComponent().getServerUrlWithKey(SynergyEnvironment.SERVER_URL_KEY_EADP_FRIENDS_HOST); - if (serverUrlWithKey == null || serverUrlWithKey.length() <= 0) { - return null; - } - String str = serverUrlWithKey; - if (serverUrlWithKey.charAt(serverUrlWithKey.length() - 1) == '/') { - str = serverUrlWithKey.substring(0, serverUrlWithKey.length() - 1); - } - return str; - } - - private static void initialize() { - Base.registerComponent(new NimbleOriginFriendsServiceImpl(), NimbleOriginFriendsService.NIMBLE_COMPONENT_ID_FRIENDS_ORIGIN); - } - - /* JADX INFO: Access modifiers changed from: private */ - public void invokeFriendInvitationCallbackWithCode(INimbleOriginFriendsService.NimbleFriendInvitationCallback nimbleFriendInvitationCallback, NimbleFriendsError.Code code, String str) { - if (nimbleFriendInvitationCallback == null) { - Log.Helper.LOGW(this, "Unable to invoke an error callback for Friends services because callback is null"); - } else { - nimbleFriendInvitationCallback.onCallback(false, new NimbleFriendsError(code, str)); - } - } - - /* JADX INFO: Access modifiers changed from: private */ - public void invokeFriendInvitationCallbackWithError(INimbleOriginFriendsService.NimbleFriendInvitationCallback nimbleFriendInvitationCallback, Error error) { - if (nimbleFriendInvitationCallback == null) { - Log.Helper.LOGW(this, "Unable to invoke an error callback for Friends services because callback is null"); - } else { - nimbleFriendInvitationCallback.onCallback(false, error); - } - } - - /* JADX INFO: Access modifiers changed from: private */ - public void invokeFriendInvitationCallbackWithSuccess(INimbleOriginFriendsService.NimbleFriendInvitationCallback nimbleFriendInvitationCallback) { - if (nimbleFriendInvitationCallback == null) { - Log.Helper.LOGW(this, "Unable to invoke a success callback for Friends services because callback is null"); - } else { - nimbleFriendInvitationCallback.onCallback(true, null); - } - } - - /* JADX INFO: Access modifiers changed from: private */ - public void invokeUserSearchCallbackWithCode(INimbleOriginFriendsService.NimbleUserSearchCallback nimbleUserSearchCallback, NimbleFriendsError.Code code, String str) { - if (nimbleUserSearchCallback == null) { - Log.Helper.LOGW(this, "Unable to invoke an error callback for Friends services because callback is null"); - } else { - nimbleUserSearchCallback.onCallback(null, new NimbleFriendsError(code, str)); - } - } - - /* JADX INFO: Access modifiers changed from: private */ - public void invokeUserSearchCallbackWithError(INimbleOriginFriendsService.NimbleUserSearchCallback nimbleUserSearchCallback, Error error) { - if (nimbleUserSearchCallback == null) { - Log.Helper.LOGW(this, "Unable to invoke an error callback for Friends services because callback is null"); - } else { - nimbleUserSearchCallback.onCallback(null, error); - } - } - - /* JADX INFO: Access modifiers changed from: private */ - public void invokeUserSearchCallbackWithSuccess(INimbleOriginFriendsService.NimbleUserSearchCallback nimbleUserSearchCallback, ArrayList arrayList) { - if (nimbleUserSearchCallback == null) { - Log.Helper.LOGW(this, "Unable to invoke a success callback for Friends services because callback is null"); - } else { - nimbleUserSearchCallback.onCallback(arrayList, null); - } - } - - private boolean isNimbleComponentAvailable(String str) { - boolean z = false; - if (Base.getComponent(str) != null) { - z = true; - } - return z; - } - - private HttpRequest makeFriendInvitationRequest(String str, String str2, String str3, String str4, INimbleOriginFriendsService.NimbleFriendInvitationCallback nimbleFriendInvitationCallback) { - Exception e; - MalformedURLException e2; - String originFriendsUrlFromSynergy = getOriginFriendsUrlFromSynergy(); - String mdmAppKey = getMdmAppKey(); - if (originFriendsUrlFromSynergy == null || originFriendsUrlFromSynergy.length() <= 0) { - Log.Helper.LOGW(this, "Cannot make HTTP request for sending friend invitation because friends endpoint URI is empty or null"); - return null; - } else if (mdmAppKey == null || mdmAppKey.length() <= 0) { - Log.Helper.LOGW(this, "Cannot make HTTP request for sending friend invitation because MDM app key is empty or null"); - return null; - } else if (str2 == null || str2.length() <= 0) { - Log.Helper.LOGW(this, "Cannot make HTTP request for sending friend invitation because access token is null or empty"); - return null; - } else if (str == null || str.length() <= 0) { - Log.Helper.LOGW(this, "Cannot make HTTP request for sending friend invitation because user's nucleus ID is null or empty"); - return null; - } else if (str3 == null || str3.length() <= 0) { - Log.Helper.LOGW(this, "Cannot make HTTP request for sending friend invitation because target user's nucleus ID is null or empty"); - return null; - } else { - HttpRequest httpRequest = null; - HttpRequest httpRequest2 = null; - String str5 = originFriendsUrlFromSynergy + String.format(POST_SEND_FRIEND_INVITATION_URI, str, str3); - StringBuffer stringBuffer = new StringBuffer(); - stringBuffer.append("source=mobile"); - if (str4 != null && str4.length() > 0) { - stringBuffer.append("&comment="); - stringBuffer.append(str4); - } - try { - HttpRequest httpRequest3 = new HttpRequest(new URL(str5)); - try { - httpRequest3.method = IHttpRequest.Method.POST; - byte[] bytes = stringBuffer.toString().getBytes("UTF-8"); - ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(bytes.length); - byteArrayOutputStream.write(bytes); - httpRequest3.data = byteArrayOutputStream; - HashMap hashMap = new HashMap<>(); - hashMap.put("X-AuthToken", str2); - hashMap.put("X-Application-Key", mdmAppKey); - hashMap.put("X-Api-Version", "2"); - httpRequest3.headers = hashMap; - return httpRequest3; - } catch (MalformedURLException e3) { - e2 = e3; - httpRequest2 = httpRequest3; - Log.Helper.LOGE(this, "Exception when creating HTTP request URL for send friend invitation. Exception: " + e2.getMessage()); - return httpRequest2; - } catch (Exception e4) { - e = e4; - httpRequest = httpRequest3; - Log.Helper.LOGE(this, "Exception when creating HTTP request URL for send friend invitation. Exception: " + e.getMessage()); - return httpRequest; - } - } catch (MalformedURLException e5) { - e2 = e5; - } catch (Exception e6) { - e = e6; - } - } - return new HttpRequest(); - } - - private HttpRequest makeGetFriendInvitationListRequest(String str, String str2, String str3) { - Exception e; - MalformedURLException e2; - String originFriendsUrlFromSynergy = getOriginFriendsUrlFromSynergy(); - String mdmAppKey = getMdmAppKey(); - if (originFriendsUrlFromSynergy == null || originFriendsUrlFromSynergy.length() <= 0) { - Log.Helper.LOGW(this, "Cannot make HTTP request because friends endpoint URI is empty or null"); - return null; - } else if (mdmAppKey == null || mdmAppKey.length() <= 0) { - Log.Helper.LOGW(this, "Cannot make HTTP request because MDM app key is empty or null"); - return null; - } else if (str3 == null || str3.length() <= 0) { - Log.Helper.LOGW(this, "Cannot make HTTP request friends API URI is empty or null"); - return null; - } else if (str2 == null || str2.length() <= 0) { - Log.Helper.LOGW(this, "Cannot make HTTP request because access token is null or empty"); - return null; - } else if (str == null || str.length() <= 0) { - Log.Helper.LOGW(this, "Cannot make HTTP request because user's nucleus ID is null or empty"); - return null; - } else { - HttpRequest httpRequest = null; - HttpRequest httpRequest2 = null; - try { - HttpRequest httpRequest3 = new HttpRequest(new URL(originFriendsUrlFromSynergy + String.format(str3, str))); - try { - httpRequest3.method = IHttpRequest.Method.GET; - HashMap hashMap = new HashMap<>(); - hashMap.put("X-AuthToken", str2); - hashMap.put("X-Application-Key", mdmAppKey); - hashMap.put("X-Api-Version", "2"); - httpRequest3.headers = hashMap; - return httpRequest3; - } catch (Exception e4) { - e = e4; - httpRequest = httpRequest3; - Log.Helper.LOGE(this, "Exception when creating HTTP request URL. Exception: " + e.getMessage()); - return httpRequest; - } - } catch (MalformedURLException e5) { - e2 = e5; - } catch (Exception e6) { - e = e6; - } - } - return new HttpRequest(); - } - - private HttpRequest makeRespondToFriendInvitationRequest(boolean z, String str, String str2, String str3) { - Exception e; - String originFriendsUrlFromSynergy = getOriginFriendsUrlFromSynergy(); - String mdmAppKey = getMdmAppKey(); - if (originFriendsUrlFromSynergy == null || originFriendsUrlFromSynergy.length() <= 0) { - Log.Helper.LOGW(this, "Cannot make HTTP request for responding to an invitation because end point URI is null or empty"); - return null; - } else if (mdmAppKey == null || mdmAppKey.length() <= 0) { - Log.Helper.LOGW(this, "Cannot make HTTP request for responding to an invitation because MDM App Keyis null or empty"); - return null; - } else if (str == null || str.length() <= 0) { - Log.Helper.LOGW(this, "Cannot make HTTP request for responding to an invitation because nucleus ID is null or empty"); - return null; - } else if (str2 == null || str2.length() <= 0) { - Log.Helper.LOGW(this, "Cannot make HTTP request for responding to an invitation because friend ID is null or empty"); - return null; - } else if (str3 == null || str3.length() <= 0) { - Log.Helper.LOGW(this, "Cannot make HTTP request for responding to an invitation because access token is null or empty"); - return null; - } else { - HttpRequest httpRequest = null; - HttpRequest httpRequest2 = null; - try { - HttpRequest httpRequest3 = new HttpRequest(new URL(originFriendsUrlFromSynergy + String.format(RESPOND_TO_FRIEND_INVITATION_URI, str, str2))); - try { - if (z) { - httpRequest3.method = IHttpRequest.Method.POST; - } else { - httpRequest3.method = IHttpRequest.Method.DELETE; - } - HashMap hashMap = new HashMap<>(); - hashMap.put("X-AuthToken", str3); - hashMap.put("X-Application-Key", mdmAppKey); - hashMap.put("X-Api-Version", "2"); - httpRequest3.headers = hashMap; - return httpRequest3; - } catch (Exception e3) { - e = e3; - httpRequest = httpRequest3; - Log.Helper.LOGE(this, "Exception when creating HTTP request URL for responding to Friends request. Exception: " + e.getMessage()); - return httpRequest; - } - } catch (MalformedURLException e4) { - e = e4; - } catch (Exception e5) { - e = e5; - } - } - return new HttpRequest(); - } - - private HttpRequest makeSearchUserRequest(String str, String str2, String str3, UserSearchCriteria userSearchCriteria) { - Exception e; - MalformedURLException e2; - String identityProxyUrlFromSynergy = getIdentityProxyUrlFromSynergy(); - if (identityProxyUrlFromSynergy == null || identityProxyUrlFromSynergy.length() <= 0) { - Log.Helper.LOGW(this, "Cannot make user search HTTP request because endpoint URI is empty or null"); - return null; - } else if (str == null || str.length() <= 0) { - Log.Helper.LOGW(this, "Cannot make user search HTTP request because AccessToken is empty or null"); - return null; - } else if (str2 == null || str2.length() <= 0) { - Log.Helper.LOGW(this, "Cannot make user search HTTP request TokenType is empty or null"); - return null; - } else if (str3 == null || str3.length() <= 0) { - Log.Helper.LOGW(this, "Cannot make user searchHTTP request because searchCriteria is null or empty"); - return null; - } else { - HttpRequest httpRequest = null; - HttpRequest httpRequest2 = null; - String str4 = identityProxyUrlFromSynergy + (userSearchCriteria == UserSearchCriteria.EMAIL ? String.format(SEARCH_USER_BY_EMAIL_URI, str3) : String.format(SEARCH_USER_BY_DISPLAY_NAME_URI, str3)); - String str5 = str2 + " " + str; - try { - HttpRequest httpRequest3 = new HttpRequest(new URL(str4)); - try { - httpRequest3.method = IHttpRequest.Method.GET; - HashMap hashMap = new HashMap<>(); - hashMap.put("Authorization", str5); - hashMap.put("X-Include-Underage", "true"); - hashMap.put("X-Expand-Results", "true"); - httpRequest3.headers = hashMap; - return httpRequest3; - } catch (Exception e4) { - e = e4; - httpRequest = httpRequest3; - Log.Helper.LOGE(this, "Exception when creating search user HTTP request URL. Exception: " + e.getMessage()); - return httpRequest; - } - } catch (MalformedURLException e5) { - e2 = e5; - } catch (Exception e6) { - e = e6; - } - } - return new HttpRequest(); - } - - /* JADX INFO: Access modifiers changed from: private */ - public ArrayList parseBodyJSONData(NetworkConnectionHandle networkConnectionHandle) throws Error { - InputStream dataStream = networkConnectionHandle.getResponse().getDataStream(); - if (dataStream == null || dataStream.toString().length() == 0) { - throw new NimbleFriendsError(networkConnectionHandle.getResponse().getStatusCode(), networkConnectionHandle.getResponse().getError().getMessage()); - } - Scanner useDelimiter = new Scanner(dataStream).useDelimiter("\\A"); - String str = ""; - if (useDelimiter.hasNext()) { - str = useDelimiter.next(); - } - useDelimiter.close(); - ArrayList arrayList = new ArrayList<>(); - if (str == null || str.length() <= 0) { - Log.Helper.LOGE(this, "Generic Server error when retrieving GOS Friends."); - throw new NimbleFriendsError(NimbleFriendsError.Code.NIMBLE_FRIENDS_ORIGIN_SERVICES_SERVER_RESPONSE_ERROR, "Generic Server error when retrieving GOS Friends."); - } - try { - JSONObject jSONObject = new JSONObject(str); - ArrayList arrayList2 = arrayList; - if (jSONObject != null) { - try { - if (jSONObject.optJSONObject("error") != null) { - JSONObject optJSONObject = jSONObject.optJSONObject("error"); - String optString = optJSONObject.optString("type"); - int optInt = optJSONObject.optInt("code", -1); - if (optString == null || optString.length() <= 0) { - arrayList2 = null; - } else { - throw new NimbleFriendsError(NimbleFriendsError.Code.NIMBLE_FRIENDS_ORIGIN_SERVICES_SERVER_RESPONSE_ERROR, String.format("Code: %d, Type: %s", Integer.valueOf(optInt), optString)); - } - } else { - JSONArray optJSONArray = jSONObject.optJSONArray("entries"); - if (optJSONArray == null) { - JSONObject jSONObject2 = jSONObject.getJSONObject("error"); - if (jSONObject2 != null) { - int optInt2 = jSONObject2.optInt("code", -1); - String optString2 = jSONObject2.optString("type", ""); - Log.Helper.LOGE(this, String.format("Server error when retrieving GOS Friends. Code = %d, Message = %s", Integer.valueOf(optInt2), optString2)); - throw new NimbleFriendsError(optInt2, optString2); - } - Log.Helper.LOGE(this, "Generic Server error when retrieving GOS Friends."); - throw new NimbleFriendsError(NimbleFriendsError.Code.NIMBLE_FRIENDS_ORIGIN_SERVICES_SERVER_RESPONSE_ERROR, "Generic Server error when retrieving GOS Friends."); - } else if (optJSONArray.length() <= 0) { - Log.Helper.LOGD(this, "No invitations found for your selected criteria"); - return arrayList; - } else { - arrayList2 = arrayList; - if (optJSONArray != null) { - arrayList2 = arrayList; - if (optJSONArray.length() > 0) { - int i = 0; - while (true) { - arrayList2 = arrayList; - if (i >= optJSONArray.length()) { - break; - } - JSONObject jSONObject3 = optJSONArray.getJSONObject(i); - if (jSONObject3 != null) { - NimbleUser createNimbleUserFromGosJson = createNimbleUserFromGosJson(jSONObject3); - if (createNimbleUserFromGosJson.getUserId() != null && createNimbleUserFromGosJson.getUserId().length() > 0) { - arrayList.add(createNimbleUserFromGosJson); - } - } - i++; - } - } - } - } - } - } catch (JSONException e) { - e = e; - Log.Helper.LOGE(this, String.format("Exception when parsing JSON response. Error: %s", e.getMessage())); - throw new NimbleFriendsError(NimbleFriendsError.Code.NIMBLE_FRIENDS_ORIGIN_SERVICES_SERVER_RESPONSE_ERROR, e.getMessage()); - } - } - return arrayList2; - } catch (JSONException e2) { - } - return new ArrayList<>(); - } - - /* JADX INFO: Access modifiers changed from: private */ - public ArrayList parseUserSearchByDisplayNameResponse(NetworkConnectionHandle networkConnectionHandle) throws Error { - NimbleUser createNimbleUserFromNexusJson; - InputStream dataStream = networkConnectionHandle.getResponse().getDataStream(); - if (dataStream == null || dataStream.toString().length() == 0) { - throw new NimbleFriendsError(networkConnectionHandle.getResponse().getStatusCode(), networkConnectionHandle.getResponse().getError().getMessage()); - } - Scanner useDelimiter = new Scanner(dataStream).useDelimiter("\\A"); - String str = ""; - if (useDelimiter.hasNext()) { - str = useDelimiter.next(); - } - useDelimiter.close(); - ArrayList arrayList = new ArrayList<>(); - if (str == null || str.length() <= 0) { - Log.Helper.LOGE(this, "Generic Server error when retrieving search user response."); - throw new NimbleFriendsError(NimbleFriendsError.Code.NIMBLE_FRIENDS_ORIGIN_SERVICES_SERVER_RESPONSE_ERROR, "Generic Server error when retrieving search user response."); - } - try { - JSONObject jSONObject = new JSONObject(str); - ArrayList arrayList2 = arrayList; - if (jSONObject != null) { - if (jSONObject.optJSONObject("error") != null) { - String jSONObject2 = jSONObject.optJSONObject("error").toString(); - if (jSONObject2 == null || jSONObject2.length() <= 0) { - arrayList2 = null; - } else { - throw new NimbleFriendsError(NimbleFriendsError.Code.NIMBLE_FRIENDS_ORIGIN_SERVICES_SERVER_RESPONSE_ERROR, jSONObject2); - } - } else { - JSONObject optJSONObject = jSONObject.optJSONObject("personas"); - if (optJSONObject != null) { - JSONArray optJSONArray = optJSONObject.optJSONArray("persona"); - if (optJSONArray != null && optJSONArray.length() > 0) { - int i = 0; - while (true) { - arrayList2 = arrayList; - if (i >= optJSONArray.length()) { - break; - } - JSONObject optJSONObject2 = optJSONArray.optJSONObject(i); - if (!(optJSONObject2 == null || (createNimbleUserFromNexusJson = createNimbleUserFromNexusJson(optJSONObject2)) == null)) { - arrayList.add(createNimbleUserFromNexusJson); - } - i++; - } - } else { - Log.Helper.LOGD(this, "Search response indicates that no user was found with the display name prefix that you searched for."); - return arrayList; - } - } else { - Log.Helper.LOGE(this, "Unable to parse response from server - no personas object found"); - throw new NimbleFriendsError(NimbleFriendsError.Code.NIMBLE_FRIENDS_ORIGIN_SERVICES_SERVER_RESPONSE_ERROR, "Unable to parse response from server - no personas object found"); - } - } - } - return arrayList2; - } catch (JSONException e2) { - } - return new ArrayList<>(); - } - - /* JADX INFO: Access modifiers changed from: private */ - public ArrayList parseUserSearchByEmailResponse(NetworkConnectionHandle networkConnectionHandle) throws Error { - NimbleUser createNimbleUserFromNexusJson; - InputStream dataStream = networkConnectionHandle.getResponse().getDataStream(); - if (dataStream == null || dataStream.toString().length() == 0) { - throw new NimbleFriendsError(networkConnectionHandle.getResponse().getStatusCode(), networkConnectionHandle.getResponse().getError().getMessage()); - } - Scanner useDelimiter = new Scanner(dataStream).useDelimiter("\\A"); - String str = ""; - if (useDelimiter.hasNext()) { - str = useDelimiter.next(); - } - useDelimiter.close(); - ArrayList arrayList = new ArrayList<>(); - if (str == null || str.length() <= 0) { - Log.Helper.LOGE(this, "Generic Server error when retrieving search user response."); - throw new NimbleFriendsError(NimbleFriendsError.Code.NIMBLE_FRIENDS_ORIGIN_SERVICES_SERVER_RESPONSE_ERROR, "Generic Server error when retrieving search user response."); - } - try { - JSONObject jSONObject = new JSONObject(str); - ArrayList arrayList2 = arrayList; - if (jSONObject != null) { - if (jSONObject.optJSONObject("error") != null) { - String jSONObject2 = jSONObject.optJSONObject("error").toString(); - if (jSONObject2 == null || jSONObject2.length() <= 0) { - arrayList2 = null; - } else { - throw new NimbleFriendsError(NimbleFriendsError.Code.NIMBLE_FRIENDS_ORIGIN_SERVICES_SERVER_RESPONSE_ERROR, jSONObject2); - } - } else { - JSONObject optJSONObject = jSONObject.optJSONObject("pids"); - if (optJSONObject != null) { - JSONArray optJSONArray = optJSONObject.optJSONArray("pid"); - if (optJSONArray != null && optJSONArray.length() > 0) { - int i = 0; - while (true) { - arrayList2 = arrayList; - if (i >= optJSONArray.length()) { - break; - } - JSONObject optJSONObject2 = optJSONArray.optJSONObject(i); - if (!(optJSONObject2 == null || (createNimbleUserFromNexusJson = createNimbleUserFromNexusJson(optJSONObject2)) == null)) { - arrayList.add(createNimbleUserFromNexusJson); - } - i++; - } - } else { - Log.Helper.LOGD(this, "Search response indicates that no user was found with the email address that you searched for."); - return arrayList; - } - } else { - Log.Helper.LOGE(this, "Unable to parse response from server - no pids object found"); - throw new NimbleFriendsError(NimbleFriendsError.Code.NIMBLE_FRIENDS_ORIGIN_SERVICES_SERVER_RESPONSE_ERROR, "Unable to parse response from server - no pids object found"); - } - } - } - return arrayList2; - } catch (JSONException e2) { - } - return new ArrayList<>(); - } - - private void processInivtationListRequest(final String str, final INimbleOriginFriendsService.NimbleUserSearchCallback nimbleUserSearchCallback) { - if (!isNimbleComponentAvailable("com.ea.nimble.identity")) { - Log.Helper.LOGE(this, "Unable to process request because NimbleIdentity is not available"); - invokeUserSearchCallbackWithCode(nimbleUserSearchCallback, NimbleFriendsError.Code.NIMBLE_FRIENDS_IDENTITY_NOT_AVAILABLE, "Unable to process request because NimbleIdentity is not available"); - return; - } - INimbleIdentity iNimbleIdentity = (INimbleIdentity) Base.getComponent("com.ea.nimble.identity"); - NimbleIdentityPidInfo pidInfo = iNimbleIdentity.getAuthenticatorById(Global.NIMBLE_AUTHENTICATOR_ORIGIN).getPidInfo(); - String str2 = null; - if (pidInfo != null) { - str2 = pidInfo.getPid(); - } - if (str2 == null || str2.length() <= 0) { - invokeUserSearchCallbackWithCode(nimbleUserSearchCallback, NimbleFriendsError.Code.NIMBLE_FRIENDS_REFRESH_AUTHENTICATOR_NOT_LOGGED_IN, "Origin PID for the current user is not available."); - } else { - String finalStr = str2; - iNimbleIdentity.getAuthenticatorById(Global.NIMBLE_AUTHENTICATOR_ORIGIN).requestAccessToken(new INimbleIdentityAuthenticator.NimbleAuthenticatorAccessTokenCallback() { // from class: com.ea.nimble.friends.NimbleOriginFriendsServiceImpl.3 - @Override // com.ea.nimble.identity.INimbleIdentityAuthenticator.NimbleAuthenticatorAccessTokenCallback - public void AccessTokenCallback(INimbleIdentityAuthenticator iNimbleIdentityAuthenticator, String str3, String str4, Error error) { - if (error != null) { - Log.Helper.LOGE(this, "Failed to refresh AccessToken - cannot process request."); - NimbleOriginFriendsServiceImpl.this.invokeUserSearchCallbackWithError(nimbleUserSearchCallback, error); - return; - } - NimbleOriginFriendsServiceImpl.this.sendGetFriendInvitationListRequest(finalStr, str3, str, nimbleUserSearchCallback); - } - }); - } - } - - private void processRespondToFriendInvitationRequest(final boolean z, final String str, final INimbleOriginFriendsService.NimbleFriendInvitationCallback nimbleFriendInvitationCallback) { - if (!isNimbleComponentAvailable("com.ea.nimble.identity")) { - Log.Helper.LOGE(this, "Unable to process request for responding to friend invitation because NimbleIdentity is not available"); - invokeFriendInvitationCallbackWithCode(nimbleFriendInvitationCallback, NimbleFriendsError.Code.NIMBLE_FRIENDS_IDENTITY_NOT_AVAILABLE, "Unable to process request for responding to friend invitation because NimbleIdentity is not available"); - return; - } - INimbleIdentity iNimbleIdentity = (INimbleIdentity) Base.getComponent("com.ea.nimble.identity"); - NimbleIdentityPidInfo pidInfo = iNimbleIdentity.getAuthenticatorById(Global.NIMBLE_AUTHENTICATOR_ORIGIN).getPidInfo(); - String str2 = null; - if (pidInfo != null) { - str2 = pidInfo.getPid(); - } - if (str2 == null || str2.length() <= 0) { - invokeFriendInvitationCallbackWithCode(nimbleFriendInvitationCallback, NimbleFriendsError.Code.NIMBLE_FRIENDS_REFRESH_AUTHENTICATOR_NOT_LOGGED_IN, "Origin PID for the current user is not available."); - } else { - String finalStr = str2; - iNimbleIdentity.getAuthenticatorById(Global.NIMBLE_AUTHENTICATOR_ORIGIN).requestAccessToken(new INimbleIdentityAuthenticator.NimbleAuthenticatorAccessTokenCallback() { // from class: com.ea.nimble.friends.NimbleOriginFriendsServiceImpl.2 - @Override // com.ea.nimble.identity.INimbleIdentityAuthenticator.NimbleAuthenticatorAccessTokenCallback - public void AccessTokenCallback(INimbleIdentityAuthenticator iNimbleIdentityAuthenticator, String str3, String str4, Error error) { - if (error != null) { - Log.Helper.LOGE(this, "Failed to refresh AccessToken - cannot process request for responding to friend invitation."); - NimbleOriginFriendsServiceImpl.this.invokeFriendInvitationCallbackWithError(nimbleFriendInvitationCallback, error); - return; - } - NimbleOriginFriendsServiceImpl.this.sendRespondToFriendInvitationRequest(z, finalStr, str, str3, nimbleFriendInvitationCallback); - } - }); - } - } - - private void processSearchUserRequest(final String str, final UserSearchCriteria userSearchCriteria, final INimbleOriginFriendsService.NimbleUserSearchCallback nimbleUserSearchCallback) { - if (!isNimbleComponentAvailable("com.ea.nimble.identity")) { - Log.Helper.LOGE(this, "Unable to process request because NimbleIdentity is not available"); - invokeUserSearchCallbackWithCode(nimbleUserSearchCallback, NimbleFriendsError.Code.NIMBLE_FRIENDS_IDENTITY_NOT_AVAILABLE, "Unable to process request because NimbleIdentity is not available"); - return; - } - ((INimbleIdentity) Base.getComponent("com.ea.nimble.identity")).getAuthenticatorById(Global.NIMBLE_AUTHENTICATOR_ORIGIN).requestAccessToken(new INimbleIdentityAuthenticator.NimbleAuthenticatorAccessTokenCallback() { // from class: com.ea.nimble.friends.NimbleOriginFriendsServiceImpl.4 - @Override // com.ea.nimble.identity.INimbleIdentityAuthenticator.NimbleAuthenticatorAccessTokenCallback - public void AccessTokenCallback(INimbleIdentityAuthenticator iNimbleIdentityAuthenticator, String str2, String str3, Error error) { - if (error != null) { - Log.Helper.LOGE(this, "Failed to refresh AccessToken - cannot process request."); - NimbleOriginFriendsServiceImpl.this.invokeUserSearchCallbackWithError(nimbleUserSearchCallback, error); - return; - } - NimbleOriginFriendsServiceImpl.this.sendSearchUserRequest(str2, str3, str, userSearchCriteria, nimbleUserSearchCallback); - } - }); - } - - private void processSendFriendInvitationRequest(final String str, final String str2, final INimbleOriginFriendsService.NimbleFriendInvitationCallback nimbleFriendInvitationCallback) { - if (!isNimbleComponentAvailable("com.ea.nimble.identity")) { - Log.Helper.LOGE(this, "Unable to send friend request because NimbleIdentity is not available"); - invokeFriendInvitationCallbackWithCode(nimbleFriendInvitationCallback, NimbleFriendsError.Code.NIMBLE_FRIENDS_IDENTITY_NOT_AVAILABLE, "Unable to send friend request because NimbleIdentity is not available"); - return; - } - INimbleIdentity iNimbleIdentity = (INimbleIdentity) Base.getComponent("com.ea.nimble.identity"); - NimbleIdentityPidInfo pidInfo = iNimbleIdentity.getAuthenticatorById(Global.NIMBLE_AUTHENTICATOR_ORIGIN).getPidInfo(); - String str3 = null; - if (pidInfo != null) { - str3 = pidInfo.getPid(); - } - if (str3 == null || str3.length() <= 0) { - invokeFriendInvitationCallbackWithCode(nimbleFriendInvitationCallback, NimbleFriendsError.Code.NIMBLE_FRIENDS_REFRESH_AUTHENTICATOR_NOT_LOGGED_IN, "Origin PID for the current user is not available."); - } else { - String finalStr = str3; - iNimbleIdentity.getAuthenticatorById(Global.NIMBLE_AUTHENTICATOR_ORIGIN).requestAccessToken(new INimbleIdentityAuthenticator.NimbleAuthenticatorAccessTokenCallback() { // from class: com.ea.nimble.friends.NimbleOriginFriendsServiceImpl.1 - @Override // com.ea.nimble.identity.INimbleIdentityAuthenticator.NimbleAuthenticatorAccessTokenCallback - public void AccessTokenCallback(INimbleIdentityAuthenticator iNimbleIdentityAuthenticator, String str4, String str5, Error error) { - if (error != null) { - Log.Helper.LOGE(this, "Failed to refresh AccessToken - cannot send friend invitation request."); - NimbleOriginFriendsServiceImpl.this.invokeFriendInvitationCallbackWithError(nimbleFriendInvitationCallback, error); - return; - } - NimbleOriginFriendsServiceImpl.this.sendFriendInvitationRequest(finalStr, str4, str, str2, nimbleFriendInvitationCallback); - } - }); - } - } - - /* JADX INFO: Access modifiers changed from: private */ - public void sendFriendInvitationRequest(String str, String str2, String str3, String str4, final INimbleOriginFriendsService.NimbleFriendInvitationCallback nimbleFriendInvitationCallback) { - try { - HttpRequest makeFriendInvitationRequest = makeFriendInvitationRequest(str, str2, str3, str4, nimbleFriendInvitationCallback); - if (makeFriendInvitationRequest == null) { - Log.Helper.LOGE(this, "Failed to create HTTP Request for sending friend invitation"); - invokeFriendInvitationCallbackWithCode(nimbleFriendInvitationCallback, NimbleFriendsError.Code.NIMBLE_FRIENDS_FAILED_TO_CREATE_GOS_REQUEST, "Failed to create HTTP Request for sending friend invitation"); - return; - } - Network.getComponent().sendRequest(makeFriendInvitationRequest, new NetworkConnectionCallback() { // from class: com.ea.nimble.friends.NimbleOriginFriendsServiceImpl.5 - @Override // com.ea.nimble.NetworkConnectionCallback - public void callback(NetworkConnectionHandle networkConnectionHandle) { - try { - if (networkConnectionHandle.getResponse().getStatusCode() == 204) { - NimbleOriginFriendsServiceImpl.this.invokeFriendInvitationCallbackWithSuccess(nimbleFriendInvitationCallback); - return; - } - Log.Helper.LOGD(this, "Server responded with an error for send friend invitation request"); - NimbleOriginFriendsServiceImpl.this.invokeFriendInvitationCallbackWithCode(nimbleFriendInvitationCallback, NimbleFriendsError.Code.NIMBLE_FRIENDS_SERVER_RETURNED_ERROR, "Server responded with an error for send friend invitation request"); - } catch (Exception e) { - Log.Helper.LOGE(this, e.getMessage()); - NimbleOriginFriendsServiceImpl.this.invokeFriendInvitationCallbackWithCode(nimbleFriendInvitationCallback, NimbleFriendsError.Code.NIMBLE_FRIENDS_ORIGIN_SERVICES_SERVER_RESPONSE_ERROR, e.getMessage()); - } - } - }); - } catch (Exception e) { - Log.Helper.LOGE(this, e.getMessage()); - invokeFriendInvitationCallbackWithCode(nimbleFriendInvitationCallback, NimbleFriendsError.Code.NIMBLE_FRIENDS_ORIGIN_SERVICES_SERVER_RESPONSE_ERROR, e.getMessage()); - } - } - - /* JADX INFO: Access modifiers changed from: private */ - public void sendGetFriendInvitationListRequest(String str, String str2, String str3, final INimbleOriginFriendsService.NimbleUserSearchCallback nimbleUserSearchCallback) { - try { - HttpRequest makeGetFriendInvitationListRequest = makeGetFriendInvitationListRequest(str, str2, str3); - if (makeGetFriendInvitationListRequest == null) { - Log.Helper.LOGE(this, "Failed to create HTTP Request for retrieving outbound friend invitation list"); - invokeUserSearchCallbackWithCode(nimbleUserSearchCallback, NimbleFriendsError.Code.NIMBLE_FRIENDS_FAILED_TO_CREATE_GOS_REQUEST, "Failed to create HTTP Request for retrieving outbound friend invitation list"); - return; - } - Network.getComponent().sendRequest(makeGetFriendInvitationListRequest, new NetworkConnectionCallback() { // from class: com.ea.nimble.friends.NimbleOriginFriendsServiceImpl.7 - @Override // com.ea.nimble.NetworkConnectionCallback - public void callback(NetworkConnectionHandle networkConnectionHandle) { - try { - ArrayList parseBodyJSONData = NimbleOriginFriendsServiceImpl.this.parseBodyJSONData(networkConnectionHandle); - if (parseBodyJSONData == null) { - Log.Helper.LOGE(this, "Error in response from GOS server. Unable to get list of invitations"); - NimbleOriginFriendsServiceImpl.this.invokeUserSearchCallbackWithCode(nimbleUserSearchCallback, NimbleFriendsError.Code.NIMBLE_FRIENDS_ORIGIN_SERVICES_SERVER_RESPONSE_ERROR, "Error in response from GOS server. Unable to get list of invitations"); - } else if (parseBodyJSONData.size() <= 0) { - Log.Helper.LOGD(this, "Server request was successful, but we did not find any pending invitations"); - NimbleOriginFriendsServiceImpl.this.invokeUserSearchCallbackWithSuccess(nimbleUserSearchCallback, parseBodyJSONData); - } else { - Log.Helper.LOGD(this, "Successful in retrieving invitation list from GOS"); - NimbleOriginFriendsServiceImpl.this.invokeUserSearchCallbackWithSuccess(nimbleUserSearchCallback, parseBodyJSONData); - } - } catch (Error e) { - Log.Helper.LOGE(this, "Error parsing response from GOS" + e.getMessage()); - NimbleOriginFriendsServiceImpl.this.invokeUserSearchCallbackWithError(nimbleUserSearchCallback, e); - } catch (Exception e2) { - Log.Helper.LOGE(this, e2.getMessage()); - NimbleOriginFriendsServiceImpl.this.invokeUserSearchCallbackWithCode(nimbleUserSearchCallback, NimbleFriendsError.Code.NIMBLE_FRIENDS_ORIGIN_SERVICES_SERVER_RESPONSE_ERROR, e2.getMessage()); - } - } - }); - } catch (Exception e) { - Log.Helper.LOGE(this, e.getMessage()); - invokeUserSearchCallbackWithCode(nimbleUserSearchCallback, NimbleFriendsError.Code.NIMBLE_FRIENDS_ORIGIN_SERVICES_SERVER_RESPONSE_ERROR, e.getMessage()); - } - } - - /* JADX INFO: Access modifiers changed from: private */ - public void sendRespondToFriendInvitationRequest(boolean z, String str, String str2, String str3, final INimbleOriginFriendsService.NimbleFriendInvitationCallback nimbleFriendInvitationCallback) { - try { - HttpRequest makeRespondToFriendInvitationRequest = makeRespondToFriendInvitationRequest(z, str, str2, str3); - if (makeRespondToFriendInvitationRequest == null) { - Log.Helper.LOGE(this, "Failed to create HTTP Request for respoding to friend invitation"); - invokeFriendInvitationCallbackWithCode(nimbleFriendInvitationCallback, NimbleFriendsError.Code.NIMBLE_FRIENDS_FAILED_TO_CREATE_GOS_REQUEST, "Failed to create HTTP Request for respoding to friend invitation"); - return; - } - Network.getComponent().sendRequest(makeRespondToFriendInvitationRequest, new NetworkConnectionCallback() { // from class: com.ea.nimble.friends.NimbleOriginFriendsServiceImpl.6 - @Override // com.ea.nimble.NetworkConnectionCallback - public void callback(NetworkConnectionHandle networkConnectionHandle) { - try { - if (networkConnectionHandle.getResponse().getStatusCode() == 204) { - NimbleOriginFriendsServiceImpl.this.invokeFriendInvitationCallbackWithSuccess(nimbleFriendInvitationCallback); - return; - } - Log.Helper.LOGD(this, "Error processing the respond to friend invitation request"); - NimbleOriginFriendsServiceImpl.this.invokeFriendInvitationCallbackWithCode(nimbleFriendInvitationCallback, NimbleFriendsError.Code.NIMBLE_FRIENDS_SERVER_RETURNED_ERROR, "Error processing the respond to friend invitation request"); - } catch (Exception e) { - Log.Helper.LOGE(this, e.getMessage()); - NimbleOriginFriendsServiceImpl.this.invokeFriendInvitationCallbackWithCode(nimbleFriendInvitationCallback, NimbleFriendsError.Code.NIMBLE_FRIENDS_ORIGIN_SERVICES_SERVER_RESPONSE_ERROR, e.getMessage()); - } - } - }); - } catch (Exception e) { - Log.Helper.LOGE(this, e.getMessage()); - invokeFriendInvitationCallbackWithCode(nimbleFriendInvitationCallback, NimbleFriendsError.Code.NIMBLE_FRIENDS_ORIGIN_SERVICES_SERVER_RESPONSE_ERROR, e.getMessage()); - } - } - - /* JADX INFO: Access modifiers changed from: private */ - public void sendSearchUserRequest(String str, String str2, String str3, final UserSearchCriteria userSearchCriteria, final INimbleOriginFriendsService.NimbleUserSearchCallback nimbleUserSearchCallback) { - try { - HttpRequest makeSearchUserRequest = makeSearchUserRequest(str, str2, str3, userSearchCriteria); - if (makeSearchUserRequest == null) { - Log.Helper.LOGE(this, "Failed to create HTTP Request for user search"); - invokeUserSearchCallbackWithCode(nimbleUserSearchCallback, NimbleFriendsError.Code.NIMBLE_FRIENDS_FAILED_TO_CREATE_GOS_REQUEST, "Failed to create HTTP Request for user search"); - return; - } - Network.getComponent().sendRequest(makeSearchUserRequest, new NetworkConnectionCallback() { // from class: com.ea.nimble.friends.NimbleOriginFriendsServiceImpl.8 - @Override // com.ea.nimble.NetworkConnectionCallback - public void callback(NetworkConnectionHandle networkConnectionHandle) { - try { - ArrayList parseUserSearchByEmailResponse = userSearchCriteria == UserSearchCriteria.EMAIL ? NimbleOriginFriendsServiceImpl.this.parseUserSearchByEmailResponse(networkConnectionHandle) : NimbleOriginFriendsServiceImpl.this.parseUserSearchByDisplayNameResponse(networkConnectionHandle); - if (parseUserSearchByEmailResponse == null) { - Log.Helper.LOGE(this, "There was an error processing your user search request"); - NimbleOriginFriendsServiceImpl.this.invokeUserSearchCallbackWithCode(nimbleUserSearchCallback, NimbleFriendsError.Code.NIMBLE_FRIENDS_ORIGIN_SERVICES_SERVER_RESPONSE_ERROR, "There was an error processing your user search request"); - } else if (parseUserSearchByEmailResponse.size() <= 0) { - Log.Helper.LOGD(this, "No users found for your search criteria. Please try again with a different criteria."); - NimbleOriginFriendsServiceImpl.this.invokeUserSearchCallbackWithSuccess(nimbleUserSearchCallback, parseUserSearchByEmailResponse); - } else { - Log.Helper.LOGD(this, "Found users with matching email or display name prefix"); - NimbleOriginFriendsServiceImpl.this.invokeUserSearchCallbackWithSuccess(nimbleUserSearchCallback, parseUserSearchByEmailResponse); - } - } catch (Error e) { - Log.Helper.LOGE(this, "Error parsing response for user search by email or displayName request" + e.getMessage()); - NimbleOriginFriendsServiceImpl.this.invokeUserSearchCallbackWithError(nimbleUserSearchCallback, e); - } catch (Exception e2) { - String str4 = "Error parsing response for user search by email or displayName request" + e2.getMessage(); - Log.Helper.LOGE(this, str4); - NimbleOriginFriendsServiceImpl.this.invokeUserSearchCallbackWithCode(nimbleUserSearchCallback, NimbleFriendsError.Code.NIMBLE_FRIENDS_ORIGIN_SERVICES_SERVER_RESPONSE_ERROR, str4); - } - } - }); - } catch (Exception e) { - String str4 = "Error parsing response for user search by email or displayName request" + e.getMessage(); - Log.Helper.LOGE(this, str4); - invokeUserSearchCallbackWithCode(nimbleUserSearchCallback, NimbleFriendsError.Code.NIMBLE_FRIENDS_ORIGIN_SERVICES_SERVER_RESPONSE_ERROR, str4); - } - } - - @Override // com.ea.nimble.friends.INimbleOriginFriendsService - public void acceptFriendInvitation(String str, INimbleOriginFriendsService.NimbleFriendInvitationCallback nimbleFriendInvitationCallback) { - if (nimbleFriendInvitationCallback == null) { - Log.Helper.LOGE(this, "Cannot process acceptFriendInvitation request because callback is null"); - return; - } - Log.Helper.LOGD(this, "Request: acceptFriendInvitation"); - processRespondToFriendInvitationRequest(true, str, nimbleFriendInvitationCallback); - } - - @Override // com.ea.nimble.Component - public void cleanup() { - Log.Helper.LOGV(this, "Component cleanup"); - } - - @Override // com.ea.nimble.friends.INimbleOriginFriendsService - public void declineFriendInvitation(String str, INimbleOriginFriendsService.NimbleFriendInvitationCallback nimbleFriendInvitationCallback) { - if (nimbleFriendInvitationCallback == null) { - Log.Helper.LOGE(this, "Cannot process declineFriendInvitation request because callback is null"); - return; - } - Log.Helper.LOGD(this, "Request: declineFriendInvitation"); - processRespondToFriendInvitationRequest(false, str, nimbleFriendInvitationCallback); - } - - @Override // com.ea.nimble.Component - public String getComponentId() { - return NimbleOriginFriendsService.NIMBLE_COMPONENT_ID_FRIENDS_ORIGIN; - } - - @Override // com.ea.nimble.LogSource - public String getLogSourceTitle() { - return "NimbleOriginFriendsService"; - } - - @Override // com.ea.nimble.friends.INimbleOriginFriendsService - public void listFriendInvitationsReceived(INimbleOriginFriendsService.NimbleUserSearchCallback nimbleUserSearchCallback) { - if (nimbleUserSearchCallback == null) { - Log.Helper.LOGE(this, "Cannot process listFriendInvitationReceived request because callback is null"); - return; - } - Log.Helper.LOGD(this, "Request: listFriendInvitationReceived"); - processInivtationListRequest(GET_RECEIVED_INVITATION_LIST_URI, nimbleUserSearchCallback); - } - - @Override // com.ea.nimble.friends.INimbleOriginFriendsService - public void listFriendInvitationsSent(INimbleOriginFriendsService.NimbleUserSearchCallback nimbleUserSearchCallback) { - if (nimbleUserSearchCallback == null) { - Log.Helper.LOGE(this, "Cannot process listFriendInvitationSent request because callback is null"); - return; - } - Log.Helper.LOGD(this, "Request: listFriendInvitationSent"); - processInivtationListRequest(GET_SENT_INVITATION_LIST_URI, nimbleUserSearchCallback); - } - - @Override // com.ea.nimble.Component - public void restore() { - Log.Helper.LOGV(this, "Component restore"); - } - - @Override // com.ea.nimble.Component - public void resume() { - Log.Helper.LOGV(this, "Component resume"); - } - - @Override // com.ea.nimble.friends.INimbleOriginFriendsService - public void searchUserByDisplayName(String str, INimbleOriginFriendsService.NimbleUserSearchCallback nimbleUserSearchCallback) { - if (nimbleUserSearchCallback == null) { - Log.Helper.LOGE(this, "Cannot process searchUserByDisplayName request because callback is null"); - return; - } - Log.Helper.LOGD(this, String.format("searchUserByDisplayName API called with namePrefix = %s", str)); - processSearchUserRequest(str, UserSearchCriteria.DISPLAY_NAME, nimbleUserSearchCallback); - } - - @Override // com.ea.nimble.friends.INimbleOriginFriendsService - public void searchUserByEmail(String str, INimbleOriginFriendsService.NimbleUserSearchCallback nimbleUserSearchCallback) { - if (nimbleUserSearchCallback == null) { - Log.Helper.LOGE(this, "Cannot process searchUserByEmail request because callback is null"); - return; - } - Log.Helper.LOGD(this, String.format("searchUserByEmail API called with email = %s", str)); - processSearchUserRequest(str, UserSearchCriteria.EMAIL, nimbleUserSearchCallback); - } - - @Override // com.ea.nimble.friends.INimbleOriginFriendsService - public void sendFriendInvitation(String str, String str2, INimbleOriginFriendsService.NimbleFriendInvitationCallback nimbleFriendInvitationCallback) { - if (nimbleFriendInvitationCallback == null) { - Log.Helper.LOGE(this, "Cannot process sendFriendInvitation request because callback is null"); - return; - } - Log.Helper.LOGD(this, "Request: sendFriendInvitation"); - processSendFriendInvitationRequest(str, str2, nimbleFriendInvitationCallback); - } - - /* JADX WARN: Code restructure failed: missing block: B:16:0x0052, code lost: - if (r9.length() <= 0) goto L_0x0055; - */ - /* JADX WARN: Code restructure failed: missing block: B:21:0x0063, code lost: - if (r10.length() <= 0) goto L_0x0066; - */ - @Override // com.ea.nimble.friends.INimbleOriginFriendsService - /* - Code decompiled incorrectly, please refer to instructions dump. - To view partially-correct code enable 'Show inconsistent code' option in preferences - */ - public void sendInvitationOverEmail(java.util.ArrayList r8, java.lang.String r9, java.lang.String r10, com.ea.nimble.friends.INimbleOriginFriendsService.NimbleFriendInvitationCallback r11) { - /* - r7 = this; - r0 = r8 - if (r0 == 0) goto L_0x000b - r0 = r8 - int r0 = r0.size() - if (r0 > 0) goto L_0x0031 - L_0x000b: - r0 = r7 - java.lang.String r1 = "Target user emails is null or empty. Cannot send email invite." - r2 = 0 - java.lang.Object[] r2 = new java.lang.Object[r2] - com.ea.nimble.Log.Helper.LOGE(r0, r1, r2) - r0 = r11 - if (r0 == 0) goto L_0x0030 - r0 = r11 - r1 = 0 - com.ea.nimble.friends.NimbleFriendsError r2 = new com.ea.nimble.friends.NimbleFriendsError - r3 = r2 - com.ea.nimble.friends.NimbleFriendsError$Code r4 = com.ea.nimble.friends.NimbleFriendsError.Code.NIMBLE_FRIENDS_NO_TARGETS_PROVIDED - java.lang.String r5 = "Target user emails is null or empty. Cannot send email invite." - r3.(r4, r5) - r0.onCallback(r1, r2) - L_0x0030: - return - L_0x0031: - r0 = 0 - r12 = r0 - r0 = r8 - if (r0 == 0) goto L_0x0048 - r0 = r8 - r1 = r8 - int r1 = r1.size() - java.lang.String[] r1 = new java.lang.String[r1] - java.lang.Object[] r0 = r0.toArray(r1) - java.lang.String[] r0 = (java.lang.String[]) r0 - r12 = r0 - L_0x0048: - r0 = r9 - if (r0 == 0) goto L_0x0055 - r0 = r9 - r8 = r0 - r0 = r9 - int r0 = r0.length() - if (r0 > 0) goto L_0x0059 - L_0x0055: - java.lang.String r0 = "Please accept my friend invitation" - r8 = r0 - L_0x0059: - r0 = r10 - if (r0 == 0) goto L_0x0066 - r0 = r10 - r9 = r0 - r0 = r10 - int r0 = r0.length() - if (r0 > 0) goto L_0x006a - L_0x0066: - java.lang.String r0 = "Hi, I'll appreciate if you can accept my friend invitation." - r9 = r0 - L_0x006a: - android.content.Intent r0 = new android.content.Intent - r1 = r0 - java.lang.String r2 = "android.intent.action.SEND" - r1.(r2) - r10 = r0 - r0 = r10 - java.lang.String r1 = "message/rfc822" - android.content.Intent r0 = r0.setType(r1) - r0 = r10 - java.lang.String r1 = "android.intent.extra.EMAIL" - r2 = r12 - android.content.Intent r0 = r0.putExtra(r1, r2) - r0 = r10 - java.lang.String r1 = "android.intent.extra.SUBJECT" - r2 = r8 - android.content.Intent r0 = r0.putExtra(r1, r2) - r0 = r10 - java.lang.String r1 = "android.intent.extra.TEXT" - r2 = r9 - android.content.Intent r0 = r0.putExtra(r1, r2) - android.app.Activity r0 = com.ea.nimble.ApplicationEnvironment.getCurrentActivity() // Catch: Exception -> 0x00b8 - r1 = r10 - java.lang.String r2 = "Send mail using:" - android.content.Intent r1 = android.content.Intent.createChooser(r1, r2) // Catch: Exception -> 0x00b8 - int r2 = com.ea.nimble.friends.NimbleOriginFriendsServiceImpl.EMAIL_REQUEST_CODE // Catch: Exception -> 0x00b8 - r0.startActivityForResult(r1, r2) // Catch: Exception -> 0x00b8 - L_0x00a9: - r0 = r11 - if (r0 == 0) goto L_0x0030 - r0 = r11 - r1 = 1 - r2 = 0 - r0.onCallback(r1, r2) - return - L_0x00b8: - r8 = move-exception - r0 = r7 - java.lang.String r1 = "Can not send email on this device" - r2 = 0 - java.lang.Object[] r2 = new java.lang.Object[r2] - com.ea.nimble.Log.Helper.LOGE(r0, r1, r2) - r0 = r11 - if (r0 == 0) goto L_0x00a9 - r0 = r11 - r1 = 0 - com.ea.nimble.friends.NimbleFriendsError r2 = new com.ea.nimble.friends.NimbleFriendsError - r3 = r2 - com.ea.nimble.friends.NimbleFriendsError$Code r4 = com.ea.nimble.friends.NimbleFriendsError.Code.NIMBLE_FRIENDS_EMAIL_NOT_AVAILABLE - java.lang.String r5 = "Email is not available on this device" - r3.(r4, r5) - r0.onCallback(r1, r2) - return - */ - throw new UnsupportedOperationException("Method not decompiled: com.ea.nimble.friends.NimbleOriginFriendsServiceImpl.sendInvitationOverEmail(java.util.ArrayList, java.lang.String, java.lang.String, com.ea.nimble.friends.INimbleOriginFriendsService$NimbleFriendInvitationCallback):void"); - } - - /* JADX WARN: Code restructure failed: missing block: B:17:0x0081, code lost: - if (r9.length() <= 0) goto L_0x0084; - */ - @Override // com.ea.nimble.friends.INimbleOriginFriendsService - /* - Code decompiled incorrectly, please refer to instructions dump. - To view partially-correct code enable 'Show inconsistent code' option in preferences - */ - public void sendInvitationOverSMS(java.util.ArrayList r8, java.lang.String r9, com.ea.nimble.friends.INimbleOriginFriendsService.NimbleFriendInvitationCallback r10) { - /* - r7 = this; - r0 = r8 - if (r0 == 0) goto L_0x000b - r0 = r8 - int r0 = r0.size() - if (r0 > 0) goto L_0x002f - L_0x000b: - r0 = r7 - java.lang.String r1 = "Target phone numbers is null or empty. Cannot send SMS invite." - r2 = 0 - java.lang.Object[] r2 = new java.lang.Object[r2] - com.ea.nimble.Log.Helper.LOGE(r0, r1, r2) - r0 = r10 - if (r0 == 0) goto L_0x002e - r0 = r10 - r1 = 0 - com.ea.nimble.friends.NimbleFriendsError r2 = new com.ea.nimble.friends.NimbleFriendsError - r3 = r2 - com.ea.nimble.friends.NimbleFriendsError$Code r4 = com.ea.nimble.friends.NimbleFriendsError.Code.NIMBLE_FRIENDS_NO_TARGETS_PROVIDED - java.lang.String r5 = "Target phone numbers is null or empty. Cannot send SMS invite." - r3.(r4, r5) - r0.onCallback(r1, r2) - L_0x002e: - return - L_0x002f: - java.lang.StringBuilder r0 = new java.lang.StringBuilder - r1 = r0 - r1.() - r11 = r0 - r0 = r11 - java.lang.String r1 = "smsto:" - java.lang.StringBuilder r0 = r0.append(r1) - r0 = r8 - java.util.Iterator r0 = r0.iterator() - r8 = r0 - L_0x0046: - r0 = r8 - boolean r0 = r0.hasNext() - if (r0 == 0) goto L_0x006a - r0 = r11 - r1 = r8 - java.lang.Object r1 = r1.next() - java.lang.String r1 = (java.lang.String) r1 - java.lang.StringBuilder r0 = r0.append(r1) - r0 = r11 - java.lang.String r1 = ";" - java.lang.StringBuilder r0 = r0.append(r1) - goto L_0x0046 - L_0x006a: - r0 = r11 - r1 = r11 - int r1 = r1.length() - r2 = 1 - int r1 = r1 - r2 - java.lang.StringBuilder r0 = r0.deleteCharAt(r1) - r0 = r9 - if (r0 == 0) goto L_0x0084 - r0 = r9 - r8 = r0 - r0 = r9 - int r0 = r0.length() - if (r0 > 0) goto L_0x0088 - L_0x0084: - java.lang.String r0 = "Hi, I'll appreciate if you can accept my friend invitation." - r8 = r0 - L_0x0088: - android.content.Intent r0 = new android.content.Intent - r1 = r0 - java.lang.String r2 = "android.intent.action.SENDTO" - r3 = r11 - java.lang.String r3 = r3.toString() - android.net.Uri r3 = android.net.Uri.parse(r3) - r1.(r2, r3) - r9 = r0 - r0 = r9 - java.lang.String r1 = "sms_body" - r2 = r8 - android.content.Intent r0 = r0.putExtra(r1, r2) - android.app.Activity r0 = com.ea.nimble.ApplicationEnvironment.getCurrentActivity() // Catch: Exception -> 0x00c1 - r1 = r9 - java.lang.String r2 = "Send sms using:" - android.content.Intent r1 = android.content.Intent.createChooser(r1, r2) // Catch: Exception -> 0x00c1 - int r2 = com.ea.nimble.friends.NimbleOriginFriendsServiceImpl.SMS_REQUEST_CODE // Catch: Exception -> 0x00c1 - r0.startActivityForResult(r1, r2) // Catch: Exception -> 0x00c1 - L_0x00b4: - r0 = r10 - if (r0 == 0) goto L_0x002e - r0 = r10 - r1 = 1 - r2 = 0 - r0.onCallback(r1, r2) - return - L_0x00c1: - r8 = move-exception - r0 = r7 - java.lang.String r1 = "Can not send sms on this device" - r2 = 0 - java.lang.Object[] r2 = new java.lang.Object[r2] - com.ea.nimble.Log.Helper.LOGE(r0, r1, r2) - r0 = r10 - if (r0 == 0) goto L_0x00b4 - r0 = r10 - r1 = 0 - com.ea.nimble.friends.NimbleFriendsError r2 = new com.ea.nimble.friends.NimbleFriendsError - r3 = r2 - com.ea.nimble.friends.NimbleFriendsError$Code r4 = com.ea.nimble.friends.NimbleFriendsError.Code.NIMBLE_FRIENDS_SMS_NOT_AVAILABLE - java.lang.String r5 = "Sms is not available on this device" - r3.(r4, r5) - r0.onCallback(r1, r2) - return - */ - throw new UnsupportedOperationException("Method not decompiled: com.ea.nimble.friends.NimbleOriginFriendsServiceImpl.sendInvitationOverSMS(java.util.ArrayList, java.lang.String, com.ea.nimble.friends.INimbleOriginFriendsService$NimbleFriendInvitationCallback):void"); - } - - @Override // com.ea.nimble.Component - public void setup() { - Log.Helper.LOGD(this, "Component setup"); - } - - @Override // com.ea.nimble.Component - public void suspend() { - Log.Helper.LOGV(this, "Component suspend"); - } - - /* JADX INFO: Access modifiers changed from: protected */ - @Override // com.ea.nimble.Component - public void teardown() { - Log.Helper.LOGV(this, "Component teardown"); - } -} diff --git a/app/src/main/java/com/ea/nimble/friends/NimbleUser.java b/app/src/main/java/com/ea/nimble/friends/NimbleUser.java deleted file mode 100644 index 3bc8cd2..0000000 --- a/app/src/main/java/com/ea/nimble/friends/NimbleUser.java +++ /dev/null @@ -1,233 +0,0 @@ -package com.ea.nimble.friends; - -import com.ea.nimble.Global; -import java.text.SimpleDateFormat; -import java.util.Date; -import java.util.HashMap; -import java.util.Locale; -import java.util.Map; -import java.util.TimeZone; - -/* loaded from: stdlib.jar:com/ea/nimble/friends/NimbleUser.class */ -public class NimbleUser { - protected boolean addedToAllFriends; - protected String authenticatorId; - protected String displayName; - protected Map extraInfo; - protected String friendType; - protected String imageUrl; - protected String personaId; - protected String pid; - protected PlayedCurrentGameFlag playedCurrentGame; - protected Date refreshTimestamp; - protected String userId; - - /* loaded from: stdlib.jar:com/ea/nimble/friends/NimbleUser$PlayedCurrentGameFlag.class */ - public enum PlayedCurrentGameFlag { - NOT_AVAILABLE, - PLAYED, - NOT_PLAYED - } - - public NimbleUser() { - this.playedCurrentGame = PlayedCurrentGameFlag.NOT_AVAILABLE; - this.addedToAllFriends = false; - } - - public NimbleUser(NimbleUser nimbleUser) { - this.playedCurrentGame = PlayedCurrentGameFlag.NOT_AVAILABLE; - this.addedToAllFriends = false; - this.displayName = nimbleUser.getDisplayName(); - this.authenticatorId = nimbleUser.getAuthenticatorId(); - this.userId = nimbleUser.getUserId(); - this.pid = nimbleUser.getPid(); - this.personaId = nimbleUser.getPersonaId(); - this.playedCurrentGame = nimbleUser.getPlayedCurrentGame(); - this.imageUrl = nimbleUser.getImageUrl(); - this.refreshTimestamp = nimbleUser.getRefreshTimestamp(); - this.friendType = nimbleUser.getFriendType(); - this.addedToAllFriends = nimbleUser.addedToAllFriends; - if (nimbleUser.getExtraInfo() == null) { - this.extraInfo = null; - } else { - this.extraInfo = new HashMap(nimbleUser.getExtraInfo()); - } - } - - public String getAuthenticatorId() { - return this.authenticatorId; - } - - public String getDisplayName() { - return this.displayName; - } - - public Map getExtraInfo() { - return this.extraInfo; - } - - public String getFriendType() { - return this.friendType; - } - - public String getImageUrl() { - return (this.authenticatorId == null || !this.authenticatorId.equals(Global.NIMBLE_AUTHENTICATOR_FACEBOOK) || this.userId == null || this.userId.length() <= 0) ? this.imageUrl : String.format("https://graph.facebook.com/%s/picture?type=normal", this.userId); - } - - public String getPersonaId() { - return this.personaId; - } - - public String getPid() { - return this.pid; - } - - public PlayedCurrentGameFlag getPlayedCurrentGame() { - return this.playedCurrentGame; - } - - public Date getRefreshTimestamp() { - return this.refreshTimestamp; - } - - public String getUserId() { - return this.userId; - } - - /* JADX INFO: Access modifiers changed from: package-private */ - public boolean isUserUpdated(NimbleUser nimbleUser) { - if (nimbleUser == null) { - return false; - } - boolean z = false; - if (nimbleUser.getDisplayName() != null) { - z = false; - if (nimbleUser.getDisplayName() != "") { - if (getDisplayName() == null) { - z = true; - } else { - z = false; - if (!nimbleUser.getDisplayName().equals(getDisplayName())) { - z = true; - } - } - } - } - boolean z2 = z; - if (nimbleUser.getPid() != null) { - z2 = z; - if (nimbleUser.getPid() != "") { - if (getPid() == null) { - z2 = true; - } else { - z2 = z; - if (!nimbleUser.getPid().equals(getPid())) { - z2 = true; - } - } - } - } - boolean z3 = z2; - if (nimbleUser.getPersonaId() != null) { - z3 = z2; - if (nimbleUser.getPersonaId() != "") { - if (getPersonaId() == null) { - z3 = true; - } else { - z3 = z2; - if (!nimbleUser.getPersonaId().equals(getPersonaId())) { - z3 = true; - } - } - } - } - boolean z4 = z3; - if (nimbleUser.getImageUrl() != null) { - z4 = z3; - if (nimbleUser.getImageUrl() != "") { - if (getImageUrl() == null) { - z4 = true; - } else { - z4 = z3; - if (!nimbleUser.getImageUrl().equals(getImageUrl())) { - z4 = true; - } - } - } - } - boolean z5 = z4; - if (nimbleUser.getPlayedCurrentGame() != null) { - if (getPlayedCurrentGame() == null) { - z5 = true; - } else { - z5 = z4; - if (!nimbleUser.getPlayedCurrentGame().equals(getPlayedCurrentGame())) { - z5 = true; - } - } - } - return z5; - } - - /* JADX INFO: Access modifiers changed from: protected */ - public void setAuthenticatorId(String str) { - this.authenticatorId = str; - } - - /* JADX INFO: Access modifiers changed from: protected */ - public void setDisplayName(String str) { - this.displayName = str; - } - - protected void setExtraInfo(Map map) { - this.extraInfo = map; - } - - /* JADX INFO: Access modifiers changed from: protected */ - public void setFriendType(String str) { - this.friendType = str; - } - - /* JADX INFO: Access modifiers changed from: protected */ - public void setImageUrl(String str) { - this.imageUrl = str; - } - - /* JADX INFO: Access modifiers changed from: protected */ - public void setPersonaId(String str) { - this.personaId = str; - } - - /* JADX INFO: Access modifiers changed from: protected */ - public void setPid(String str) { - this.pid = str; - } - - protected void setPlayedCurrentGame(PlayedCurrentGameFlag playedCurrentGameFlag) { - this.playedCurrentGame = playedCurrentGameFlag; - } - - /* JADX INFO: Access modifiers changed from: protected */ - public void setRefreshTimestamp(Date date) { - this.refreshTimestamp = date; - } - - /* JADX INFO: Access modifiers changed from: protected */ - public void setUserId(String str) { - this.userId = str; - } - - public String toString() { - String str; - String str2 = this.playedCurrentGame == PlayedCurrentGameFlag.PLAYED ? "YES" : this.playedCurrentGame == PlayedCurrentGameFlag.NOT_PLAYED ? "NO" : this.playedCurrentGame == PlayedCurrentGameFlag.NOT_AVAILABLE ? "NOT AVAILABLE" : "UNKNOWN"; - try { - SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS", Locale.US); - simpleDateFormat.setTimeZone(TimeZone.getTimeZone("America/Los_Angeles")); - str = simpleDateFormat.format(this.refreshTimestamp); - } catch (Exception e) { - str = ""; - } - new String(); - return ("displayName(" + getDisplayName() + ") friendId(" + getUserId() + ") pid(" + this.pid + ") personaId(" + getPersonaId() + ") imageUrl(" + getImageUrl() + ") authenticatorId(" + getAuthenticatorId() + ") playedCurrentGame(" + str2 + ")refreshTimestamp(" + str + ")") + "ExtraInfo(" + (getExtraInfo() == null ? "" : getExtraInfo().toString()) + ") \n"; - } -} diff --git a/app/src/main/java/com/ea/nimble/friends/UserInfoFromIdentity.java b/app/src/main/java/com/ea/nimble/friends/UserInfoFromIdentity.java deleted file mode 100644 index 480a033..0000000 --- a/app/src/main/java/com/ea/nimble/friends/UserInfoFromIdentity.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.ea.nimble.friends; - -import org.json.JSONObject; - -/* loaded from: stdlib.jar:com/ea/nimble/friends/UserInfoFromIdentity.class */ -class UserInfoFromIdentity { - private String externalRefValue; - private String personaId; - private String pidId; - - public UserInfoFromIdentity(JSONObject jSONObject) { - this.pidId = jSONObject.optString("pidId"); - this.personaId = jSONObject.optString("personaId"); - this.externalRefValue = jSONObject.optString("externalRefValue"); - } - - public String getExternalRefValue() { - return this.externalRefValue; - } - - public String getPersonaId() { - return this.personaId; - } - - public String getPidId() { - return this.pidId; - } -} diff --git a/app/src/main/java/com/ea/nimble/identity/AuthenticatorAnonymous.java b/app/src/main/java/com/ea/nimble/identity/AuthenticatorAnonymous.java deleted file mode 100644 index d79808e..0000000 --- a/app/src/main/java/com/ea/nimble/identity/AuthenticatorAnonymous.java +++ /dev/null @@ -1,239 +0,0 @@ -package com.ea.nimble.identity; - -import com.ea.nimble.Base; -import com.ea.nimble.Error; -import com.ea.nimble.Global; -import com.ea.nimble.Log; -import com.ea.nimble.Network; -import com.ea.nimble.NetworkConnectionCallback; -import com.ea.nimble.NetworkConnectionHandle; -import com.ea.nimble.Persistence; -import com.ea.nimble.PersistenceService; -import com.ea.nimble.Timer; -import com.ea.nimble.Utility; -import com.ea.nimble.identity.INimbleIdentityAuthenticator; -import com.ea.nimble.identity.NimbleIdentityError; -import java.io.IOException; -import java.net.MalformedURLException; -import java.net.URL; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Map; - -/* loaded from: stdlib.jar:com/ea/nimble/identity/AuthenticatorAnonymous.class */ -public class AuthenticatorAnonymous extends AuthenticatorBase { - private static final String ANONYMOUS_USER_NAME = "Guest"; - private static final double INITIAL_RETRY_TIME = 1.0d; - private static final double MAX_RETRY_TIME = 300.0d; - private static final String PID_TYPE = "mobile_upid"; - private static final String URL_TEMPLATE_ANONYMOUS_LOGIN = "%s/connect/auth?mobile_login_type=mobile_game_UPID&mobile_UPIDToken=%s&client_id=%s&response_type=code&redirect_uri=nucleus:rest"; - private static final String URL_TEMPLATE_ANONYMOUS_UPIDTOKEN = "%s/connect/upidtoken?client_id=%s"; - private String m_upidToken = ""; - private double m_currentRetryTime = INITIAL_RETRY_TIME; - private Timer m_retryTimer = new Timer(new Runnable() { // from class: com.ea.nimble.identity.AuthenticatorAnonymous.1 - @Override // java.lang.Runnable - public void run() { - AuthenticatorAnonymous.this.onRetryTimerExpired(); - } - }); - - private AuthenticatorAnonymous() { - this.TAG = "AuthenticatorAnonymous"; - } - - public void exchangeUpidTokenForAuthCode() { - synchronized (this) { - URL url = null; - try { - NimbleIdentityConfig configuration = getConfiguration(); - url = new URL(String.format(URL_TEMPLATE_ANONYMOUS_LOGIN, configuration.getConnectServerUrl(), this.m_upidToken, configuration.getClientId())); - } catch (MalformedURLException e) { - } - this.m_authenticateRequest = Network.getComponent().sendGetRequest(url, new HashMap<>(), new NetworkConnectionCallback() { // from class: com.ea.nimble.identity.AuthenticatorAnonymous.3 - @Override // com.ea.nimble.NetworkConnectionCallback - public void callback(NetworkConnectionHandle networkConnectionHandle) { - try { - Map parseBodyJSONData = NimbleIdentityUtility.parseBodyJSONData(networkConnectionHandle); - String str = (String) parseBodyJSONData.get("code"); - if (!Utility.validString(str)) { - AuthenticatorAnonymous.this.closeAuthentication(new Error(Error.Code.NETWORK_INVALID_SERVER_RESPONSE, "Cannot read login OAuth code data from server response data " + parseBodyJSONData)); - return; - } - synchronized (this) { - AuthenticatorAnonymous.this.exchangeAuthCodeToToken(str); - } - } catch (Error e2) { - AuthenticatorAnonymous.this.closeAuthentication(e2); - } - } - }); - } - } - - private void getUpidToken() { - synchronized (this) { - URL url = null; - try { - NimbleIdentityConfig configuration = getConfiguration(); - url = new URL(String.format(URL_TEMPLATE_ANONYMOUS_UPIDTOKEN, configuration.getConnectServerUrl(), configuration.getClientId())); - } catch (MalformedURLException e) { - } - this.m_authenticateRequest = Network.getComponent().sendGetRequest(url, new HashMap<>(), new NetworkConnectionCallback() { // from class: com.ea.nimble.identity.AuthenticatorAnonymous.2 - @Override // com.ea.nimble.NetworkConnectionCallback - public void callback(NetworkConnectionHandle networkConnectionHandle) { - Exception error = networkConnectionHandle.getResponse().getError(); - if (error != null) { - AuthenticatorAnonymous.this.closeAuthentication(error instanceof Error ? (Error) error : new Error(Error.Code.NETWORK_CONNECTION_ERROR, "Connection error", error)); - } - String str = null; - try { - str = Utility.readStringFromStream(networkConnectionHandle.getResponse().getDataStream()); - } catch (IOException e2) { - } - if (!Utility.validString(str)) { - AuthenticatorAnonymous.this.closeAuthentication(new Error(Error.Code.NETWORK_INVALID_SERVER_RESPONSE, "Cannot read UPID token from server response")); - return; - } - synchronized (this) { - AuthenticatorAnonymous.this.m_upidToken = str; - AuthenticatorAnonymous.this.saveUpidToken(); - AuthenticatorAnonymous.this.exchangeUpidTokenForAuthCode(); - } - } - }); - } - } - - private static void initialize() { - Log.Helper.LOGVS("AuthenticatorAnonymous", "Initializing...", new Object[0]); - AuthenticatorAnonymous authenticatorAnonymous = new AuthenticatorAnonymous(); - Base.registerComponent(authenticatorAnonymous, authenticatorAnonymous.getComponentId()); - } - - private void loadUpidToken() { - Persistence persistenceForNimbleComponent = PersistenceService.getPersistenceForNimbleComponent(getComponentId(), Persistence.Storage.DOCUMENT); - if (persistenceForNimbleComponent == null) { - this.m_upidToken = null; - return; - } - this.m_upidToken = persistenceForNimbleComponent.getStringValue("UpidToken"); - if (this.m_upidToken == null) { - this.m_upidToken = persistenceForNimbleComponent.getStringValue("upid_token"); - } - } - - private void login(INimbleIdentityAuthenticator.NimbleIdentityAuthenticatorCallback nimbleIdentityAuthenticatorCallback) { - synchronized (this) { - this.m_state = INimbleIdentityAuthenticator.NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_GOING; - if (nimbleIdentityAuthenticatorCallback != null) { - this.m_authenticateCallbacks.add(nimbleIdentityAuthenticatorCallback); - } - Log.Helper.LOGDS(this.TAG, "Anonymous Login", new Object[0]); - if (Utility.validString(this.m_upidToken)) { - Log.Helper.LOGVS(this.TAG, "Found cached UPID token %s, use it for login", this.m_upidToken); - exchangeUpidTokenForAuthCode(); - } else { - Log.Helper.LOGVS(this.TAG, "Request a new User PID token", new Object[0]); - getUpidToken(); - } - } - } - - public void onRetryTimerExpired() { - Log.Helper.LOGDS(this.TAG, "Retry timer expired. Attempting login now", new Object[0]); - login(null); - } - - public void saveUpidToken() { - Persistence persistenceForNimbleComponent = PersistenceService.getPersistenceForNimbleComponent(getComponentId(), Persistence.Storage.DOCUMENT); - if (persistenceForNimbleComponent != null) { - if (!persistenceForNimbleComponent.getBackUp()) { - persistenceForNimbleComponent.setBackUp(true); - } - persistenceForNimbleComponent.setValue("UpidToken", this.m_upidToken); - persistenceForNimbleComponent.synchronize(); - } - } - - /* JADX INFO: Access modifiers changed from: package-private */ - @Override // com.ea.nimble.identity.AuthenticatorBase - public void autoLogin() { - Log.Helper.LOGIS(this.TAG, "Anonymous authenticator Autologin.", new Object[0]); - this.m_autoLoginAttempt = true; - login(null); - } - - /* JADX INFO: Access modifiers changed from: protected */ - @Override // com.ea.nimble.identity.AuthenticatorBase - public void closeAuthentication(Error error) { - if (error == null || !this.m_autoLoginAttempt) { - this.m_currentRetryTime = INITIAL_RETRY_TIME; - this.m_retryTimer.cancel(); - super.closeAuthentication(error); - return; - } - double d = this.m_currentRetryTime; - this.m_currentRetryTime = Math.min(this.m_currentRetryTime * 2.0d, 300.0d); - Log.Helper.LOGDS(this.TAG, "Auto login failed. Retrying in %.1f seconds", Double.valueOf(d)); - this.m_retryTimer.schedule(d, false); - } - - /* JADX INFO: Access modifiers changed from: protected */ - @Override // com.ea.nimble.identity.AuthenticatorBase - public void completeMigration() { - Log.Helper.LOGDS(this.TAG, "Complete migration called for Anonymous authenticator", new Object[0]); - cleanAtLogout(null); - } - - @Override // com.ea.nimble.identity.INimbleIdentityAuthenticator - public String getAuthenticatorId() { - return Global.NIMBLE_AUTHENTICATOR_ANONYMOUS; - } - - @Override // com.ea.nimble.identity.INimbleIdentityAuthenticator - public void login(NimbleIdentityLoginParams nimbleIdentityLoginParams, INimbleIdentityAuthenticator.NimbleIdentityAuthenticatorCallback nimbleIdentityAuthenticatorCallback) { - Log.Helper.LOGWS(this.TAG, "Anonymous authenticator is self-maintained, explicitly calling login on the anonymous authenticator does nothing.", new Object[0]); - if (nimbleIdentityAuthenticatorCallback != null) { - nimbleIdentityAuthenticatorCallback.onCallback(this, new NimbleIdentityError(NimbleIdentityError.NimbleIdentityErrorCode.NIMBLE_IDENTITY_ERROR_UNSUPPORTED_ACTION, "Anonymous authenticator is self-maintained, explicitly calling login on the anonymous authenticator does nothing.")); - } - } - - @Override // com.ea.nimble.identity.INimbleIdentityAuthenticator - public void logout(INimbleIdentityAuthenticator.NimbleIdentityAuthenticatorCallback nimbleIdentityAuthenticatorCallback) { - Log.Helper.LOGWS(this.TAG, "Anonymous authenticator is self-maintained, explicitly calling logout on the anonymous authenticator does nothing.", new Object[0]); - NimbleIdentityError nimbleIdentityError = new NimbleIdentityError(NimbleIdentityError.NimbleIdentityErrorCode.NIMBLE_IDENTITY_ERROR_UNSUPPORTED_ACTION, "Anonymous authenticator is self-maintained, explicitly calling logout on the anonymous authenticator does nothing."); - if (nimbleIdentityAuthenticatorCallback != null) { - nimbleIdentityAuthenticatorCallback.onCallback(null, nimbleIdentityError); - } - } - - public void logoutInternal(INimbleIdentityAuthenticator.NimbleIdentityAuthenticatorCallback nimbleIdentityAuthenticatorCallback) { - Log.Helper.LOGIS(this.TAG, "Anonymous authenticator logout internal.", new Object[0]); - if (NimbleIdentityImpl.getComponent().getLoggedInAuthenticators().size() == 1) { - Log.Helper.LOGWS(this.TAG, "Attempting to logout the anonymous authenticator but it is the only one logged in. Aborting", new Object[0]); - return; - } - cancelAuthentication(); - cleanAtLogout(nimbleIdentityAuthenticatorCallback); - } - - @Override // com.ea.nimble.identity.AuthenticatorBase, com.ea.nimble.identity.INimbleIdentityAuthenticator - public void requestIdentityForFriends(ArrayList arrayList, INimbleIdentityAuthenticator.NimbleIdentityFriendsIdentityInfoCallback nimbleIdentityFriendsIdentityInfoCallback) { - requestIdentityForFriends(PID_TYPE, arrayList, nimbleIdentityFriendsIdentityInfoCallback); - } - - @Override // com.ea.nimble.identity.AuthenticatorBase - public void restoreAuthenticator(INimbleIdentityAuthenticator.NimbleIdentityAuthenticatorCallback nimbleIdentityAuthenticatorCallback) { - this.m_userInfo.setUserName(ANONYMOUS_USER_NAME); - this.m_userInfo.setDisplayName(ANONYMOUS_USER_NAME); - loadUpidToken(); - super.restoreAuthenticator(nimbleIdentityAuthenticatorCallback); - } - - @Override // com.ea.nimble.identity.AuthenticatorBase, com.ea.nimble.Component - public void suspend() { - super.suspend(); - this.m_retryTimer.cancel(); - this.m_currentRetryTime = INITIAL_RETRY_TIME; - } -} diff --git a/app/src/main/java/com/ea/nimble/identity/AuthenticatorBase.java b/app/src/main/java/com/ea/nimble/identity/AuthenticatorBase.java deleted file mode 100644 index ea245ca..0000000 --- a/app/src/main/java/com/ea/nimble/identity/AuthenticatorBase.java +++ /dev/null @@ -1,1202 +0,0 @@ -package com.ea.nimble.identity; - -import android.content.BroadcastReceiver; -import android.content.Context; -import android.content.Intent; - -import com.ea.nimble.Base; -import com.ea.nimble.Component; -import com.ea.nimble.Error; -import com.ea.nimble.Global; -import com.ea.nimble.HttpRequest; -import com.ea.nimble.IHttpRequest; -import com.ea.nimble.Log; -import com.ea.nimble.LogSource; -import com.ea.nimble.Network; -import com.ea.nimble.NetworkConnectionCallback; -import com.ea.nimble.NetworkConnectionHandle; -import com.ea.nimble.Persistence; -import com.ea.nimble.PersistenceService; -import com.ea.nimble.Timer; -import com.ea.nimble.Utility; -import com.ea.nimble.tracking.ITracking; -import com.ea.nimble.tracking.Tracking; - -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.net.MalformedURLException; -import java.net.URL; -import java.util.ArrayList; -import java.util.Date; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import java.util.Map; - -/* loaded from: stdlib.jar:com/ea/nimble/identity/AuthenticatorBase.class */ -public abstract class AuthenticatorBase extends Component implements LogSource, INimbleIdentityAuthenticator { - private static final String AUTHORIZATION_KEY = "Authorization"; - private static final String DATA_CONTENT_TYPE_KEY = "Content-type"; - private static final String DATA_CONTENT_TYPE_VALUE = "application/x-www-form-urlencoded"; - private static final String DATA_TEMPLATE_LOGIN_WITH_OAUTH_CODE = "grant_type=authorization_code&code=%s&client_id=%s&client_secret=%s&redirect_uri=nucleus:rest"; - private static final String DATA_TEMPLATE_LOGIN_WITH_REFRESH_TOKEN = "grant_type=refresh_token&refresh_token=%s&client_id=%s&client_secret=%s&redirect_uri=nucleus:rest"; - private static final double DEFAULT_RETRY_INTERVAL = 60.0d; - private static final double EXPIRY_MARGIN_FOR_TIMER = 5.0d; - public static final String NIMBLE_IDENTITY_PERSISTENCE_TOKEN_SUFFIX = "nimble_identity_access_token"; - private static final String REQUEST_HEADER_PERSONA_INFO_EXTRA_FLAG = "X-Expand-Results"; - private static final String REQUEST_HEADER_PID_INFO_EXTRA_FLAG = "X-Include-Underage"; - private static final String REQUEST_HEADER_REFRESH_TOKEN_EXTRA_FLAG = "X-Include-RT-Time"; - private static final String REQUEST_HEADER_TRUE_VALUE = "true"; - private static final String URL_TEMPALTE_GET_IDENTITY_INFO_FOR_FRIENDS = "/proxy/identity/pids/personaextref/bulk"; - private static final String URL_TEMPLATE_GET_PERSONA_INFO = "%s/proxy/identity/pids/me/personas"; - private static final String URL_TEMPLATE_GET_PID_INFO = "%s/proxy/identity/pids/me"; - private static final String URL_TEMPLATE_LOGIN = "%s/connect/token"; - private static final String URL_TEMPLATE_LOGOUT = "%s/connect/clearsid?client_id=%s&access_token=%s"; - private static final String URL_TEMPLATE_REQUEST_SERVER_AUTHENTICATION_OAUTH_CODE = "%s/connect/auth?client_id=%s&response_type=code&access_token=%s&redirect_uri=nucleus:rest"; - protected NetworkConnectionHandle m_authenticateRequest; - protected boolean m_autoLoginAttempt; - private NetworkConnectionHandle m_personaRequest; - private ArrayList m_personas; - private NimbleIdentityPidInfo m_pidInfo; - private NetworkConnectionHandle m_pidInfoRequest; - private NimbleIdentityToken m_token; - protected INimbleIdentityAuthenticator.NimbleIdentityAuthenticationState m_state = INimbleIdentityAuthenticator.NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_NONE; - protected NimbleIdentityUserInfo m_userInfo = new NimbleIdentityUserInfo(); - protected ArrayList m_authenticateCallbacks = new ArrayList<>(); - private ArrayList m_userInfoCallbacks = new ArrayList<>(); - private ArrayList m_pidInfoCallbacks = new ArrayList<>(); - private ArrayList m_personaCallbacks = new ArrayList<>(); - private Timer m_tokenRefreshTimer = new Timer(new Runnable() { // from class: com.ea.nimble.identity.AuthenticatorBase.1 - @Override // java.lang.Runnable - public void run() { - AuthenticatorBase.this.onTokenRefreshTimer(); - } - }); - private Timer m_userProfileRefreshTimer = new Timer(new Runnable() { // from class: com.ea.nimble.identity.AuthenticatorBase.2 - @Override // java.lang.Runnable - public void run() { - AuthenticatorBase.this.onUserProfileRefreshTimer(); - } - }); - private Timer m_pidInfoRefreshTimer = new Timer(new Runnable() { // from class: com.ea.nimble.identity.AuthenticatorBase.3 - @Override // java.lang.Runnable - public void run() { - AuthenticatorBase.this.onPidInfoRefreshTimer(); - } - }); - private Timer m_personaRefreshTimer = new Timer(new Runnable() { // from class: com.ea.nimble.identity.AuthenticatorBase.4 - @Override // java.lang.Runnable - public void run() { - AuthenticatorBase.this.onPersonaRefreshTimer(); - } - }); - protected String TAG = "AuthenticatorBase"; - private BroadcastReceiver m_networkChangeReceiver = new BroadcastReceiver() { // from class: com.ea.nimble.identity.AuthenticatorBase.5 - @Override // android.content.BroadcastReceiver - public void onReceive(Context context, Intent intent) { - AuthenticatorBase.this.onNetworkChange(); - } - }; - protected BroadcastReceiver m_identityConfigChangeReceiver = new BroadcastReceiver() { // from class: com.ea.nimble.identity.AuthenticatorBase.6 - @Override // android.content.BroadcastReceiver - public void onReceive(Context context, Intent intent) { - AuthenticatorBase.this.onConfigurationChange(); - } - }; - - /* loaded from: stdlib.jar:com/ea/nimble/identity/AuthenticatorBase$INimbleIdentityInternalServiceRequestCallback.class */ - interface INimbleIdentityInternalServiceRequestCallback { - void onServiceComplete(Error error); - } - - /* JADX WARN: Type inference failed for: r0v42, types: [double] */ - /* JADX WARN: Type inference failed for: r9v1 */ - /* JADX WARN: Type inference failed for: r9v2 */ - /* JADX WARN: Type inference failed for: r9v3 */ - /* JADX WARN: Type inference failed for: r9v5 */ - /* JADX WARN: Unknown variable types count: 2 */ - /* - Code decompiled incorrectly, please refer to instructions dump. - To view partially-correct code enable 'Show inconsistent code' option in preferences - */ - public void closePersonaUpdate(com.ea.nimble.Error r8) { - /* - Method dump skipped, instructions count: 213 - To view this dump change 'Code comments level' option to 'DEBUG' - */ - throw new UnsupportedOperationException("Method not decompiled: com.ea.nimble.identity.AuthenticatorBase.closePersonaUpdate(com.ea.nimble.Error):void"); - } - - public void closePidInfoUpdate(Error error) { - ArrayList arrayList; - if (error == null) { - Log.Helper.LOGVS(this.TAG, "Updating pid information succeed!", new Object[0]); - } else { - Log.Helper.LOGES(this.TAG, "Fail to get pid information from Identity server for error %s", error); - } - synchronized (this) { - this.m_pidInfoRequest = null; - if (getConfiguration().getAutoRefresh() && this.m_state == INimbleIdentityAuthenticator.NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_SUCCESS) { - if (error == null) { - this.m_pidInfoRefreshTimer.schedule((((double) (this.m_pidInfo.getExpiryTime().getTime() - System.currentTimeMillis())) / 1000.0d) - EXPIRY_MARGIN_FOR_TIMER, false); - } else { - this.m_pidInfoRefreshTimer.schedule(60.0d, false); - } - } - arrayList = this.m_pidInfoCallbacks; - this.m_pidInfoCallbacks = new ArrayList<>(); - } - Iterator it = arrayList.iterator(); - while (it.hasNext()) { - it.next().onCallback(this, error); - } - } - - private Error environmentCheck() { - Error error; - synchronized (this) { - if (Network.getComponent().getStatus() != Network.Status.OK) { - if (this.m_state == INimbleIdentityAuthenticator.NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_SUCCESS) { - setState(INimbleIdentityAuthenticator.NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_OFFLINE); - } - error = new Error(Error.Code.NETWORK_NO_CONNECTION, "Idenitity cannot work without network."); - } else { - NimbleIdentityConfig configuration = getConfiguration(); - error = (configuration == null || !configuration.isReady()) ? new Error(Error.Code.NOT_READY, "Identity is still in initialization and not ready for operation.") : NimbleIdentityImpl.getComponent().getAuthenticationConductor() == null ? new Error(Error.Code.NOT_READY, "No authentication conductor has been set yet.") : null; - } - } - return error; - } - - private void loadPidInfo() { - Persistence persistenceForNimbleComponent = PersistenceService.getPersistenceForNimbleComponent(getComponentId(), Persistence.Storage.DOCUMENT); - if (persistenceForNimbleComponent != null) { - this.m_pidInfo = (NimbleIdentityPidInfo) persistenceForNimbleComponent.getValue("pidInfo"); - if (this.m_pidInfo != null) { - Log.Helper.LOGDS(this.TAG, "Restored existing pidInfo (pid = %s) for %s authenticator from persistence.", this.m_pidInfo.getPid(), getAuthenticatorId()); - HashMap hashMap = new HashMap(); - hashMap.put(Global.NIMBLE_IDENTITY_DICTIONARY_KEY_AUTHENTICATOR_ID, getAuthenticatorId()); - Utility.sendBroadcast(Global.NIMBLE_NOTIFICATION_IDENTITY_PID_INFO_UPDATE, hashMap); - return; - } - Log.Helper.LOGDS(this.TAG, "The previous Exception in Persistence while getting NimbleIdentityPidInfo can be safely ignored. A cached value for pidInfo does not exist or was stored in an older format. This value will instead be retrieved from the server.", new Object[0]); - } - } - - private void loadState() { - Boolean bool; - Persistence persistenceForNimbleComponent = PersistenceService.getPersistenceForNimbleComponent(getComponentId(), Persistence.Storage.DOCUMENT); - if (persistenceForNimbleComponent == null || (bool = (Boolean) persistenceForNimbleComponent.getValue("loggedIn")) == null || !bool.booleanValue()) { - this.m_state = INimbleIdentityAuthenticator.NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_NONE; - Log.Helper.LOGVS(this.TAG, "Loaded state: NONE", new Object[0]); - return; - } - this.m_state = INimbleIdentityAuthenticator.NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_OFFLINE; - Log.Helper.LOGVS(this.TAG, "Loaded state: OFFLINE", new Object[0]); - } - - private void loadToken() { - Persistence persistenceForNimbleComponent = PersistenceService.getPersistenceForNimbleComponent(getComponentId(), Persistence.Storage.DOCUMENT); - if (persistenceForNimbleComponent == null) { - this.m_token = null; - return; - } - this.m_token = (NimbleIdentityToken) persistenceForNimbleComponent.getValue("token"); - Log.Helper.LOGVS(this.TAG, "Loading token: " + this.m_token, new Object[0]); - } - - public void onConfigurationChange() { - Log.Helper.LOGVS(this.TAG, "Identity resumes after configuration changed.", new Object[0]); - resume(); - } - - public void onNetworkChange() { - if (Network.getComponent().getStatus() == Network.Status.OK) { - Log.Helper.LOGDS(this.TAG, "Identity resumes after network recovered.", new Object[0]); - resume(); - return; - } - if (this.m_state == INimbleIdentityAuthenticator.NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_GOING) { - cancelAuthentication(); - } - if (this.m_state != INimbleIdentityAuthenticator.NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_NONE) { - setState(INimbleIdentityAuthenticator.NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_OFFLINE); - } - } - - public void onPersonaRefreshTimer() { - refreshPersonas(null); - } - - public void onPidInfoRefreshTimer() { - refreshPidInfo(null); - } - - public void onTokenRefreshTimer() { - this.m_tokenRefreshTimer.cancel(); - refreshToken(); - } - - public void onTokenResponse(NetworkConnectionHandle networkConnectionHandle) { - if (this.m_state != INimbleIdentityAuthenticator.NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_OFFLINE) { - try { - Map parseBodyJSONData = NimbleIdentityUtility.parseBodyJSONData(networkConnectionHandle); - NimbleIdentityToken nimbleIdentityToken = new NimbleIdentityToken(parseBodyJSONData); - if (!Utility.validString(nimbleIdentityToken.getAccessToken()) || !Utility.validString(nimbleIdentityToken.getRefreshToken())) { - closeAuthentication(new Error(Error.Code.NETWORK_INVALID_SERVER_RESPONSE, "Fail to parse token from server response data " + parseBodyJSONData)); - return; - } - this.m_pidInfoCallbacks.add(new INimbleIdentityAuthenticator.NimbleIdentityAuthenticatorCallback() { // from class: com.ea.nimble.identity.AuthenticatorBase.18 - @Override // com.ea.nimble.identity.INimbleIdentityAuthenticator.NimbleIdentityAuthenticatorCallback - public void onCallback(INimbleIdentityAuthenticator iNimbleIdentityAuthenticator, Error error) { - AuthenticatorBase.this.closeAuthentication(error); - } - }); - synchronized (this) { - this.m_token = nimbleIdentityToken; - saveToken(); - updateUserProfile(); - updatePidInfo(); - updatePersonas(); - } - } catch (Error e) { - closeAuthentication(e); - } - } - } - - public void onUserProfileRefreshTimer() { - refreshUserProfile(null); - } - - private void prepare(INimbleIdentityAuthenticator.NimbleIdentityAuthenticatorCallback nimbleIdentityAuthenticatorCallback) { - synchronized (this) { - Error environmentCheck = environmentCheck(); - if (environmentCheck != null) { - if (nimbleIdentityAuthenticatorCallback != null) { - nimbleIdentityAuthenticatorCallback.onCallback(this, environmentCheck); - } - } else if (this.m_state == INimbleIdentityAuthenticator.NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_GOING || this.m_token == null || this.m_token.getRefreshTokenExpiryTime().before(new Date())) { - if (nimbleIdentityAuthenticatorCallback != null) { - this.m_authenticateCallbacks.add(nimbleIdentityAuthenticatorCallback); - } - if (this.m_state != INimbleIdentityAuthenticator.NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_GOING) { - autoLogin(); - } - } else if (!this.m_token.getAccessTokenExpiryTime().after(new Date())) { - if (nimbleIdentityAuthenticatorCallback != null) { - this.m_authenticateCallbacks.add(nimbleIdentityAuthenticatorCallback); - } - refreshToken(); - } else if (nimbleIdentityAuthenticatorCallback != null) { - nimbleIdentityAuthenticatorCallback.onCallback(this, null); - } - } - } - - private void refreshToken() { - ByteArrayOutputStream byteArrayOutputStream; - synchronized (this) { - Log.Helper.LOGVS(this.TAG, "Refreshing token to get access token.", new Object[0]); - if (this.m_tokenRefreshTimer.isRunning()) { - this.m_tokenRefreshTimer.cancel(); - } - setState(INimbleIdentityAuthenticator.NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_GOING); - NimbleIdentityConfig configuration = getConfiguration(); - URL url = null; - String format = String.format(DATA_TEMPLATE_LOGIN_WITH_REFRESH_TOKEN, this.m_token.getRefreshToken(), configuration.getClientId(), configuration.getClientSecret()); - try { - url = new URL(String.format(URL_TEMPLATE_LOGIN, configuration.getConnectServerUrl())); - try { - byte[] bytes = format.getBytes("UTF-8"); - byteArrayOutputStream = new ByteArrayOutputStream(bytes.length); - try { - byteArrayOutputStream.write(bytes); - } catch (IOException e) { - } - } catch (IOException e2) { - byteArrayOutputStream = null; - } - } catch (IOException e3) { - byteArrayOutputStream = null; - } - HashMap hashMap = new HashMap<>(); - hashMap.put(DATA_CONTENT_TYPE_KEY, DATA_CONTENT_TYPE_VALUE); - hashMap.put(REQUEST_HEADER_REFRESH_TOKEN_EXTRA_FLAG, REQUEST_HEADER_TRUE_VALUE); - HttpRequest httpRequest = new HttpRequest(url); - httpRequest.method = IHttpRequest.Method.POST; - httpRequest.headers = hashMap; - httpRequest.data = byteArrayOutputStream; - httpRequest.runInBackground = true; - this.m_authenticateRequest = Network.getComponent().sendRequest(httpRequest, new NetworkConnectionCallback() { // from class: com.ea.nimble.identity.AuthenticatorBase.13 - @Override // com.ea.nimble.NetworkConnectionCallback - public void callback(NetworkConnectionHandle networkConnectionHandle) { - if (networkConnectionHandle.getResponse().getError() != null) { - AuthenticatorBase.this.autoLogin(); - } else { - AuthenticatorBase.this.onTokenResponse(networkConnectionHandle); - } - } - }); - } - } - - public void refreshUserProfile(INimbleIdentityAuthenticator.NimbleIdentityAuthenticatorCallback nimbleIdentityAuthenticatorCallback) { - synchronized (this) { - Error environmentCheck = environmentCheck(); - if (environmentCheck == null) { - Log.Helper.LOGVS(this.TAG, "Ready to refresh user profile", new Object[0]); - if (this.m_userProfileRefreshTimer.isRunning()) { - this.m_userProfileRefreshTimer.cancel(); - } - if (nimbleIdentityAuthenticatorCallback != null) { - this.m_pidInfoCallbacks.add(nimbleIdentityAuthenticatorCallback); - } - updateUserProfile(); - } else if (nimbleIdentityAuthenticatorCallback != null) { - nimbleIdentityAuthenticatorCallback.onCallback(this, environmentCheck); - } - } - } - - private void resume(INimbleIdentityAuthenticator.NimbleIdentityAuthenticatorCallback nimbleIdentityAuthenticatorCallback) { - synchronized (this) { - if (this.m_state == INimbleIdentityAuthenticator.NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_NONE) { - Log.Helper.LOGIS(this.TAG, "Skipping autoLogin for state NONE", new Object[0]); - } else { - if (nimbleIdentityAuthenticatorCallback != null) { - this.m_authenticateCallbacks.add(nimbleIdentityAuthenticatorCallback); - } - if (environmentCheck() != null) { - Log.Helper.LOGIS(this.TAG, "Authenticator %s resume failing - environment not ready.", getAuthenticatorId()); - } else if (this.m_state == INimbleIdentityAuthenticator.NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_GOING) { - Log.Helper.LOGIS(this.TAG, "Skipping autoLogin for state GOING", new Object[0]); - } else { - if (this.m_token != null) { - if (this.m_token.getAccessTokenExpiryTime().after(new Date())) { - closeAuthentication(null); - getPidInfo(); - getPersonas(); - getUserInfo(); - } else if (this.m_token.getRefreshTokenExpiryTime().after(new Date())) { - refreshToken(); - } - } - autoLogin(); - } - } - } - } - - private void savePidInfo() { - Persistence persistenceForNimbleComponent = PersistenceService.getPersistenceForNimbleComponent(getComponentId(), Persistence.Storage.DOCUMENT); - if (persistenceForNimbleComponent != null && this.m_pidInfo != null) { - persistenceForNimbleComponent.setValue("pidInfo", this.m_pidInfo); - persistenceForNimbleComponent.synchronize(); - Log.Helper.LOGDS(this.TAG, "Saved current pidInfo (pid = %s) for %s authenticator to persistence.", this.m_pidInfo.getPid(), getAuthenticatorId()); - } - } - - private void saveState() { - Persistence persistenceForNimbleComponent = PersistenceService.getPersistenceForNimbleComponent(getComponentId(), Persistence.Storage.DOCUMENT); - if (persistenceForNimbleComponent != null) { - boolean z = this.m_state == INimbleIdentityAuthenticator.NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_GOING || this.m_state == INimbleIdentityAuthenticator.NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_OFFLINE || this.m_state == INimbleIdentityAuthenticator.NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_SUCCESS; - persistenceForNimbleComponent.setValue("loggedIn", Boolean.valueOf(z)); - persistenceForNimbleComponent.synchronize(); - Log.Helper.LOGDS(this.TAG, "Saved loggedIn value to persistence as %s for state %s", Boolean.valueOf(z), this.m_state); - } - } - - private void saveToken() { - Persistence persistenceForNimbleComponent = PersistenceService.getPersistenceForNimbleComponent(getComponentId(), Persistence.Storage.DOCUMENT); - if (persistenceForNimbleComponent != null) { - Log.Helper.LOGVS(this.TAG, "Saving token: " + this.m_token, new Object[0]); - persistenceForNimbleComponent.setValue("token", this.m_token); - } - } - - public void updatePersonas() { - if (this.m_personaRequest != null) { - Log.Helper.LOGVS(this.TAG, "Persona update in progress, skipping", new Object[0]); - return; - } - Log.Helper.LOGVS(this.TAG, "Updating persona info", new Object[0]); - URL url = null; - try { - url = new URL(String.format(URL_TEMPLATE_GET_PERSONA_INFO, getConfiguration().getProxyServerUrl())); - } catch (MalformedURLException e) { - } - String format = String.format("%s %s", this.m_token.getType(), this.m_token.getAccessToken()); - HashMap hashMap = new HashMap<>(); - hashMap.put(AUTHORIZATION_KEY, format); - hashMap.put(REQUEST_HEADER_PERSONA_INFO_EXTRA_FLAG, REQUEST_HEADER_TRUE_VALUE); - HttpRequest httpRequest = new HttpRequest(url); - httpRequest.method = IHttpRequest.Method.GET; - httpRequest.headers = hashMap; - this.m_personaRequest = Network.getComponent().sendRequest(httpRequest, new NetworkConnectionCallback() { // from class: com.ea.nimble.identity.AuthenticatorBase.16 - @Override // com.ea.nimble.NetworkConnectionCallback - public void callback(NetworkConnectionHandle networkConnectionHandle) { - try { - Map parseBodyJSONData = NimbleIdentityUtility.parseBodyJSONData(networkConnectionHandle); - Map map = (Map) parseBodyJSONData.get("personas"); - if (map == null) { - AuthenticatorBase.this.closePersonaUpdate(new Error(Error.Code.NETWORK_INVALID_SERVER_RESPONSE, "Fail to parse persona information from server response data " + parseBodyJSONData)); - } - List list = (List) map.get("persona"); - if (list == null) { - AuthenticatorBase.this.closePersonaUpdate(new Error(Error.Code.NETWORK_INVALID_SERVER_RESPONSE, "Fail to parse persona information from server response data " + parseBodyJSONData)); - } - ArrayList arrayList = new ArrayList(); - Date date = new Date(System.currentTimeMillis() + ((long) (AuthenticatorBase.this.getConfiguration().getExpiryInterval() * 1000.0d))); - for (Map map2 : list) { - arrayList.add(new NimbleIdentityPersona(map2, date)); - } - Log.Helper.LOGVS(AuthenticatorBase.this.TAG, "Update personas successfully with new data", new Object[0]); - synchronized (this) { - AuthenticatorBase.this.m_personas = arrayList; - } - AuthenticatorBase.this.closePersonaUpdate(null); - HashMap hashMap2 = new HashMap(); - hashMap2.put(Global.NIMBLE_IDENTITY_DICTIONARY_KEY_AUTHENTICATOR_ID, AuthenticatorBase.this.getAuthenticatorId()); - Utility.sendBroadcast(Global.NIMBLE_NOTIFICATION_IDENTITY_PERSONA_INFO_UPDATE, hashMap2); - } catch (Error e2) { - AuthenticatorBase.this.closePersonaUpdate(e2); - } - } - }); - } - - public void updatePidInfo() { - if (this.m_pidInfoRequest != null) { - Log.Helper.LOGVS(this.TAG, "Pid info update in progress, skipping", new Object[0]); - return; - } - Log.Helper.LOGVS(this.TAG, "Updating pid info", new Object[0]); - URL url = null; - try { - url = new URL(String.format(URL_TEMPLATE_GET_PID_INFO, getConfiguration().getProxyServerUrl())); - } catch (MalformedURLException e) { - } - String format = String.format("%s %s", this.m_token.getType(), this.m_token.getAccessToken()); - HashMap hashMap = new HashMap<>(); - hashMap.put(AUTHORIZATION_KEY, format); - hashMap.put(REQUEST_HEADER_PID_INFO_EXTRA_FLAG, REQUEST_HEADER_TRUE_VALUE); - HttpRequest httpRequest = new HttpRequest(url); - httpRequest.method = IHttpRequest.Method.GET; - httpRequest.headers = hashMap; - this.m_pidInfoRequest = Network.getComponent().sendRequest(httpRequest, new NetworkConnectionCallback() { // from class: com.ea.nimble.identity.AuthenticatorBase.15 - @Override // com.ea.nimble.NetworkConnectionCallback - public void callback(NetworkConnectionHandle networkConnectionHandle) { - try { - Map parseBodyJSONData = NimbleIdentityUtility.parseBodyJSONData(networkConnectionHandle); - Date date = new Date(System.currentTimeMillis() + ((long) (AuthenticatorBase.this.getConfiguration().getExpiryInterval() * 1000.0d))); - NimbleIdentityPidInfo nimbleIdentityPidInfo = new NimbleIdentityPidInfo(parseBodyJSONData, date); - if (!Utility.validString(nimbleIdentityPidInfo.getPid())) { - AuthenticatorBase.this.closePidInfoUpdate(new Error(Error.Code.NETWORK_INVALID_SERVER_RESPONSE, "Fail to parse valid pid information from server response data " + parseBodyJSONData)); - } else if (nimbleIdentityPidInfo.equals(AuthenticatorBase.this.m_pidInfo)) { - Log.Helper.LOGVS(AuthenticatorBase.this.TAG, "Update pid info succesfully, but nothing change.", new Object[0]); - AuthenticatorBase.this.m_pidInfo.setExpiryTime(date); - AuthenticatorBase.this.closePidInfoUpdate(null); - } else { - Log.Helper.LOGVS(AuthenticatorBase.this.TAG, "Update pid info successfully with new data.", new Object[0]); - NimbleIdentityUserInfo nimbleIdentityUserInfo = AuthenticatorBase.this.m_userInfo == null ? new NimbleIdentityUserInfo() : AuthenticatorBase.this.m_userInfo.clone(); - nimbleIdentityUserInfo.setPid(nimbleIdentityPidInfo.getPid()); - if (Utility.validString(nimbleIdentityPidInfo.getDob())) { - nimbleIdentityUserInfo.setDateOfBirth(nimbleIdentityPidInfo.getDob()); - } - synchronized (AuthenticatorBase.this) { - AuthenticatorBase.this.m_pidInfo = nimbleIdentityPidInfo; - AuthenticatorBase.this.m_userInfo = nimbleIdentityUserInfo; - } - AuthenticatorBase.this.closePidInfoUpdate(null); - HashMap hashMap2 = new HashMap(); - hashMap2.put(Global.NIMBLE_IDENTITY_DICTIONARY_KEY_AUTHENTICATOR_ID, AuthenticatorBase.this.getAuthenticatorId()); - hashMap2.put(Global.NIMBLE_IDENTITY_DICTIONARY_KEY_PIDMAP_ID, NimbleIdentityImpl.getComponent().getPidMapInternal()); - Utility.sendBroadcastSerializable(Global.NIMBLE_NOTIFICATION_IDENTITY_USER_INFO_UPDATE, hashMap2); - Utility.sendBroadcastSerializable(Global.NIMBLE_NOTIFICATION_IDENTITY_PID_INFO_UPDATE, hashMap2); - } - } catch (Error e2) { - AuthenticatorBase.this.closePidInfoUpdate(e2); - } - } - }); - } - - /* JADX INFO: Access modifiers changed from: package-private */ - public abstract void autoLogin(); - - public void cancelAuthentication() { - if (this.m_pidInfoRequest != null) { - this.m_pidInfoRequest.cancel(); - this.m_pidInfoRequest = null; - } - if (this.m_personaRequest != null) { - this.m_personaRequest.cancel(); - this.m_personaRequest = null; - } - if (this.m_state == INimbleIdentityAuthenticator.NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_GOING) { - if (this.m_authenticateRequest != null) { - this.m_authenticateRequest.cancel(); - this.m_authenticateRequest = null; - } - setState(INimbleIdentityAuthenticator.NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_OFFLINE); - } - } - - protected void cleanAtLogout(final INimbleIdentityAuthenticator.NimbleIdentityAuthenticatorCallback nimbleIdentityAuthenticatorCallback) { - synchronized (this) { - if (this.m_state == INimbleIdentityAuthenticator.NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_SUCCESS) { - URL url = null; - try { - NimbleIdentityConfig configuration = getConfiguration(); - url = new URL(String.format(URL_TEMPLATE_LOGOUT, configuration.getConnectServerUrl(), configuration.getClientId(), this.m_token.getAccessToken())); - } catch (MalformedURLException e) { - } - HttpRequest httpRequest = new HttpRequest(url); - httpRequest.method = IHttpRequest.Method.GET; - Network.getComponent().sendRequest(httpRequest, new NetworkConnectionCallback() { // from class: com.ea.nimble.identity.AuthenticatorBase.17 - @Override // com.ea.nimble.NetworkConnectionCallback - public void callback(NetworkConnectionHandle networkConnectionHandle) { - if (networkConnectionHandle.getResponse().getError() != null) { - } - if (nimbleIdentityAuthenticatorCallback != null) { - nimbleIdentityAuthenticatorCallback.onCallback(AuthenticatorBase.this, null); - } - } - }); - if (this.m_tokenRefreshTimer.isRunning()) { - this.m_tokenRefreshTimer.cancel(); - } - if (this.m_pidInfoRefreshTimer.isRunning()) { - this.m_pidInfoRefreshTimer.cancel(); - } - if (this.m_personaRefreshTimer.isRunning()) { - this.m_personaRefreshTimer.cancel(); - } - this.m_token = null; - saveToken(); - String pid = this.m_pidInfo != null ? this.m_pidInfo.getPid() : null; - boolean z = this.m_pidInfo != null; - this.m_pidInfo = null; - boolean z2 = this.m_personas != null; - this.m_personas = null; - setState(INimbleIdentityAuthenticator.NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_NONE); - Log.Helper.LOGDS(this.TAG, "Logout of authenticator " + getAuthenticatorId(), new Object[0]); - if (z) { - HashMap hashMap = new HashMap(); - hashMap.put(Global.NIMBLE_IDENTITY_DICTIONARY_KEY_AUTHENTICATOR_ID, getAuthenticatorId()); - Utility.sendBroadcast(Global.NIMBLE_NOTIFICATION_IDENTITY_PID_INFO_UPDATE, hashMap); - } - if (z2) { - HashMap hashMap2 = new HashMap(); - hashMap2.put(Global.NIMBLE_IDENTITY_DICTIONARY_KEY_AUTHENTICATOR_ID, getAuthenticatorId()); - Utility.sendBroadcast(Global.NIMBLE_NOTIFICATION_IDENTITY_PERSONA_INFO_UPDATE, hashMap2); - } - Component component = Base.getComponent(Tracking.COMPONENT_ID); - if (!(component == null || pid == null)) { - ITracking iTracking = (ITracking) component; - HashMap hashMap3 = new HashMap(); - hashMap3.put(Tracking.NIMBLE_TRACKING_KEY_IDENTITY_PIDMAP_LOGOUT, NimbleIdentityImpl.getComponent().getPidMapInternal().toString()); - HashMap hashMap4 = new HashMap(); - hashMap4.put(getAuthenticatorId(), pid); - hashMap3.put(Tracking.NIMBLE_TRACKING_KEY_IDENTITY_MAP_SOURCE, Utility.convertObjectToJSONString(hashMap4)); - iTracking.logEvent(Tracking.NIMBLE_TRACKING_EVENT_IDENTITY_LOGOUT, hashMap3); - } - NimbleIdentityAuthenticationConductorHandler authenticationConductor = NimbleIdentityImpl.getComponent().getAuthenticationConductor(); - if (authenticationConductor != null) { - authenticationConductor.handleLogout(this); - } - } else if (this.m_state == INimbleIdentityAuthenticator.NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_GOING) { - setState(INimbleIdentityAuthenticator.NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_NONE); - Log.Helper.LOGWS(this.TAG, "Logout of authenticator %s while state was going. Premature interruption. Check for failure.", getAuthenticatorId()); - if (nimbleIdentityAuthenticatorCallback != null) { - nimbleIdentityAuthenticatorCallback.onCallback(this, null); - } - NimbleIdentityAuthenticationConductorHandler authenticationConductor2 = NimbleIdentityImpl.getComponent().getAuthenticationConductor(); - if (authenticationConductor2 != null) { - authenticationConductor2.handleLogout(this); - } - } else { - setState(INimbleIdentityAuthenticator.NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_NONE); - } - } - } - - @Override // com.ea.nimble.Component - public void cleanup() { - Utility.unregisterReceiver(this.m_networkChangeReceiver); - Utility.unregisterReceiver(this.m_identityConfigChangeReceiver); - } - - public void closeAuthentication(Error error) { - ArrayList arrayList; - synchronized (this) { - this.m_authenticateRequest = null; - if (error == null) { - Log.Helper.LOGVS(this.TAG, "Authentication succeed!", new Object[0]); - Log.Helper.LOGWS(this.TAG, "\n\n\nAuthentication succeeded for %s\n\n\n", getAuthenticatorId()); - Component component = Base.getComponent(Tracking.COMPONENT_ID); - if (component != null) { - ITracking iTracking = (ITracking) component; - HashMap hashMap = new HashMap(); - HashMap hashMap2 = new HashMap(); - HashMap pidMapInternal = NimbleIdentityImpl.getComponent().getPidMapInternal(); - for (String str : pidMapInternal.keySet()) { - if (str != null && !str.equals(getAuthenticatorId())) { - hashMap2.put(str, pidMapInternal.get(str)); - } - } - hashMap.put(Tracking.NIMBLE_TRACKING_KEY_IDENTITY_PIDMAP_LOGIN, Utility.convertObjectToJSONString(hashMap2)); - HashMap hashMap3 = new HashMap(); - NimbleIdentityPidInfo pidInfo = getPidInfo(); - if (pidInfo != null) { - hashMap3.put(getAuthenticatorId(), Utility.safeString(pidInfo.getPid())); - } else { - hashMap3.put(getAuthenticatorId(), ""); - } - hashMap.put(Tracking.NIMBLE_TRACKING_KEY_IDENTITY_MAP_TARGET, Utility.convertObjectToJSONString(hashMap3)); - iTracking.logEvent(Tracking.NIMBLE_TRACKING_EVENT_IDENTITY_LOGIN, hashMap); - } - setState(INimbleIdentityAuthenticator.NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_SUCCESS); - if (getConfiguration().getAutoRefresh()) { - this.m_tokenRefreshTimer.schedule((((double) (this.m_token.getAccessTokenExpiryTime().getTime() - System.currentTimeMillis())) / 1000.0d) - EXPIRY_MARGIN_FOR_TIMER, false); - } - NimbleIdentityImpl component2 = NimbleIdentityImpl.getComponent(); - if (component2 != null) { - NimbleIdentityAuthenticationConductorHandler authenticationConductor = component2.getAuthenticationConductor(); - if (authenticationConductor != null) { - authenticationConductor.handleLogin(this, this.m_autoLoginAttempt); - } else { - Log.Helper.LOGWS(this.TAG, "\n\n\n@@@@@@@@@@@@@@@@Attempting to login with no conductor registered!~!!!!!@@@@@@@@@@@@@\n\n\n", new Object[0]); - } - } - } else { - Log.Helper.LOGES(this.TAG, "Authentication failed with error %s.", error); - cleanAtLogout(null); - } - arrayList = this.m_authenticateCallbacks; - this.m_authenticateCallbacks = new ArrayList<>(); - } - this.m_autoLoginAttempt = false; - Iterator it = arrayList.iterator(); - while (it.hasNext()) { - it.next().onCallback(this, error); - } - } - - protected void closeUserInfoUpdate(Error error, boolean z) { - ArrayList arrayList; - if (error == null) { - Log.Helper.LOGVS(this.TAG, "Updating user profile succeed!", new Object[0]); - } else { - Log.Helper.LOGES(this.TAG, "Fail to get user profile for error %s", error); - } - synchronized (this) { - if (z) { - if (getConfiguration().getAutoRefresh() && this.m_state == INimbleIdentityAuthenticator.NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_SUCCESS) { - if (error != null || this.m_userInfo.getExpiryTime() == null) { - this.m_userProfileRefreshTimer.schedule(60.0d, false); - } else { - this.m_userProfileRefreshTimer.schedule((((double) (this.m_userInfo.getExpiryTime().getTime() - System.currentTimeMillis())) / 1000.0d) - EXPIRY_MARGIN_FOR_TIMER, false); - } - } - } - arrayList = this.m_userInfoCallbacks; - this.m_userInfoCallbacks = new ArrayList<>(); - } - Iterator it = arrayList.iterator(); - while (it.hasNext()) { - it.next().onCallback(this, error); - } - } - - public void completeMigration() { - Log.Helper.LOGDS(this.TAG, "AuthenticatorBase complete migration called - has no implementation", new Object[0]); - } - - public void enableAutoRefresh(boolean z) { - synchronized (this) { - if (!z) { - if (this.m_tokenRefreshTimer.isRunning()) { - this.m_tokenRefreshTimer.cancel(); - } - if (this.m_pidInfoRefreshTimer.isRunning()) { - this.m_pidInfoRefreshTimer.cancel(); - } - if (this.m_personaRefreshTimer.isRunning()) { - this.m_personaRefreshTimer.cancel(); - } - } else if (this.m_state == INimbleIdentityAuthenticator.NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_SUCCESS) { - if (!this.m_tokenRefreshTimer.isRunning() && this.m_authenticateRequest == null && this.m_token != null) { - this.m_tokenRefreshTimer.schedule((((double) (this.m_token.getAccessTokenExpiryTime().getTime() - System.currentTimeMillis())) / 1000.0d) - EXPIRY_MARGIN_FOR_TIMER, false); - } - if (!(this.m_userProfileRefreshTimer.isRunning() || this.m_userInfo == null || this.m_userInfo.getExpiryTime() == null)) { - this.m_userProfileRefreshTimer.schedule((((double) (this.m_userInfo.getExpiryTime().getTime() - System.currentTimeMillis())) / 1000.0d) - EXPIRY_MARGIN_FOR_TIMER, false); - } - if (!this.m_pidInfoRefreshTimer.isRunning() && this.m_pidInfoRequest == null && this.m_pidInfo != null) { - this.m_pidInfoRefreshTimer.schedule((((double) (this.m_pidInfo.getExpiryTime().getTime() - System.currentTimeMillis())) / 1000.0d) - EXPIRY_MARGIN_FOR_TIMER, false); - } - if (!this.m_personaRefreshTimer.isRunning() && this.m_personaRequest == null && this.m_personas != null && this.m_personas.size() > 0) { - this.m_personaRefreshTimer.schedule((((double) (this.m_personas.get(0).getExpiryTime().getTime() - System.currentTimeMillis())) / 1000.0d) - EXPIRY_MARGIN_FOR_TIMER, false); - } - } - } - } - - protected void exchangeAuthCodeToToken(String str) { - Log.Helper.LOGVS(this.TAG, "Use oauth code to get token.", new Object[0]); - NimbleIdentityConfig configuration = getConfiguration(); - exchangeDataForToken(String.format(DATA_TEMPLATE_LOGIN_WITH_OAUTH_CODE, str, configuration.getClientId(), configuration.getClientSecret())); - } - - protected void exchangeDataForToken(String str) { - ByteArrayOutputStream byteArrayOutputStream; - URL url = null; - try { - URL url2 = new URL(String.format(URL_TEMPLATE_LOGIN, getConfiguration().getConnectServerUrl())); - try { - byte[] bytes = str.getBytes("UTF-8"); - ByteArrayOutputStream byteArrayOutputStream2 = new ByteArrayOutputStream(bytes.length); - try { - byteArrayOutputStream2.write(bytes); - url = url2; - byteArrayOutputStream = byteArrayOutputStream2; - } catch (IOException e) { - byteArrayOutputStream = byteArrayOutputStream2; - url = url2; - } - } catch (IOException e2) { - url = url2; - byteArrayOutputStream = null; - } - } catch (IOException e3) { - byteArrayOutputStream = null; - } - HashMap hashMap = new HashMap<>(); - hashMap.put(DATA_CONTENT_TYPE_KEY, DATA_CONTENT_TYPE_VALUE); - hashMap.put(REQUEST_HEADER_REFRESH_TOKEN_EXTRA_FLAG, REQUEST_HEADER_TRUE_VALUE); - HttpRequest httpRequest = new HttpRequest(url); - httpRequest.method = IHttpRequest.Method.POST; - httpRequest.headers = hashMap; - httpRequest.data = byteArrayOutputStream; - httpRequest.runInBackground = true; - synchronized (this) { - this.m_authenticateRequest = Network.getComponent().sendRequest(httpRequest, new NetworkConnectionCallback() { // from class: com.ea.nimble.identity.AuthenticatorBase.12 - @Override // com.ea.nimble.NetworkConnectionCallback - public void callback(NetworkConnectionHandle networkConnectionHandle) { - AuthenticatorBase.this.onTokenResponse(networkConnectionHandle); - } - }); - } - } - - public NimbleIdentityToken getAccessToken() { - return this.m_token; - } - - @Override // com.ea.nimble.Component - public String getComponentId() { - return INimbleIdentityAuthenticator.AUTHENTICATOR_COMPONENT_PREFIX + getAuthenticatorId(); - } - - protected NimbleIdentityConfig getConfiguration() { - return NimbleIdentityImpl.getComponent().getConfiguration(); - } - - @Override // com.ea.nimble.LogSource - public String getLogSourceTitle() { - return this.TAG; - } - - @Override // com.ea.nimble.identity.INimbleIdentityAuthenticator - public NimbleIdentityPersona getPersonaByNamespace(String str, long j) { - List personas = getPersonas(); - if (personas == null) { - return null; - } - for (NimbleIdentityPersona nimbleIdentityPersona : personas) { - if (nimbleIdentityPersona.getPersonaId() == j) { - if (nimbleIdentityPersona.getNamespaceName() != null && nimbleIdentityPersona.getNamespaceName().equals(str)) { - return nimbleIdentityPersona; - } - Log.Helper.LOGWS(this.TAG, "Try to get persona with persona id %d, but namespace %s doesn't match the asked for %s", Long.valueOf(nimbleIdentityPersona.getPersonaId()), nimbleIdentityPersona.getNamespaceName(), str); - return null; - } - } - return null; - } - - @Override // com.ea.nimble.identity.INimbleIdentityAuthenticator - public NimbleIdentityPersona getPersonaByNamespace(String str, String str2) { - List personas = getPersonas(); - if (personas == null) { - return null; - } - for (NimbleIdentityPersona nimbleIdentityPersona : personas) { - if (nimbleIdentityPersona.getNamespaceName() != null && nimbleIdentityPersona.getNamespaceName().equals(str) && nimbleIdentityPersona.getName() != null && nimbleIdentityPersona.getName().equals(str2)) { - return nimbleIdentityPersona; - } - } - return null; - } - - @Override // com.ea.nimble.identity.INimbleIdentityAuthenticator - public List getPersonas() { - ArrayList arrayList; - synchronized (this) { - arrayList = this.m_personas; - if (this.m_state == INimbleIdentityAuthenticator.NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_SUCCESS && (this.m_personas == null || (this.m_personas.size() > 0 && this.m_personas.get(0).getExpiryTime().before(new Date())))) { - updatePersonas(); - } - } - return arrayList; - } - - /* JADX WARN: Code restructure failed: missing block: B:7:0x002b, code lost: - if (r4.m_pidInfo.getExpiryTime().before(new java.util.Date()) != false) goto L_0x002e; - */ - @Override // com.ea.nimble.identity.INimbleIdentityAuthenticator - /* - Code decompiled incorrectly, please refer to instructions dump. - To view partially-correct code enable 'Show inconsistent code' option in preferences - */ - public com.ea.nimble.identity.NimbleIdentityPidInfo getPidInfo() { - /* - r4 = this; - r0 = r4 - com.ea.nimble.identity.NimbleIdentityPidInfo r0 = r0.m_pidInfo - r6 = r0 - r0 = r6 - r5 = r0 - r0 = r4 - com.ea.nimble.identity.INimbleIdentityAuthenticator$NimbleIdentityAuthenticationState r0 = r0.m_state - com.ea.nimble.identity.INimbleIdentityAuthenticator$NimbleIdentityAuthenticationState r1 = com.ea.nimble.identity.INimbleIdentityAuthenticator.NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_SUCCESS - if (r0 != r1) goto L_0x0061 - r0 = r4 - com.ea.nimble.identity.NimbleIdentityPidInfo r0 = r0.m_pidInfo - if (r0 == 0) goto L_0x002e - r0 = r6 - r5 = r0 - r0 = r4 - com.ea.nimble.identity.NimbleIdentityPidInfo r0 = r0.m_pidInfo - java.util.Date r0 = r0.getExpiryTime() - java.util.Date r1 = new java.util.Date - r2 = r1 - r2.() - boolean r0 = r0.before(r1) - if (r0 == 0) goto L_0x0061 - L_0x002e: - r0 = r4 - monitor-enter(r0) - r0 = r4 - com.ea.nimble.identity.NimbleIdentityPidInfo r0 = r0.m_pidInfo // Catch: all -> 0x0067 - r5 = r0 - r0 = r4 - com.ea.nimble.identity.INimbleIdentityAuthenticator$NimbleIdentityAuthenticationState r0 = r0.m_state // Catch: all -> 0x0067 - com.ea.nimble.identity.INimbleIdentityAuthenticator$NimbleIdentityAuthenticationState r1 = com.ea.nimble.identity.INimbleIdentityAuthenticator.NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_SUCCESS // Catch: all -> 0x0067 - if (r0 != r1) goto L_0x005f - r0 = r4 - com.ea.nimble.identity.NimbleIdentityPidInfo r0 = r0.m_pidInfo // Catch: all -> 0x0067 - if (r0 == 0) goto L_0x005a - r0 = r4 - com.ea.nimble.identity.NimbleIdentityPidInfo r0 = r0.m_pidInfo // Catch: all -> 0x0067 - java.util.Date r0 = r0.getExpiryTime() // Catch: all -> 0x0067 - java.util.Date r1 = new java.util.Date // Catch: all -> 0x0067 - r2 = r1 - r2.() // Catch: all -> 0x0067 - boolean r0 = r0.before(r1) // Catch: all -> 0x0067 - if (r0 == 0) goto L_0x005f - L_0x005a: - r0 = r4 - r1 = 0 - r0.refreshPidInfo(r1) // Catch: all -> 0x0067 - L_0x005f: - r0 = r4 - monitor-exit(r0) // Catch: all -> 0x0067 - L_0x0061: - r0 = r4 - r0.savePidInfo() - r0 = r5 - return r0 - L_0x0067: - r5 = move-exception - r0 = r4 - monitor-exit(r0) // Catch: all -> 0x0067 - r0 = r5 - throw r0 - */ - throw new UnsupportedOperationException("Method not decompiled: com.ea.nimble.identity.AuthenticatorBase.getPidInfo():com.ea.nimble.identity.NimbleIdentityPidInfo"); - } - - @Override // com.ea.nimble.identity.INimbleIdentityAuthenticator - public INimbleIdentityAuthenticator.NimbleIdentityAuthenticationState getState() { - return this.m_state; - } - - @Override // com.ea.nimble.identity.INimbleIdentityAuthenticator - public NimbleIdentityUserInfo getUserInfo() { - NimbleIdentityUserInfo nimbleIdentityUserInfo; - synchronized (this) { - nimbleIdentityUserInfo = this.m_userInfo; - if (this.m_userInfo == null || (this.m_userInfo.getExpiryTime() != null && this.m_userInfo.getExpiryTime().before(new Date()))) { - refreshUserProfile(null); - } - if (this.m_pidInfo == null || this.m_pidInfo.getExpiryTime().before(new Date())) { - refreshPidInfo(null); - } - } - return nimbleIdentityUserInfo; - } - - @Override // com.ea.nimble.identity.INimbleIdentityAuthenticator - public void refreshPersonas(final INimbleIdentityAuthenticator.NimbleIdentityAuthenticatorCallback nimbleIdentityAuthenticatorCallback) { - Log.Helper.LOGDS(this.TAG, "Refreshing persona info", new Object[0]); - prepare(new INimbleIdentityAuthenticator.NimbleIdentityAuthenticatorCallback() { // from class: com.ea.nimble.identity.AuthenticatorBase.9 - @Override // com.ea.nimble.identity.INimbleIdentityAuthenticator.NimbleIdentityAuthenticatorCallback - public void onCallback(INimbleIdentityAuthenticator iNimbleIdentityAuthenticator, Error error) { - if (error == null) { - Log.Helper.LOGVS(AuthenticatorBase.this.TAG, "Ready to refresh persona info", new Object[0]); - synchronized (this) { - if (AuthenticatorBase.this.m_personaRefreshTimer.isRunning()) { - AuthenticatorBase.this.m_personaRefreshTimer.cancel(); - } - if (nimbleIdentityAuthenticatorCallback != null) { - AuthenticatorBase.this.m_personaCallbacks.add(nimbleIdentityAuthenticatorCallback); - } - AuthenticatorBase.this.updatePersonas(); - } - return; - } - if (AuthenticatorBase.this.getConfiguration().getAutoRefresh() && AuthenticatorBase.this.m_state == INimbleIdentityAuthenticator.NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_SUCCESS) { - AuthenticatorBase.this.m_personaRefreshTimer.schedule(60.0d, false); - } - if (nimbleIdentityAuthenticatorCallback != null) { - Log.Helper.LOGWS(AuthenticatorBase.this.TAG, "Persona refresh failed early because of error %s", error); - nimbleIdentityAuthenticatorCallback.onCallback(AuthenticatorBase.this, error); - } - } - }); - } - - @Override // com.ea.nimble.identity.INimbleIdentityAuthenticator - public void refreshPidInfo(final INimbleIdentityAuthenticator.NimbleIdentityAuthenticatorCallback nimbleIdentityAuthenticatorCallback) { - Log.Helper.LOGDS(this.TAG, "Refreshing pid Info", new Object[0]); - prepare(new INimbleIdentityAuthenticator.NimbleIdentityAuthenticatorCallback() { // from class: com.ea.nimble.identity.AuthenticatorBase.8 - @Override // com.ea.nimble.identity.INimbleIdentityAuthenticator.NimbleIdentityAuthenticatorCallback - public void onCallback(INimbleIdentityAuthenticator iNimbleIdentityAuthenticator, Error error) { - if (error == null) { - Log.Helper.LOGVS(AuthenticatorBase.this.TAG, "Ready to refresh pid info", new Object[0]); - synchronized (this) { - if (AuthenticatorBase.this.m_pidInfoRefreshTimer.isRunning()) { - AuthenticatorBase.this.m_pidInfoRefreshTimer.cancel(); - } - if (nimbleIdentityAuthenticatorCallback != null) { - AuthenticatorBase.this.m_pidInfoCallbacks.add(nimbleIdentityAuthenticatorCallback); - } - AuthenticatorBase.this.updatePidInfo(); - } - return; - } - if (AuthenticatorBase.this.getConfiguration().getAutoRefresh() && AuthenticatorBase.this.m_state == INimbleIdentityAuthenticator.NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_SUCCESS) { - AuthenticatorBase.this.m_pidInfoRefreshTimer.schedule(60.0d, false); - } - if (nimbleIdentityAuthenticatorCallback != null) { - Log.Helper.LOGWS(AuthenticatorBase.this.TAG, "Persona refresh failed early because of error %s", error); - nimbleIdentityAuthenticatorCallback.onCallback(AuthenticatorBase.this, error); - } - } - }); - } - - @Override // com.ea.nimble.identity.INimbleIdentityAuthenticator - public void refreshUserInfo(final INimbleIdentityAuthenticator.NimbleIdentityAuthenticatorCallback nimbleIdentityAuthenticatorCallback) { - refreshPidInfo(new INimbleIdentityAuthenticator.NimbleIdentityAuthenticatorCallback() { // from class: com.ea.nimble.identity.AuthenticatorBase.7 - @Override // com.ea.nimble.identity.INimbleIdentityAuthenticator.NimbleIdentityAuthenticatorCallback - public void onCallback(INimbleIdentityAuthenticator iNimbleIdentityAuthenticator, Error error) { - if (nimbleIdentityAuthenticatorCallback == null) { - Log.Helper.LOGDS(AuthenticatorBase.this.TAG, "Received null callback in refreshUserInfo", new Object[0]); - } else if (error == null) { - AuthenticatorBase.this.refreshUserProfile(nimbleIdentityAuthenticatorCallback); - } else { - nimbleIdentityAuthenticatorCallback.onCallback(iNimbleIdentityAuthenticator, new NimbleIdentityError(NimbleIdentityError.NimbleIdentityErrorCode.NIMBLE_IDENTITY_ERROR_REFRESH_USER_INFO_FROM_PID_INFO.intValue(), "Fail to refresh user info from pid info", error)); - } - } - }); - } - - @Override // com.ea.nimble.identity.INimbleIdentityAuthenticator - public void requestAccessToken(final INimbleIdentityAuthenticator.NimbleAuthenticatorAccessTokenCallback nimbleAuthenticatorAccessTokenCallback) { - if (nimbleAuthenticatorAccessTokenCallback == null) { - Log.Helper.LOGW(this, "requestAccessToken API called without a callback. Aborting token refresh", new Object[0]); - return; - } - Log.Helper.LOGD(this, "requestAccessToken API called, proceeding with token refresh", new Object[0]); - if (this.m_token == null) { - nimbleAuthenticatorAccessTokenCallback.AccessTokenCallback(this, "", "", new NimbleIdentityError(NimbleIdentityError.NimbleIdentityErrorCode.NIMBLE_IDENTITY_ERROR_UNAUTHENTICATED, "No tokens found for your authenticator")); - } else if (!Utility.validString(this.m_token.getAccessToken())) { - nimbleAuthenticatorAccessTokenCallback.AccessTokenCallback(this, "", "", new NimbleIdentityError(NimbleIdentityError.NimbleIdentityErrorCode.NIMBLE_IDENTITY_ERROR_UNAUTHENTICATED, "No tokens found for your authenticator")); - } else if (this.m_token.getAccessTokenExpiryTime().after(new Date())) { - nimbleAuthenticatorAccessTokenCallback.AccessTokenCallback(this, this.m_token.getAccessToken(), this.m_token.getType(), null); - } else { - prepare(new INimbleIdentityAuthenticator.NimbleIdentityAuthenticatorCallback() { // from class: com.ea.nimble.identity.AuthenticatorBase.11 - @Override // com.ea.nimble.identity.INimbleIdentityAuthenticator.NimbleIdentityAuthenticatorCallback - public void onCallback(INimbleIdentityAuthenticator iNimbleIdentityAuthenticator, Error error) { - if (error == null) { - nimbleAuthenticatorAccessTokenCallback.AccessTokenCallback(AuthenticatorBase.this, AuthenticatorBase.this.m_token.getAccessToken(), AuthenticatorBase.this.m_token.getType(), null); - } else { - nimbleAuthenticatorAccessTokenCallback.AccessTokenCallback(AuthenticatorBase.this, "", "", error); - } - } - }); - } - } - - @Override // com.ea.nimble.identity.INimbleIdentityAuthenticator - public void requestAuthCode(final String str, final String str2, final INimbleIdentityAuthenticator.NimbleIdentityServerAuthCodeCallback nimbleIdentityServerAuthCodeCallback) { - if (nimbleIdentityServerAuthCodeCallback == null) { - Log.Helper.LOGWS(this.TAG, "Request server authentication oAuth code without callback, no way to get result", new Object[0]); - return; - } - Log.Helper.LOGDS(this.TAG, "Request server authentication oauth code for serverId %s and scope %s", str, str2); - prepare(new INimbleIdentityAuthenticator.NimbleIdentityAuthenticatorCallback() { // from class: com.ea.nimble.identity.AuthenticatorBase.10 - @Override // com.ea.nimble.identity.INimbleIdentityAuthenticator.NimbleIdentityAuthenticatorCallback - public void onCallback(INimbleIdentityAuthenticator iNimbleIdentityAuthenticator, Error error) { - if (error == null) { - Log.Helper.LOGVS(AuthenticatorBase.this.TAG, "Ready to request server auth code for serverId %s and scope %s", str, str2); - URL url = null; - try { - String format = String.format(AuthenticatorBase.URL_TEMPLATE_REQUEST_SERVER_AUTHENTICATION_OAUTH_CODE, AuthenticatorBase.this.getConfiguration().getConnectServerUrl(), str, AuthenticatorBase.this.m_token.getAccessToken()); - String str3 = format; - if (Utility.validString(str2)) { - str3 = String.format("%s&scope=%s", format, str2); - } - url = new URL(str3); - } catch (MalformedURLException e) { - } - Network.getComponent().sendGetRequest(url, new HashMap<>(), new NetworkConnectionCallback() { // from class: com.ea.nimble.identity.AuthenticatorBase.10.1 - @Override // com.ea.nimble.NetworkConnectionCallback - public void callback(NetworkConnectionHandle networkConnectionHandle) { - try { - Map parseBodyJSONData = NimbleIdentityUtility.parseBodyJSONData(networkConnectionHandle); - String str4 = (String) parseBodyJSONData.get("code"); - if (!Utility.validString(str4)) { - Error error2 = new Error(Error.Code.NETWORK_INVALID_SERVER_RESPONSE, String.format("Fail to parse oAuth code from server response data %s", parseBodyJSONData)); - Log.Helper.LOGDS(AuthenticatorBase.this.TAG, "Request for server auth code failed for error %s", error2); - nimbleIdentityServerAuthCodeCallback.onCallback(AuthenticatorBase.this, null, str, str2, error2); - return; - } - Log.Helper.LOGDS(AuthenticatorBase.this.TAG, "Request for server auth code succeed with auth code: %s", str4); - nimbleIdentityServerAuthCodeCallback.onCallback(AuthenticatorBase.this, str4, str, str2, null); - } catch (Error e2) { - Log.Helper.LOGDS(AuthenticatorBase.this.TAG, "Request for server auth code failed for error %s", e2); - nimbleIdentityServerAuthCodeCallback.onCallback(AuthenticatorBase.this, null, str, str2, e2); - } - } - }); - return; - } - Log.Helper.LOGDS(AuthenticatorBase.this.TAG, "Fail to get server authentication oauth code because of error %s", error); - nimbleIdentityServerAuthCodeCallback.onCallback(AuthenticatorBase.this, null, str, str2, error); - } - }); - } - - protected void requestIdentityForFriends(String str, ArrayList arrayList, final INimbleIdentityAuthenticator.NimbleIdentityFriendsIdentityInfoCallback nimbleIdentityFriendsIdentityInfoCallback) { - ByteArrayOutputStream byteArrayOutputStream = null; - if (nimbleIdentityFriendsIdentityInfoCallback == null) { - Log.Helper.LOGES(this.TAG, "requestIdentityForFriends called with no way to notify caller", new Object[0]); - return; - } - HashMap hashMap = new HashMap(); - hashMap.put("pidType", str); - hashMap.put("clientId", getConfiguration().getClientId()); - hashMap.put("values", arrayList); - String convertObjectToJSONString = Utility.convertObjectToJSONString(hashMap); - synchronized (this) { - try { - URL url = null; - try { - url = new URL(String.format("%s%s", getConfiguration().getProxyServerUrl(), URL_TEMPALTE_GET_IDENTITY_INFO_FOR_FRIENDS)); - try { - byte[] bytes = convertObjectToJSONString.getBytes("UTF-8"); - byteArrayOutputStream = new ByteArrayOutputStream(bytes.length); - try { - byteArrayOutputStream.write(bytes); - } catch (IOException e) { - } catch (Throwable th) { - th = th; - throw th; - } - } catch (IOException e2) { - byteArrayOutputStream = null; - } catch (Throwable th2) { - } - } catch (IOException e3) { - byteArrayOutputStream = null; - } - String format = String.format("%s %s", this.m_token.getType(), this.m_token.getAccessToken()); - HashMap hashMap2 = new HashMap<>(); - hashMap2.put(AUTHORIZATION_KEY, format); - hashMap2.put("Content-Type", "text/plain;charset=UTF-8"); - HttpRequest httpRequest = new HttpRequest(url); - httpRequest.method = IHttpRequest.Method.POST; - httpRequest.headers = hashMap2; - httpRequest.data = byteArrayOutputStream; - Network.getComponent().sendRequest(httpRequest, new NetworkConnectionCallback() { // from class: com.ea.nimble.identity.AuthenticatorBase.14 - @Override // com.ea.nimble.NetworkConnectionCallback - public void callback(NetworkConnectionHandle networkConnectionHandle) { - try { - nimbleIdentityFriendsIdentityInfoCallback.onCallback(AuthenticatorBase.this, NimbleIdentityUtility.parseJsonResponse(networkConnectionHandle), null); - } catch (Error e4) { - nimbleIdentityFriendsIdentityInfoCallback.onCallback(AuthenticatorBase.this, null, e4); - } - } - }); - } catch (Throwable th3) { - } - } - } - - @Override // com.ea.nimble.identity.INimbleIdentityAuthenticator - public void requestIdentityForFriends(ArrayList arrayList, INimbleIdentityAuthenticator.NimbleIdentityFriendsIdentityInfoCallback nimbleIdentityFriendsIdentityInfoCallback) throws Exception { - throw new Exception("Authenticator " + getAuthenticatorId() + " doesn't support identity information for friends"); - } - - public void restoreAuthenticator(INimbleIdentityAuthenticator.NimbleIdentityAuthenticatorCallback nimbleIdentityAuthenticatorCallback) { - if (this.m_state != INimbleIdentityAuthenticator.NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_UNAVAILABLE) { - loadState(); - if (this.m_state != INimbleIdentityAuthenticator.NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_NONE) { - loadToken(); - loadPidInfo(); - } - Utility.registerReceiver(Global.NOTIFICATION_NETWORK_STATUS_CHANGE, this.m_networkChangeReceiver); - Utility.registerReceiver("nimble.notification.identity.configuration.change", this.m_identityConfigChangeReceiver); - resume(nimbleIdentityAuthenticatorCallback); - } - } - - @Override // com.ea.nimble.Component - public void resume() { - resume(null); - } - - public void setState(INimbleIdentityAuthenticator.NimbleIdentityAuthenticationState nimbleIdentityAuthenticationState) { - if (nimbleIdentityAuthenticationState != this.m_state) { - this.m_state = nimbleIdentityAuthenticationState; - saveState(); - HashMap hashMap = new HashMap(); - hashMap.put(Global.NIMBLE_IDENTITY_DICTIONARY_KEY_AUTHENTICATOR_ID, getAuthenticatorId()); - Utility.sendBroadcastSerializable(Global.NIMBLE_NOTIFICATION_IDENTITY_AUTHENTICATION_UPDATE, hashMap); - } - } - - @Override // com.ea.nimble.Component - public void suspend() { - cancelAuthentication(); - } - - protected void updateUserProfile() { - this.m_userInfo.setExpiryTime(null); - closeUserInfoUpdate(null, false); - } -} diff --git a/app/src/main/java/com/ea/nimble/identity/AuthenticatorFacebook.java b/app/src/main/java/com/ea/nimble/identity/AuthenticatorFacebook.java deleted file mode 100644 index 187e870..0000000 --- a/app/src/main/java/com/ea/nimble/identity/AuthenticatorFacebook.java +++ /dev/null @@ -1,210 +0,0 @@ -package com.ea.nimble.identity; - -import com.ea.nimble.Base; -import com.ea.nimble.Error; -import com.ea.nimble.Facebook; -import com.ea.nimble.Global; -import com.ea.nimble.HttpRequest; -import com.ea.nimble.IFacebook; -import com.ea.nimble.Log; -import com.ea.nimble.Network; -import com.ea.nimble.NetworkConnectionCallback; -import com.ea.nimble.NetworkConnectionHandle; -import com.ea.nimble.Utility; -import java.net.MalformedURLException; -import java.net.URL; -import java.util.ArrayList; -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/* loaded from: stdlib.jar:com/ea/nimble/identity/AuthenticatorFacebook.class */ -class AuthenticatorFacebook extends AuthenticatorBase { - private static final String PID_TYPE = "mobile_facebook"; - private static final String URL_TEMPLATE_FACEBOOK_IMAGE_URL = "https://graph.facebook.com/%s/picture?type=normal"; - private static final String URL_TEMPLATE_FACEBOOK_LOGIN = "%s/connect/auth?mobile_login_type=mobile_game_facebook&client_id=%s&response_type=code&display=mobilegame/login&fb_token=%s&redirect_uri=nucleus:rest"; - private String m_overrideBirthday; - - private AuthenticatorFacebook() { - this.TAG = "AuthenticatorFacebook"; - } - - /* JADX INFO: Access modifiers changed from: private */ - public void exchangeFacebookAccessTokenForAuthCode(String str) { - synchronized (this) { - URL url = null; - try { - NimbleIdentityConfig configuration = getConfiguration(); - url = new URL(String.format(URL_TEMPLATE_FACEBOOK_LOGIN, configuration.getConnectServerUrl(), configuration.getClientId(), str)); - } catch (MalformedURLException e) { - } - HttpRequest httpRequest = new HttpRequest(url); - httpRequest.runInBackground = true; - this.m_authenticateRequest = Network.getComponent().sendRequest(httpRequest, new NetworkConnectionCallback() { // from class: com.ea.nimble.identity.AuthenticatorFacebook.2 - @Override // com.ea.nimble.NetworkConnectionCallback - public void callback(NetworkConnectionHandle networkConnectionHandle) { - if (AuthenticatorFacebook.this.m_state != INimbleIdentityAuthenticator.NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_OFFLINE) { - try { - Map parseBodyJSONData = NimbleIdentityUtility.parseBodyJSONData(networkConnectionHandle); - String str2 = (String) parseBodyJSONData.get("code"); - if (!Utility.validString(str2)) { - AuthenticatorFacebook.this.closeAuthentication(new Error(Error.Code.NETWORK_INVALID_SERVER_RESPONSE, "Cannot read login OAuth code data from server response data " + parseBodyJSONData)); - } else { - AuthenticatorFacebook.this.exchangeAuthCodeToToken(str2); - } - } catch (Error e2) { - AuthenticatorFacebook.this.closeAuthentication(e2); - } - } - } - }); - } - } - - private static void initialize() { - Log.Helper.LOGVS("AuthenticatorFacebook", "Initializing...", new Object[0]); - AuthenticatorFacebook authenticatorFacebook = new AuthenticatorFacebook(); - Base.registerComponent(authenticatorFacebook, authenticatorFacebook.getComponentId()); - } - - private void loginFacebook(IFacebook iFacebook, List list, INimbleIdentityAuthenticator.NimbleIdentityAuthenticatorCallback nimbleIdentityAuthenticatorCallback) { - - } - - /* JADX INFO: Access modifiers changed from: package-private */ - @Override // com.ea.nimble.identity.AuthenticatorBase - public void autoLogin() { - Log.Helper.LOGIS(this.TAG, "Facebook Authenticator AutoLogin", new Object[0]); - this.m_autoLoginAttempt = true; - IFacebook iFacebook = (IFacebook) Base.getComponent(Facebook.COMPONENT_ID); - if (iFacebook == null) { - closeAuthentication(new Error(Error.Code.SYSTEM_UNEXPECTED, "Cannot auto login with FacebookAuthenticator since it is disabled for no NimbleFacebook component")); - } else if (Utility.validString(iFacebook.getAccessToken())) { - synchronized (this) { - this.m_state = INimbleIdentityAuthenticator.NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_GOING; - exchangeFacebookAccessTokenForAuthCode(iFacebook.getAccessToken()); - } - } else { - closeAuthentication(new Error(Error.Code.SYSTEM_UNEXPECTED, "Cannot auto login with FacebookAuthenticator since Facebook SDK doesn't have any session existing")); - } - } - - /* JADX INFO: Access modifiers changed from: protected */ - @Override // com.ea.nimble.identity.AuthenticatorBase - public void cancelAuthentication() { - if (this.m_state == INimbleIdentityAuthenticator.NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_GOING && this.m_authenticateRequest == null) { - super.cancelAuthentication(); - setState(INimbleIdentityAuthenticator.NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_GOING); - return; - } - super.cancelAuthentication(); - } - - @Override // com.ea.nimble.identity.INimbleIdentityAuthenticator - public String getAuthenticatorId() { - return Global.NIMBLE_AUTHENTICATOR_FACEBOOK; - } - - @Override // com.ea.nimble.identity.INimbleIdentityAuthenticator - public void login(NimbleIdentityLoginParams nimbleIdentityLoginParams, INimbleIdentityAuthenticator.NimbleIdentityAuthenticatorCallback nimbleIdentityAuthenticatorCallback) { - Log.Helper.LOGIS(this.TAG, "Facebook Authenticator Login", new Object[0]); - IFacebook iFacebook = (IFacebook) Base.getComponent(Facebook.COMPONENT_ID); - if (iFacebook == null) { - Log.Helper.LOGIS(this.TAG, "Cannot login with FacebookAuthenticator since it is disabled for no NimbleFacebook component", new Object[0]); - if (nimbleIdentityAuthenticatorCallback != null) { - nimbleIdentityAuthenticatorCallback.onCallback(this, new Error(Error.Code.NOT_AVAILABLE, "Cannot login with FacebookAuthenticator since it is disabled for no NimbleFacebook component")); - } - } else if (nimbleIdentityLoginParams == null) { - loginFacebook(iFacebook, null, nimbleIdentityAuthenticatorCallback); - } else if (nimbleIdentityLoginParams instanceof NimbleIdentityLoginParams.FacebookClientLoginParams) { - loginFacebook(iFacebook, ((NimbleIdentityLoginParams.FacebookClientLoginParams) nimbleIdentityLoginParams).getFacebookPermissions(), nimbleIdentityAuthenticatorCallback); - } else if (nimbleIdentityLoginParams instanceof NimbleIdentityLoginParams.FacebookAccessTokenLoginParams) { - NimbleIdentityLoginParams.FacebookAccessTokenLoginParams facebookAccessTokenLoginParams = (NimbleIdentityLoginParams.FacebookAccessTokenLoginParams) nimbleIdentityLoginParams; - if (Utility.validString(facebookAccessTokenLoginParams.getFacebookAccessToken())) { - synchronized (this) { - setState(INimbleIdentityAuthenticator.NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_GOING); - if (nimbleIdentityAuthenticatorCallback != null) { - this.m_authenticateCallbacks.add(nimbleIdentityAuthenticatorCallback); - } - iFacebook.refreshSession(facebookAccessTokenLoginParams.getFacebookAccessToken(), facebookAccessTokenLoginParams.getExpiryDate()); - exchangeFacebookAccessTokenForAuthCode(facebookAccessTokenLoginParams.getFacebookAccessToken()); - } - } else if (nimbleIdentityAuthenticatorCallback != null) { - nimbleIdentityAuthenticatorCallback.onCallback(this, new Error(Error.Code.INVALID_ARGUMENT, "Invalid Facebook access token for Facebook token")); - } - } else if (nimbleIdentityAuthenticatorCallback != null) { - nimbleIdentityAuthenticatorCallback.onCallback(this, new NimbleIdentityError(NimbleIdentityError.NimbleIdentityErrorCode.NIMBLE_IDENTITY_ERROR_INVALID_LOGINPARAMS, "Unrecognized login parameters")); - } - } - - @Override // com.ea.nimble.identity.INimbleIdentityAuthenticator - public void logout(INimbleIdentityAuthenticator.NimbleIdentityAuthenticatorCallback nimbleIdentityAuthenticatorCallback) { - Log.Helper.LOGIS(this.TAG, "Facebook Authenticator is logging out", new Object[0]); - IFacebook iFacebook = (IFacebook) Base.getComponent(Facebook.COMPONENT_ID); - if (iFacebook == null) { - Log.Helper.LOGIS(this.TAG, "Cannot logout with FacebookAuthenticator since it is disabled for no NimbleFacebook component", new Object[0]); - NimbleIdentityError nimbleIdentityError = new NimbleIdentityError(NimbleIdentityError.NimbleIdentityErrorCode.NIMBLE_IDENTITY_ERROR_INVALID_REQUEST, "Cannot logout with FacebookAuthenticator since it is disabled for no NimbleFacebook component"); - if (nimbleIdentityAuthenticatorCallback != null) { - nimbleIdentityAuthenticatorCallback.onCallback(this, nimbleIdentityError); - return; - } - return; - } - cancelAuthentication(); - iFacebook.logout(); - cleanAtLogout(nimbleIdentityAuthenticatorCallback); - } - - @Override // com.ea.nimble.identity.AuthenticatorBase, com.ea.nimble.identity.INimbleIdentityAuthenticator - public void requestIdentityForFriends(ArrayList arrayList, INimbleIdentityAuthenticator.NimbleIdentityFriendsIdentityInfoCallback nimbleIdentityFriendsIdentityInfoCallback) throws Exception { - requestIdentityForFriends(PID_TYPE, arrayList, nimbleIdentityFriendsIdentityInfoCallback); - } - - @Override // com.ea.nimble.identity.AuthenticatorBase - public void restoreAuthenticator(INimbleIdentityAuthenticator.NimbleIdentityAuthenticatorCallback nimbleIdentityAuthenticatorCallback) { - if (((IFacebook) Base.getComponent(Facebook.COMPONENT_ID)) == null) { - Log.Helper.LOGIS(this.TAG, "FacebookAuthenticator is disabled since there is no NimbleFacebook component", new Object[0]); - Log.Helper.LOGIS(this.TAG, "To enable FacebookAuthenticator, please ensure the NimbleFacebook jar is correctly linked", new Object[0]); - setState(INimbleIdentityAuthenticator.NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_UNAVAILABLE); - } - super.restoreAuthenticator(nimbleIdentityAuthenticatorCallback); - } - - /* JADX INFO: Access modifiers changed from: protected */ - @Override // com.ea.nimble.Component - public void setup() { - this.m_overrideBirthday = null; - } - - @Override // com.ea.nimble.identity.AuthenticatorBase - protected void updateUserProfile() { - IFacebook iFacebook = (IFacebook) Base.getComponent(Facebook.COMPONENT_ID); - if (iFacebook == null) { - closeUserInfoUpdate(new Error(Error.Code.NOT_AVAILABLE, "Cannot auto login with FacebookAuthenticator since it is disabled for no NimbleFacebook component"), true); - return; - } - Map graphUser = iFacebook.getGraphUser(); - NimbleIdentityUserInfo nimbleIdentityUserInfo = this.m_userInfo == null ? new NimbleIdentityUserInfo() : this.m_userInfo.clone(); - if (graphUser != null) { - nimbleIdentityUserInfo.setUserId((String) graphUser.get("id")); - nimbleIdentityUserInfo.setDisplayName((String) graphUser.get("name")); - nimbleIdentityUserInfo.setUserName((String) graphUser.get("username")); - nimbleIdentityUserInfo.setAvatarUri(String.format(URL_TEMPLATE_FACEBOOK_IMAGE_URL, nimbleIdentityUserInfo.getUserId())); - String str = (String) graphUser.get("birthday"); - if (Utility.validString(str) && (!Utility.validString(nimbleIdentityUserInfo.getDateOfBirth()) || nimbleIdentityUserInfo.getDateOfBirth().equals(this.m_overrideBirthday))) { - this.m_overrideBirthday = str; - nimbleIdentityUserInfo.setDateOfBirth(str); - } - nimbleIdentityUserInfo.setEmail((String) graphUser.get("email")); - nimbleIdentityUserInfo.setExpiryTime(new Date(System.currentTimeMillis() + ((long) (getConfiguration().getExpiryInterval() * 1000.0d)))); - synchronized (this) { - this.m_userInfo = nimbleIdentityUserInfo; - } - closeUserInfoUpdate(null, true); - HashMap hashMap = new HashMap(); - hashMap.put(Global.NIMBLE_IDENTITY_DICTIONARY_KEY_AUTHENTICATOR_ID, getAuthenticatorId()); - Utility.sendBroadcast(Global.NIMBLE_NOTIFICATION_IDENTITY_USER_INFO_UPDATE, hashMap); - } - } -} diff --git a/app/src/main/java/com/ea/nimble/identity/AuthenticatorOrigin.java b/app/src/main/java/com/ea/nimble/identity/AuthenticatorOrigin.java deleted file mode 100644 index 95423bb..0000000 --- a/app/src/main/java/com/ea/nimble/identity/AuthenticatorOrigin.java +++ /dev/null @@ -1,87 +0,0 @@ -package com.ea.nimble.identity; - -import com.ea.nimble.Base; -import com.ea.nimble.Error; -import com.ea.nimble.Global; -import com.ea.nimble.Log; -import com.ea.nimble.Utility; -import com.ea.nimble.identity.INimbleIdentityAuthenticator; -import com.ea.nimble.identity.NimbleIdentityError; -import com.ea.nimble.identity.NimbleIdentityLoginParams; -import java.util.ArrayList; - -/* loaded from: stdlib.jar:com/ea/nimble/identity/AuthenticatorOrigin.class */ -class AuthenticatorOrigin extends AuthenticatorBase { - private static final String DATA_TEMPLATE_LOGIN_WITH_ORIGIN_PASSWORD = "grant_type=password&client_id=%s&client_secret=%s&username=%s&password=%s&redirect_uri=nucleus:rest"; - private static final String PID_TYPE = "mobile_origin"; - - private AuthenticatorOrigin() { - this.TAG = "AuthenticatorOrigin"; - } - - private static void initialize() { - Log.Helper.LOGIS("AuthenticatorOrigin", "Initializing...", new Object[0]); - AuthenticatorOrigin authenticatorOrigin = new AuthenticatorOrigin(); - Base.registerComponent(authenticatorOrigin, authenticatorOrigin.getComponentId()); - } - - private void loginOrigin(String str, String str2, INimbleIdentityAuthenticator.NimbleIdentityAuthenticatorCallback nimbleIdentityAuthenticatorCallback) { - NimbleIdentityConfig configuration = getConfiguration(); - exchangeDataForToken(String.format(DATA_TEMPLATE_LOGIN_WITH_ORIGIN_PASSWORD, configuration.getClientId(), configuration.getClientSecret(), str, str2)); - } - - /* JADX INFO: Access modifiers changed from: package-private */ - @Override // com.ea.nimble.identity.AuthenticatorBase - public void autoLogin() { - closeAuthentication(new NimbleIdentityError(NimbleIdentityError.NimbleIdentityErrorCode.NIMBLE_IDENTITY_ERROR_SESSION_EXPIRED, "Cannot auto login for origin after session expired")); - } - - @Override // com.ea.nimble.identity.INimbleIdentityAuthenticator - public String getAuthenticatorId() { - return Global.NIMBLE_AUTHENTICATOR_ORIGIN; - } - - @Override // com.ea.nimble.identity.INimbleIdentityAuthenticator - public void login(NimbleIdentityLoginParams nimbleIdentityLoginParams, INimbleIdentityAuthenticator.NimbleIdentityAuthenticatorCallback nimbleIdentityAuthenticatorCallback) { - if (nimbleIdentityLoginParams instanceof NimbleIdentityLoginParams.OriginCredentialsLoginParams) { - NimbleIdentityLoginParams.OriginCredentialsLoginParams originCredentialsLoginParams = (NimbleIdentityLoginParams.OriginCredentialsLoginParams) nimbleIdentityLoginParams; - if (Utility.validString(originCredentialsLoginParams.getUsername()) && Utility.validString(originCredentialsLoginParams.getPassword())) { - synchronized (this) { - setState(INimbleIdentityAuthenticator.NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_GOING); - if (nimbleIdentityAuthenticatorCallback != null) { - this.m_authenticateCallbacks.add(nimbleIdentityAuthenticatorCallback); - } - loginOrigin(originCredentialsLoginParams.getUsername(), originCredentialsLoginParams.getPassword(), nimbleIdentityAuthenticatorCallback); - } - } else if (nimbleIdentityAuthenticatorCallback != null) { - nimbleIdentityAuthenticatorCallback.onCallback(this, new Error(Error.Code.INVALID_ARGUMENT, "Invalid username/password for Origin login")); - } - } else if (nimbleIdentityLoginParams instanceof NimbleIdentityLoginParams.OriginOAuthCodeLoginParams) { - NimbleIdentityLoginParams.OriginOAuthCodeLoginParams originOAuthCodeLoginParams = (NimbleIdentityLoginParams.OriginOAuthCodeLoginParams) nimbleIdentityLoginParams; - if (Utility.validString(originOAuthCodeLoginParams.getOauthCode())) { - synchronized (this) { - setState(INimbleIdentityAuthenticator.NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_GOING); - if (nimbleIdentityAuthenticatorCallback != null) { - this.m_authenticateCallbacks.add(nimbleIdentityAuthenticatorCallback); - } - exchangeAuthCodeToToken(originOAuthCodeLoginParams.getOauthCode()); - } - } else if (nimbleIdentityAuthenticatorCallback != null) { - nimbleIdentityAuthenticatorCallback.onCallback(this, new Error(Error.Code.INVALID_ARGUMENT, "Invalid auth code for Origin login")); - } - } else if (nimbleIdentityAuthenticatorCallback != null) { - nimbleIdentityAuthenticatorCallback.onCallback(this, new NimbleIdentityError(NimbleIdentityError.NimbleIdentityErrorCode.NIMBLE_IDENTITY_ERROR_INVALID_LOGINPARAMS, "Unrecognized login parameters")); - } - } - - @Override // com.ea.nimble.identity.INimbleIdentityAuthenticator - public void logout(INimbleIdentityAuthenticator.NimbleIdentityAuthenticatorCallback nimbleIdentityAuthenticatorCallback) { - cancelAuthentication(); - cleanAtLogout(nimbleIdentityAuthenticatorCallback); - } - - @Override // com.ea.nimble.identity.AuthenticatorBase, com.ea.nimble.identity.INimbleIdentityAuthenticator - public void requestIdentityForFriends(ArrayList arrayList, INimbleIdentityAuthenticator.NimbleIdentityFriendsIdentityInfoCallback nimbleIdentityFriendsIdentityInfoCallback) { - requestIdentityForFriends(PID_TYPE, arrayList, nimbleIdentityFriendsIdentityInfoCallback); - } -} diff --git a/app/src/main/java/com/ea/nimble/identity/INimbleIdentity.java b/app/src/main/java/com/ea/nimble/identity/INimbleIdentity.java deleted file mode 100644 index eabce34..0000000 --- a/app/src/main/java/com/ea/nimble/identity/INimbleIdentity.java +++ /dev/null @@ -1,39 +0,0 @@ -package com.ea.nimble.identity; - -import com.ea.nimble.identity.INimbleIdentityAuthenticator; -import java.util.List; -import java.util.Map; - -/* loaded from: stdlib.jar:com/ea/nimble/identity/INimbleIdentity.class */ -public interface INimbleIdentity { - public static final String EXTRA_NIMBLE_IDENTITY_AUTOREFRESH_VALUE = "nimble.identity.extra.autorefresh.value"; - public static final String MIGRATION_PERSISTENCE_ID = "nimble.notification.identity.migraiton"; - public static final String NIMBLE_COMPONENT_ID_IDENTITY = "com.ea.nimble.identity"; - public static final String NIMBLE_NOTIFICATION_IDENTITY_UPDATE = "nimble.notification.identity.update"; - public static final String NOTIFICATION_NIMBLE_IDENTITY_AUTOREFRESH_CHANGE = "nimble.identity.notification.autorefresh_changed"; - - /* loaded from: stdlib.jar:com/ea/nimble/identity/INimbleIdentity$NimbleIdentityState.class */ - public enum NimbleIdentityState { - NIMBLE_IDENTITY_READY, - NIMBLE_IDENTITY_AUTHENTICATING, - NIMBLE_IDENTITY_UNAVAILABLE - } - - INimbleIdentityAuthenticator getAuthenticatorById(String str); - - List getAuthenticators(); - - boolean getAutoRefreshFlag(); - - List getLoggedInAuthenticators(); - - Map getPidMap(); - - NimbleIdentityState getState(); - - void requestServerAuthCodeForLegacyOriginToken(String str, String str2, String str3, INimbleIdentityAuthenticator.NimbleIdentityServerAuthCodeCallback nimbleIdentityServerAuthCodeCallback); - - void setAuthenticationConductor(INimbleIdentityAuthenticationConductor iNimbleIdentityAuthenticationConductor); - - void setAutoRefreshFlag(boolean z); -} diff --git a/app/src/main/java/com/ea/nimble/identity/INimbleIdentityAuthenticationConductor.java b/app/src/main/java/com/ea/nimble/identity/INimbleIdentityAuthenticationConductor.java deleted file mode 100644 index 26f8f3b..0000000 --- a/app/src/main/java/com/ea/nimble/identity/INimbleIdentityAuthenticationConductor.java +++ /dev/null @@ -1,5 +0,0 @@ -package com.ea.nimble.identity; - -/* loaded from: stdlib.jar:com/ea/nimble/identity/INimbleIdentityAuthenticationConductor.class */ -public interface INimbleIdentityAuthenticationConductor { -} diff --git a/app/src/main/java/com/ea/nimble/identity/INimbleIdentityAuthenticator.java b/app/src/main/java/com/ea/nimble/identity/INimbleIdentityAuthenticator.java deleted file mode 100644 index 8a43694..0000000 --- a/app/src/main/java/com/ea/nimble/identity/INimbleIdentityAuthenticator.java +++ /dev/null @@ -1,70 +0,0 @@ -package com.ea.nimble.identity; - -import com.ea.nimble.Error; -import java.util.ArrayList; -import java.util.List; -import org.json.JSONObject; - -/* loaded from: stdlib.jar:com/ea/nimble/identity/INimbleIdentityAuthenticator.class */ -public interface INimbleIdentityAuthenticator { - public static final String AUTHENTICATOR_COMPONENT_PREFIX = "com.ea.nimble.identity.authenticator."; - - /* loaded from: stdlib.jar:com/ea/nimble/identity/INimbleIdentityAuthenticator$NimbleAuthenticatorAccessTokenCallback.class */ - public interface NimbleAuthenticatorAccessTokenCallback { - void AccessTokenCallback(INimbleIdentityAuthenticator iNimbleIdentityAuthenticator, String str, String str2, Error error); - } - - /* loaded from: stdlib.jar:com/ea/nimble/identity/INimbleIdentityAuthenticator$NimbleIdentityAuthenticationState.class */ - public enum NimbleIdentityAuthenticationState { - NIMBLE_IDENTITY_AUTHENTICATION_UNAVAILABLE, - NIMBLE_IDENTITY_AUTHENTICATION_NONE, - NIMBLE_IDENTITY_AUTHENTICATION_GOING, - NIMBLE_IDENTITY_AUTHENTICATION_SUCCESS, - NIMBLE_IDENTITY_AUTHENTICATION_OFFLINE - } - - /* loaded from: stdlib.jar:com/ea/nimble/identity/INimbleIdentityAuthenticator$NimbleIdentityAuthenticatorCallback.class */ - public interface NimbleIdentityAuthenticatorCallback { - void onCallback(INimbleIdentityAuthenticator iNimbleIdentityAuthenticator, Error error); - } - - /* loaded from: stdlib.jar:com/ea/nimble/identity/INimbleIdentityAuthenticator$NimbleIdentityFriendsIdentityInfoCallback.class */ - public interface NimbleIdentityFriendsIdentityInfoCallback { - void onCallback(INimbleIdentityAuthenticator iNimbleIdentityAuthenticator, JSONObject jSONObject, Error error); - } - - /* loaded from: stdlib.jar:com/ea/nimble/identity/INimbleIdentityAuthenticator$NimbleIdentityServerAuthCodeCallback.class */ - public interface NimbleIdentityServerAuthCodeCallback { - void onCallback(INimbleIdentityAuthenticator iNimbleIdentityAuthenticator, String str, String str2, String str3, Error error); - } - - String getAuthenticatorId(); - - NimbleIdentityPersona getPersonaByNamespace(String str, long j); - - NimbleIdentityPersona getPersonaByNamespace(String str, String str2); - - List getPersonas(); - - NimbleIdentityPidInfo getPidInfo(); - - NimbleIdentityAuthenticationState getState(); - - NimbleIdentityUserInfo getUserInfo(); - - void login(NimbleIdentityLoginParams nimbleIdentityLoginParams, NimbleIdentityAuthenticatorCallback nimbleIdentityAuthenticatorCallback); - - void logout(NimbleIdentityAuthenticatorCallback nimbleIdentityAuthenticatorCallback); - - void refreshPersonas(NimbleIdentityAuthenticatorCallback nimbleIdentityAuthenticatorCallback); - - void refreshPidInfo(NimbleIdentityAuthenticatorCallback nimbleIdentityAuthenticatorCallback); - - void refreshUserInfo(NimbleIdentityAuthenticatorCallback nimbleIdentityAuthenticatorCallback); - - void requestAccessToken(NimbleAuthenticatorAccessTokenCallback nimbleAuthenticatorAccessTokenCallback); - - void requestAuthCode(String str, String str2, NimbleIdentityServerAuthCodeCallback nimbleIdentityServerAuthCodeCallback); - - void requestIdentityForFriends(ArrayList arrayList, NimbleIdentityFriendsIdentityInfoCallback nimbleIdentityFriendsIdentityInfoCallback) throws Exception; -} diff --git a/app/src/main/java/com/ea/nimble/identity/INimbleIdentityGenericAuthenticationConductor.java b/app/src/main/java/com/ea/nimble/identity/INimbleIdentityGenericAuthenticationConductor.java deleted file mode 100644 index ae2cdd5..0000000 --- a/app/src/main/java/com/ea/nimble/identity/INimbleIdentityGenericAuthenticationConductor.java +++ /dev/null @@ -1,8 +0,0 @@ -package com.ea.nimble.identity; - -/* loaded from: stdlib.jar:com/ea/nimble/identity/INimbleIdentityGenericAuthenticationConductor.class */ -public interface INimbleIdentityGenericAuthenticationConductor extends INimbleIdentityAuthenticationConductor { - void handleLogin(INimbleIdentityGenericLoginResolver iNimbleIdentityGenericLoginResolver); - - void handleLogout(INimbleIdentityGenericLogoutResolver iNimbleIdentityGenericLogoutResolver); -} diff --git a/app/src/main/java/com/ea/nimble/identity/INimbleIdentityGenericLoginResolver.java b/app/src/main/java/com/ea/nimble/identity/INimbleIdentityGenericLoginResolver.java deleted file mode 100644 index bacaac0..0000000 --- a/app/src/main/java/com/ea/nimble/identity/INimbleIdentityGenericLoginResolver.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.ea.nimble.identity; - -import com.ea.nimble.identity.INimbleIdentityAuthenticator; -import java.util.List; - -/* loaded from: stdlib.jar:com/ea/nimble/identity/INimbleIdentityGenericLoginResolver.class */ -public interface INimbleIdentityGenericLoginResolver { - List getLoggedInAuthenticatorIds(); - - String getLoggingInAuthenticatorId(); - - void highlight(); - - void ignore(); - - void switchAuthenticators(INimbleIdentityAuthenticator.NimbleIdentityAuthenticatorCallback nimbleIdentityAuthenticatorCallback); -} diff --git a/app/src/main/java/com/ea/nimble/identity/INimbleIdentityGenericLogoutResolver.java b/app/src/main/java/com/ea/nimble/identity/INimbleIdentityGenericLogoutResolver.java deleted file mode 100644 index e0cb3ad..0000000 --- a/app/src/main/java/com/ea/nimble/identity/INimbleIdentityGenericLogoutResolver.java +++ /dev/null @@ -1,12 +0,0 @@ -package com.ea.nimble.identity; - -import java.util.List; - -/* loaded from: stdlib.jar:com/ea/nimble/identity/INimbleIdentityGenericLogoutResolver.class */ -public interface INimbleIdentityGenericLogoutResolver { - String getLoggingOutAuthenticatorId(); - - List getStillLoggedInAuthenticatorIds(); - - void resolve(String str); -} diff --git a/app/src/main/java/com/ea/nimble/identity/INimbleIdentityMigrationAuthenticationConductor.java b/app/src/main/java/com/ea/nimble/identity/INimbleIdentityMigrationAuthenticationConductor.java deleted file mode 100644 index 8aa88c9..0000000 --- a/app/src/main/java/com/ea/nimble/identity/INimbleIdentityMigrationAuthenticationConductor.java +++ /dev/null @@ -1,10 +0,0 @@ -package com.ea.nimble.identity; - -/* loaded from: stdlib.jar:com/ea/nimble/identity/INimbleIdentityMigrationAuthenticationConductor.class */ -public interface INimbleIdentityMigrationAuthenticationConductor extends INimbleIdentityAuthenticationConductor { - void handleLogin(INimbleIdentityMigrationLoginResolver iNimbleIdentityMigrationLoginResolver); - - void handleLogout(); - - void handlePendingMigration(INimbleIdentityPendingMigrationResolver iNimbleIdentityPendingMigrationResolver); -} diff --git a/app/src/main/java/com/ea/nimble/identity/INimbleIdentityMigrationLoginResolver.java b/app/src/main/java/com/ea/nimble/identity/INimbleIdentityMigrationLoginResolver.java deleted file mode 100644 index 004cf7d..0000000 --- a/app/src/main/java/com/ea/nimble/identity/INimbleIdentityMigrationLoginResolver.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.ea.nimble.identity; - -import com.ea.nimble.identity.INimbleIdentityAuthenticator; -import java.util.List; - -/* loaded from: stdlib.jar:com/ea/nimble/identity/INimbleIdentityMigrationLoginResolver.class */ -public interface INimbleIdentityMigrationLoginResolver { - List getLoggedInAuthenticatorIds(); - - String getLoggingInAuthenticatorId(); - - void ignore(); - - void migrate(INimbleIdentityAuthenticator.NimbleIdentityAuthenticatorCallback nimbleIdentityAuthenticatorCallback); - - void switchAuthenticators(INimbleIdentityAuthenticator.NimbleIdentityAuthenticatorCallback nimbleIdentityAuthenticatorCallback); -} diff --git a/app/src/main/java/com/ea/nimble/identity/INimbleIdentityMigrationLogoutResolver.java b/app/src/main/java/com/ea/nimble/identity/INimbleIdentityMigrationLogoutResolver.java deleted file mode 100644 index 74b3c18..0000000 --- a/app/src/main/java/com/ea/nimble/identity/INimbleIdentityMigrationLogoutResolver.java +++ /dev/null @@ -1,12 +0,0 @@ -package com.ea.nimble.identity; - -import java.util.List; - -/* loaded from: stdlib.jar:com/ea/nimble/identity/INimbleIdentityMigrationLogoutResolver.class */ -public interface INimbleIdentityMigrationLogoutResolver { - String getLoggingOutAuthenticatorId(); - - List getStillLoggedInAuthenticatorIds(); - - void resolve(String str); -} diff --git a/app/src/main/java/com/ea/nimble/identity/INimbleIdentityPendingMigrationResolver.java b/app/src/main/java/com/ea/nimble/identity/INimbleIdentityPendingMigrationResolver.java deleted file mode 100644 index 998aaf4..0000000 --- a/app/src/main/java/com/ea/nimble/identity/INimbleIdentityPendingMigrationResolver.java +++ /dev/null @@ -1,12 +0,0 @@ -package com.ea.nimble.identity; - -import com.ea.nimble.identity.INimbleIdentityAuthenticator; - -/* loaded from: stdlib.jar:com/ea/nimble/identity/INimbleIdentityPendingMigrationResolver.class */ -public interface INimbleIdentityPendingMigrationResolver { - String getMigrationSourceAuthenticatorId(); - - String getMigrationTargetAuthenticatorId(); - - void resume(INimbleIdentityAuthenticator.NimbleIdentityAuthenticatorCallback nimbleIdentityAuthenticatorCallback); -} diff --git a/app/src/main/java/com/ea/nimble/identity/INimbleIdentityPlainAuthenticationConductor.java b/app/src/main/java/com/ea/nimble/identity/INimbleIdentityPlainAuthenticationConductor.java deleted file mode 100644 index 8b3bed5..0000000 --- a/app/src/main/java/com/ea/nimble/identity/INimbleIdentityPlainAuthenticationConductor.java +++ /dev/null @@ -1,8 +0,0 @@ -package com.ea.nimble.identity; - -/* loaded from: stdlib.jar:com/ea/nimble/identity/INimbleIdentityPlainAuthenticationConductor.class */ -public interface INimbleIdentityPlainAuthenticationConductor extends INimbleIdentityAuthenticationConductor { - void handleLogin(); - - void handleLogout(); -} diff --git a/app/src/main/java/com/ea/nimble/identity/NimbleIdentity.java b/app/src/main/java/com/ea/nimble/identity/NimbleIdentity.java deleted file mode 100644 index 099e3a5..0000000 --- a/app/src/main/java/com/ea/nimble/identity/NimbleIdentity.java +++ /dev/null @@ -1,12 +0,0 @@ -package com.ea.nimble.identity; - -import com.ea.nimble.Base; - -/* loaded from: stdlib.jar:com/ea/nimble/identity/NimbleIdentity.class */ -public class NimbleIdentity { - public static final String COMPONENT_ID = "com.ea.nimble.identity"; - - public static INimbleIdentity getComponent() { - return (INimbleIdentity) Base.getComponent("com.ea.nimble.identity"); - } -} diff --git a/app/src/main/java/com/ea/nimble/identity/NimbleIdentityAuthenticationConductorHandler.java b/app/src/main/java/com/ea/nimble/identity/NimbleIdentityAuthenticationConductorHandler.java deleted file mode 100644 index ad67629..0000000 --- a/app/src/main/java/com/ea/nimble/identity/NimbleIdentityAuthenticationConductorHandler.java +++ /dev/null @@ -1,8 +0,0 @@ -package com.ea.nimble.identity; - -/* loaded from: stdlib.jar:com/ea/nimble/identity/NimbleIdentityAuthenticationConductorHandler.class */ -interface NimbleIdentityAuthenticationConductorHandler { - void handleLogin(INimbleIdentityAuthenticator iNimbleIdentityAuthenticator, boolean z); - - void handleLogout(INimbleIdentityAuthenticator iNimbleIdentityAuthenticator); -} diff --git a/app/src/main/java/com/ea/nimble/identity/NimbleIdentityConfig.java b/app/src/main/java/com/ea/nimble/identity/NimbleIdentityConfig.java deleted file mode 100644 index 61780ed..0000000 --- a/app/src/main/java/com/ea/nimble/identity/NimbleIdentityConfig.java +++ /dev/null @@ -1,105 +0,0 @@ -package com.ea.nimble.identity; - -import android.content.BroadcastReceiver; -import android.content.Context; -import android.content.Intent; -import com.ea.nimble.Log; -import com.ea.nimble.LogSource; -import com.ea.nimble.SynergyEnvironment; -import com.ea.nimble.Utility; - -/* JADX INFO: Access modifiers changed from: package-private */ -/* loaded from: stdlib.jar:com/ea/nimble/identity/NimbleIdentityConfig.class */ -public class NimbleIdentityConfig implements LogSource { - private static final double DEFAULT_DATA_EXPIRY_INTERVAL = 3600.0d; - private static final String META_DATA_TAG_CLIENT_ID = "com.ea.nimble.identity.client_id"; - private static final String META_DATA_TAG_CLIENT_SECRET = "com.ea.nimble.identity.client_secret"; - static final String NOTIFICATION_IDENTITY_CONFIGURATION_CHANGE = "nimble.notification.identity.configuration.change"; - private boolean m_autoRefresh; - private String m_clientId; - private String m_clientSecret; - private String m_connectServerUrl; - private String m_portalServerUrl; - private String m_proxyServerUrl; - private boolean m_ready; - private double m_expiryInterval = DEFAULT_DATA_EXPIRY_INTERVAL; - private BroadcastReceiver m_receiver = new BroadcastReceiver() { // from class: com.ea.nimble.identity.NimbleIdentityConfig.1 - @Override // android.content.BroadcastReceiver - public void onReceive(Context context, Intent intent) { - NimbleIdentityConfig.this.onUpdate(); - } - }; - - /* JADX WARN: Code restructure failed: missing block: B:22:0x00ac, code lost: - if (r0.length() <= 0) goto L_0x00af; - */ - /* JADX WARN: Code restructure failed: missing block: B:33:0x00fe, code lost: - if (r0.length() <= 0) goto L_0x0101; - */ - /* - Code decompiled incorrectly, please refer to instructions dump. - To view partially-correct code enable 'Show inconsistent code' option in preferences - */ - public void onUpdate() { - /* - Method dump skipped, instructions count: 438 - To view this dump change 'Code comments level' option to 'DEBUG' - */ - throw new UnsupportedOperationException("Method not decompiled: com.ea.nimble.identity.NimbleIdentityConfig.onUpdate():void"); - } - - public boolean getAutoRefresh() { - return this.m_autoRefresh; - } - - public String getClientId() { - return this.m_clientId; - } - - public String getClientSecret() { - return this.m_clientSecret; - } - - public String getConnectServerUrl() { - return this.m_connectServerUrl; - } - - public double getExpiryInterval() { - return this.m_expiryInterval; - } - - @Override // com.ea.nimble.LogSource - public String getLogSourceTitle() { - return "Identity"; - } - - public String getPortalServerUrl() { - return this.m_portalServerUrl; - } - - public String getProxyServerUrl() { - return this.m_proxyServerUrl; - } - - public void initialize() { - this.m_ready = false; - this.m_autoRefresh = false; - if (SynergyEnvironment.getComponent().isDataAvailable()) { - onUpdate(); - } - Utility.registerReceiver(SynergyEnvironment.NOTIFICATION_STARTUP_ENVIRONMENT_DATA_CHANGED, this.m_receiver); - Log.Helper.LOGV(this, "Configuration initiailized", new Object[0]); - } - - public boolean isReady() { - return this.m_ready; - } - - public void setAutoRefresh(boolean z) { - this.m_autoRefresh = z; - } - - void uninitialize() { - Utility.unregisterReceiver(this.m_receiver); - } -} diff --git a/app/src/main/java/com/ea/nimble/identity/NimbleIdentityError.java b/app/src/main/java/com/ea/nimble/identity/NimbleIdentityError.java deleted file mode 100644 index 2444ccf..0000000 --- a/app/src/main/java/com/ea/nimble/identity/NimbleIdentityError.java +++ /dev/null @@ -1,75 +0,0 @@ -package com.ea.nimble.identity; - -import com.ea.nimble.Error; -import com.ea.nimble.tracking.NimbleTrackingS2SImpl; - -import java.util.Map; - -/* loaded from: stdlib.jar:com/ea/nimble/identity/NimbleIdentityError.class */ -public class NimbleIdentityError extends Error { - public static final String NIMBLE_IDENTITY_ERROR_DOMAIN = "NimbleIdentityError"; - private static final long serialVersionUID = 1; - - /* loaded from: stdlib.jar:com/ea/nimble/identity/NimbleIdentityError$NimbleIdentityErrorCode.class */ - public enum NimbleIdentityErrorCode { - NIMBLE_IDENTITY_ERROR_USER_CANCELLED(100), - NIMBLE_IDENTITY_ERROR_UNSUPPORTED_ACTION(NimbleTrackingS2SImpl.EVENT_APPSTARTED_AFTERINSTALL), - NIMBLE_IDENTITY_ERROR_UNAUTHENTICATED(1001), - NIMBLE_IDENTITY_ERROR_SESSION_EXPIRED(1002), - NIMBLE_IDENTITY_ERROR_INVALID_LOGINPARAMS(1003), - NIMBLE_IDENTITY_ERROR_REFRESH_USER_INFO_FROM_FIRST_PARTY(1101), - NIMBLE_IDENTITY_ERROR_REFRESH_USER_INFO_FROM_PID_INFO(1102), - NIMBLE_IDENTITY_ERROR_BAD_CLIENT_ID(1500), - NIMBLE_IDENTITY_ERROR_BAD_CLIENT_SECRET(1501), - NIMBLE_IDENTITY_ERROR_INVALID_REQUEST(1502), - NIMBLE_IDENTITY_ERROR_INVALID_OAUTH_INFO(1503), - NIMBLE_IDENTITY_ERROR_MIGRATION_SOURCE_INVALID(9101), - NIMBLE_IDENTITY_ERROR_MIGRATION_TARGET_INVALID(9102), - NIMBLE_IDENTITY_ERROR_MIGRATION_NOT_AUTHENTICATED(9103), - NIMBLE_IDENTITY_ERROR_MIGRATION_NO_ACCESS_TOKENS(9104), - NIMBLE_IDENTITY_ERROR_MIGRATION_NO_URL(9105), - NIMBLE_IDENTITY_ERROR_MIGRATION_FAILED(9106), - NIMBLE_IDENTITY_ERROR_UNKNOWN(Integer.MAX_VALUE); - - private int m_value; - - NimbleIdentityErrorCode(int i) { - this.m_value = i; - } - - public int intValue() { - return this.m_value; - } - } - - public NimbleIdentityError(int i, String str) { - super(NIMBLE_IDENTITY_ERROR_DOMAIN, i, str, null); - } - - public NimbleIdentityError(int i, String str, Throwable th) { - super(Error.ERROR_DOMAIN, i, str, th); - } - - public NimbleIdentityError(NimbleIdentityErrorCode nimbleIdentityErrorCode, String str) { - super(NIMBLE_IDENTITY_ERROR_DOMAIN, nimbleIdentityErrorCode.intValue(), str, null); - } - - public static NimbleIdentityError createWithData(Map map) { - String str = (String) map.get("error"); - NimbleIdentityErrorCode parseErrorCode = parseErrorCode(str); - String str2 = (String) map.get("error_description"); - String str3 = str2; - if (str2 == null) { - str3 = str; - } - return new NimbleIdentityError(parseErrorCode, str3); - } - - private static NimbleIdentityErrorCode parseErrorCode(String str) { - return str.equals("invalid_request") ? NimbleIdentityErrorCode.NIMBLE_IDENTITY_ERROR_INVALID_REQUEST : str.equals("invalid_oauth_info") ? NimbleIdentityErrorCode.NIMBLE_IDENTITY_ERROR_INVALID_OAUTH_INFO : NimbleIdentityErrorCode.NIMBLE_IDENTITY_ERROR_UNKNOWN; - } - - public boolean isError(int i) { - return getCode() == i; - } -} diff --git a/app/src/main/java/com/ea/nimble/identity/NimbleIdentityGenericAuthenticationConductorHandler.java b/app/src/main/java/com/ea/nimble/identity/NimbleIdentityGenericAuthenticationConductorHandler.java deleted file mode 100644 index f34b5f2..0000000 --- a/app/src/main/java/com/ea/nimble/identity/NimbleIdentityGenericAuthenticationConductorHandler.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.ea.nimble.identity; - -/* loaded from: stdlib.jar:com/ea/nimble/identity/NimbleIdentityGenericAuthenticationConductorHandler.class */ -class NimbleIdentityGenericAuthenticationConductorHandler implements NimbleIdentityAuthenticationConductorHandler { - private NimbleIdentityGenericLoginResolver loginResolver; - private NimbleIdentityGenericLogoutResolver logoutResolver; - private INimbleIdentityGenericAuthenticationConductor m_conductor; - - /* JADX INFO: Access modifiers changed from: package-private */ - public NimbleIdentityGenericAuthenticationConductorHandler(INimbleIdentityAuthenticationConductor iNimbleIdentityAuthenticationConductor) { - this.m_conductor = (INimbleIdentityGenericAuthenticationConductor) iNimbleIdentityAuthenticationConductor; - } - - @Override // com.ea.nimble.identity.NimbleIdentityAuthenticationConductorHandler - public void handleLogin(INimbleIdentityAuthenticator iNimbleIdentityAuthenticator, boolean z) { - this.loginResolver = new NimbleIdentityGenericLoginResolver(iNimbleIdentityAuthenticator); - this.m_conductor.handleLogin(this.loginResolver); - } - - @Override // com.ea.nimble.identity.NimbleIdentityAuthenticationConductorHandler - public void handleLogout(INimbleIdentityAuthenticator iNimbleIdentityAuthenticator) { - this.logoutResolver = new NimbleIdentityGenericLogoutResolver(iNimbleIdentityAuthenticator); - this.m_conductor.handleLogout(this.logoutResolver); - } -} diff --git a/app/src/main/java/com/ea/nimble/identity/NimbleIdentityGenericLoginResolver.java b/app/src/main/java/com/ea/nimble/identity/NimbleIdentityGenericLoginResolver.java deleted file mode 100644 index d67ba03..0000000 --- a/app/src/main/java/com/ea/nimble/identity/NimbleIdentityGenericLoginResolver.java +++ /dev/null @@ -1,51 +0,0 @@ -package com.ea.nimble.identity; - -import com.ea.nimble.Global; -import com.ea.nimble.Log; -import com.ea.nimble.identity.INimbleIdentityAuthenticator; -import java.util.ArrayList; -import java.util.List; - -/* loaded from: stdlib.jar:com/ea/nimble/identity/NimbleIdentityGenericLoginResolver.class */ -class NimbleIdentityGenericLoginResolver implements INimbleIdentityGenericLoginResolver { - private INimbleIdentityAuthenticator m_authenticator; - private String m_authenticatorId; - private ArrayList m_loggedInAuthenticatorIds; - - public NimbleIdentityGenericLoginResolver(INimbleIdentityAuthenticator iNimbleIdentityAuthenticator) { - if (iNimbleIdentityAuthenticator != null) { - this.m_authenticator = iNimbleIdentityAuthenticator; - this.m_authenticatorId = iNimbleIdentityAuthenticator.getAuthenticatorId(); - this.m_loggedInAuthenticatorIds = new ArrayList<>(); - for (INimbleIdentityAuthenticator iNimbleIdentityAuthenticator2 : NimbleIdentity.getComponent().getLoggedInAuthenticators()) { - this.m_loggedInAuthenticatorIds.add(iNimbleIdentityAuthenticator2.getAuthenticatorId()); - } - } - } - - @Override // com.ea.nimble.identity.INimbleIdentityGenericLoginResolver - public List getLoggedInAuthenticatorIds() { - return this.m_loggedInAuthenticatorIds; - } - - @Override // com.ea.nimble.identity.INimbleIdentityGenericLoginResolver - public String getLoggingInAuthenticatorId() { - return this.m_authenticatorId; - } - - @Override // com.ea.nimble.identity.INimbleIdentityGenericLoginResolver - public void highlight() { - NimbleIdentityImpl.getComponent().highlight(this.m_authenticator); - } - - @Override // com.ea.nimble.identity.INimbleIdentityGenericLoginResolver - public void ignore() { - Log.Helper.LOGI(this, "Game decided to resolve login of %s by ignoring", this.m_authenticatorId); - } - - @Override // com.ea.nimble.identity.INimbleIdentityGenericLoginResolver - public void switchAuthenticators(INimbleIdentityAuthenticator.NimbleIdentityAuthenticatorCallback nimbleIdentityAuthenticatorCallback) { - NimbleIdentityImpl component = NimbleIdentityImpl.getComponent(); - component.switchAuthenticators(nimbleIdentityAuthenticatorCallback, this.m_authenticator, component.getAuthenticatorById(Global.NIMBLE_AUTHENTICATOR_ANONYMOUS)); - } -} diff --git a/app/src/main/java/com/ea/nimble/identity/NimbleIdentityGenericLogoutResolver.java b/app/src/main/java/com/ea/nimble/identity/NimbleIdentityGenericLogoutResolver.java deleted file mode 100644 index 24fa5c0..0000000 --- a/app/src/main/java/com/ea/nimble/identity/NimbleIdentityGenericLogoutResolver.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.ea.nimble.identity; - -import com.ea.nimble.Utility; -import java.util.ArrayList; -import java.util.List; - -/* loaded from: stdlib.jar:com/ea/nimble/identity/NimbleIdentityGenericLogoutResolver.class */ -public class NimbleIdentityGenericLogoutResolver implements INimbleIdentityGenericLogoutResolver { - private String m_authenticatorId; - private ArrayList m_stillLoggedInAuthenticatorIds = new ArrayList<>(); - - public NimbleIdentityGenericLogoutResolver(INimbleIdentityAuthenticator iNimbleIdentityAuthenticator) { - this.m_authenticatorId = iNimbleIdentityAuthenticator.getAuthenticatorId(); - for (INimbleIdentityAuthenticator iNimbleIdentityAuthenticator2 : NimbleIdentity.getComponent().getLoggedInAuthenticators()) { - this.m_stillLoggedInAuthenticatorIds.add(iNimbleIdentityAuthenticator2.getAuthenticatorId()); - } - } - - @Override // com.ea.nimble.identity.INimbleIdentityGenericLogoutResolver - public String getLoggingOutAuthenticatorId() { - return this.m_authenticatorId; - } - - @Override // com.ea.nimble.identity.INimbleIdentityGenericLogoutResolver - public List getStillLoggedInAuthenticatorIds() { - return this.m_stillLoggedInAuthenticatorIds; - } - - @Override // com.ea.nimble.identity.INimbleIdentityGenericLogoutResolver - public void resolve(String str) { - INimbleIdentityAuthenticator authenticatorById; - if (Utility.validString(str) && (authenticatorById = NimbleIdentityImpl.getComponent().getAuthenticatorById(str)) != null) { - NimbleIdentityImpl.getComponent().resolveLogout(authenticatorById); - } - } -} diff --git a/app/src/main/java/com/ea/nimble/identity/NimbleIdentityImpl.java b/app/src/main/java/com/ea/nimble/identity/NimbleIdentityImpl.java deleted file mode 100644 index 3aca7f7..0000000 --- a/app/src/main/java/com/ea/nimble/identity/NimbleIdentityImpl.java +++ /dev/null @@ -1,558 +0,0 @@ -package com.ea.nimble.identity; - -import android.content.BroadcastReceiver; -import android.content.Context; -import android.content.Intent; -import com.ea.nimble.Base; -import com.ea.nimble.Component; -import com.ea.nimble.Error; -import com.ea.nimble.Global; -import com.ea.nimble.HttpRequest; -import com.ea.nimble.IHttpRequest; -import com.ea.nimble.Log; -import com.ea.nimble.LogSource; -import com.ea.nimble.Network; -import com.ea.nimble.NetworkConnectionCallback; -import com.ea.nimble.NetworkConnectionHandle; -import com.ea.nimble.Persistence; -import com.ea.nimble.PersistenceService; -import com.ea.nimble.SynergyEnvironment; -import com.ea.nimble.Utility; -import com.ea.nimble.identity.INimbleIdentity; -import com.ea.nimble.identity.INimbleIdentityAuthenticator; -import com.ea.nimble.identity.NimbleIdentityError; -import com.ea.nimble.tracking.ITracking; -import com.ea.nimble.tracking.Tracking; -import java.io.ByteArrayOutputStream; -import java.io.IOException; -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.Map; -import java.util.UUID; - -/* loaded from: stdlib.jar:com/ea/nimble/identity/NimbleIdentityImpl.class */ -public class NimbleIdentityImpl extends Component implements LogSource, INimbleIdentity { - private static final String DATA_TEMPLATE_MIGRATE = "?client_id=%s&tuid=%s"; - private static final String REQUEST_HEADER_CONTENT_TYPE_KEY = "Content-type"; - private static final String REQUEST_HEADER_CONTENT_TYPE_VALUE = "application/x-www-form-urlencoded"; - private static final String REQUEST_HEADER_SOURCE_AT_KEY = "X-SOURCE-ACCESS-TOKEN"; - private static final String REQUEST_HEADER_TARGET_AT_KEY = "X-TARGET-ACCESS-TOKEN"; - private static final String URL_TEMPLATE_MIGRATE = "%s/connect/migrate"; - private static final String URL_TEMPLATE_REQUEST_SERVER_AUTHENTICATION_OAUTH_CODE = "%s/connect/auth?client_id=%s&response_type=code&access_token=%s&redirect_uri=nucleus:rest"; - private INimbleIdentityAuthenticationConductor m_authenticationConductor; - private NimbleIdentityAuthenticationConductorHandler m_authenticationConductorHandler; - private INimbleIdentityAuthenticator m_mainAuthenticator; - private INimbleIdentity.NimbleIdentityState m_state = INimbleIdentity.NimbleIdentityState.NIMBLE_IDENTITY_UNAVAILABLE; - private HashMap m_authenticators = new HashMap<>(); - private NimbleIdentityConfig m_configuration = new NimbleIdentityConfig(); - private HashMap m_pidMap = new HashMap<>(); - private final BroadcastReceiver m_authenticationUpdateReceiver = new BroadcastReceiver() { // from class: com.ea.nimble.identity.NimbleIdentityImpl.1 - @Override // android.content.BroadcastReceiver - public void onReceive(Context context, Intent intent) { - NimbleIdentityImpl.this.onAuthenticatorStateChange(); - } - }; - private final BroadcastReceiver m_pidInfoUpdateReceiver = new BroadcastReceiver() { // from class: com.ea.nimble.identity.NimbleIdentityImpl.2 - @Override // android.content.BroadcastReceiver - public void onReceive(Context context, Intent intent) { - NimbleIdentityImpl.this.onPidInfoUpdate(); - } - }; - - private NimbleIdentityImpl() { - } - - private String getAndValidateTokenForMigration(String str) { - String accessToken = getAuthenticatorBaseById(str).getAccessToken().getAccessToken(); - String str2 = accessToken; - if (!Utility.validString(accessToken)) { - str2 = null; - } - return str2; - } - - public static NimbleIdentityImpl getComponent() { - return (NimbleIdentityImpl) Base.getComponent("com.ea.nimble.identity"); - } - - private static void initialize() { - Base.registerComponent(new NimbleIdentityImpl(), "com.ea.nimble.identity"); - } - - private String loadMainAuthenticator() { - Persistence persistenceForNimbleComponent = PersistenceService.getPersistenceForNimbleComponent(getComponentId(), Persistence.Storage.DOCUMENT); - if (persistenceForNimbleComponent != null) { - return persistenceForNimbleComponent.getStringValue("mainAuthenticatorId"); - } - return null; - } - - public void onAuthenticatorStateChange() { - synchronized (this) { - Iterator it = this.m_authenticators.values().iterator(); - while (true) { - if (it.hasNext()) { - if (it.next().getState() == INimbleIdentityAuthenticator.NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_GOING) { - setState(INimbleIdentity.NimbleIdentityState.NIMBLE_IDENTITY_AUTHENTICATING); - break; - } - } else { - setState(INimbleIdentity.NimbleIdentityState.NIMBLE_IDENTITY_READY); - break; - } - } - } - } - - public void onPidInfoUpdate() { - HashMap hashMap = new HashMap<>(); - for (INimbleIdentityAuthenticator iNimbleIdentityAuthenticator : this.m_authenticators.values()) { - NimbleIdentityPidInfo pidInfo = iNimbleIdentityAuthenticator.getPidInfo(); - if (pidInfo != null) { - hashMap.put(iNimbleIdentityAuthenticator.getAuthenticatorId(), pidInfo.getPid()); - } - } - synchronized (this) { - this.m_pidMap = hashMap; - } - } - - private void saveMainAuthenticator(String str) { - Persistence persistenceForNimbleComponent = PersistenceService.getPersistenceForNimbleComponent(getComponentId(), Persistence.Storage.DOCUMENT); - if (persistenceForNimbleComponent != null) { - persistenceForNimbleComponent.setValue("mainAuthenticatorId", str); - } - } - - private Error validateMigrationIds(String str, String str2) { - if (str == null || str.length() <= 0) { - Log.Helper.LOGE(this, "Source authenticator ID is either null or empty", new Object[0]); - return new NimbleIdentityError(NimbleIdentityError.NimbleIdentityErrorCode.NIMBLE_IDENTITY_ERROR_MIGRATION_SOURCE_INVALID, "Source authenticator ID is either null or empty"); - } else if (str2 == null || str2.length() <= 0) { - Log.Helper.LOGE(this, "Target authenticator ID is either null or empty", new Object[0]); - return new NimbleIdentityError(NimbleIdentityError.NimbleIdentityErrorCode.NIMBLE_IDENTITY_ERROR_MIGRATION_TARGET_INVALID, "Target authenticator ID is either null or empty"); - } else if (!str.equals(Global.NIMBLE_AUTHENTICATOR_ANONYMOUS)) { - Log.Helper.LOGE(this, "Source authenticator must be anonymous", new Object[0]); - return new NimbleIdentityError(NimbleIdentityError.NimbleIdentityErrorCode.NIMBLE_IDENTITY_ERROR_MIGRATION_SOURCE_INVALID, "Source authenticator must be anonymous"); - } else if (str2.equals(Global.NIMBLE_AUTHENTICATOR_ANONYMOUS)) { - Log.Helper.LOGE(this, "Target authenticator cannot be anonymous", new Object[0]); - return new NimbleIdentityError(NimbleIdentityError.NimbleIdentityErrorCode.NIMBLE_IDENTITY_ERROR_MIGRATION_TARGET_INVALID, "Target authenticator cannot be anonymous"); - } else { - INimbleIdentityAuthenticator authenticatorById = getAuthenticatorById(str); - if (authenticatorById == null || authenticatorById.getState() != INimbleIdentityAuthenticator.NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_SUCCESS) { - Log.Helper.LOGE(this, "Source authenticator is not logged in", new Object[0]); - return new NimbleIdentityError(NimbleIdentityError.NimbleIdentityErrorCode.NIMBLE_IDENTITY_ERROR_MIGRATION_NOT_AUTHENTICATED, "Source authenticator is not logged in"); - } - INimbleIdentityAuthenticator authenticatorById2 = getAuthenticatorById(str2); - if (authenticatorById2 != null && authenticatorById2.getState() == INimbleIdentityAuthenticator.NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_SUCCESS) { - return null; - } - Log.Helper.LOGE(this, "Target authenticator is not logged in", new Object[0]); - return new NimbleIdentityError(NimbleIdentityError.NimbleIdentityErrorCode.NIMBLE_IDENTITY_ERROR_MIGRATION_NOT_AUTHENTICATED, "Target authenticator is not logged in"); - } - } - - @Override // com.ea.nimble.Component - public void cleanup() { - Utility.unregisterReceiver(this.m_authenticationUpdateReceiver); - Utility.unregisterReceiver(this.m_pidInfoUpdateReceiver); - } - - public void completeMigration(INimbleIdentityAuthenticator iNimbleIdentityAuthenticator, INimbleIdentityAuthenticator iNimbleIdentityAuthenticator2, INimbleIdentityAuthenticator.NimbleIdentityAuthenticatorCallback nimbleIdentityAuthenticatorCallback) { - Log.Helper.LOGD(this, "Account migration successful", new Object[0]); - Component component = Base.getComponent(Tracking.COMPONENT_ID); - if (component != null) { - ITracking iTracking = (ITracking) component; - HashMap hashMap = new HashMap(); - HashMap hashMap2 = new HashMap(); - hashMap2.put(iNimbleIdentityAuthenticator.getAuthenticatorId(), iNimbleIdentityAuthenticator.getPidInfo().getPid()); - hashMap.put(Tracking.NIMBLE_TRACKING_KEY_IDENTITY_MAP_SOURCE, Utility.convertObjectToJSONString(hashMap2)); - HashMap hashMap3 = new HashMap(); - hashMap3.put(iNimbleIdentityAuthenticator2.getAuthenticatorId(), iNimbleIdentityAuthenticator2.getPidInfo().getPid()); - hashMap.put(Tracking.NIMBLE_TRACKING_KEY_IDENTITY_MAP_TARGET, Utility.convertObjectToJSONString(hashMap3)); - hashMap.put(Tracking.NIMBLE_TRACKING_KEY_MIGRATION_GAME_TRIGGERED, Global.NOTIFICATION_DICTIONARY_RESULT_FAIL); - iTracking.logEvent(Tracking.NIMBLE_TRACKING_EVENT_IDENTITY_MIGRATION, hashMap); - } - setMainAuthenticator(iNimbleIdentityAuthenticator2); - getAuthenticatorBaseById(iNimbleIdentityAuthenticator.getAuthenticatorId()).completeMigration(); - Persistence persistenceForNimbleComponent = PersistenceService.getPersistenceForNimbleComponent("com.ea.nimble.identity", Persistence.Storage.DOCUMENT); - persistenceForNimbleComponent.setValue(INimbleIdentity.MIGRATION_PERSISTENCE_ID, null); - persistenceForNimbleComponent.synchronize(); - if (nimbleIdentityAuthenticatorCallback != null) { - nimbleIdentityAuthenticatorCallback.onCallback(iNimbleIdentityAuthenticator2, null); - } - } - - public NimbleIdentityAuthenticationConductorHandler getAuthenticationConductor() { - return this.m_authenticationConductorHandler; - } - - public AuthenticatorBase getAuthenticatorBaseById(String str) { - INimbleIdentityAuthenticator iNimbleIdentityAuthenticator = this.m_authenticators.get(str); - if (iNimbleIdentityAuthenticator == null || !(iNimbleIdentityAuthenticator instanceof AuthenticatorBase)) { - return null; - } - return (AuthenticatorBase) iNimbleIdentityAuthenticator; - } - - @Override // com.ea.nimble.identity.INimbleIdentity - public INimbleIdentityAuthenticator getAuthenticatorById(String str) { - INimbleIdentityAuthenticator iNimbleIdentityAuthenticator = null; - if (this.m_authenticationConductor != null) { - iNimbleIdentityAuthenticator = this.m_authenticators.get(str); - } - return iNimbleIdentityAuthenticator; - } - - @Override // com.ea.nimble.identity.INimbleIdentity - public List getAuthenticators() { - if (this.m_authenticationConductor == null) { - return null; - } - return new LinkedList(this.m_authenticators.values()); - } - - @Override // com.ea.nimble.identity.INimbleIdentity - public boolean getAutoRefreshFlag() { - return this.m_configuration.getAutoRefresh(); - } - - @Override // com.ea.nimble.Component - public String getComponentId() { - return "com.ea.nimble.identity"; - } - - public NimbleIdentityConfig getConfiguration() { - return this.m_configuration; - } - - @Override // com.ea.nimble.LogSource - public String getLogSourceTitle() { - return "Identity"; - } - - @Override // com.ea.nimble.identity.INimbleIdentity - public List getLoggedInAuthenticators() { - ArrayList arrayList = new ArrayList(); - if (this.m_authenticationConductor != null) { - synchronized (this) { - if (this.m_authenticators != null && this.m_authenticators.size() > 0) { - for (INimbleIdentityAuthenticator iNimbleIdentityAuthenticator : this.m_authenticators.values()) { - if (iNimbleIdentityAuthenticator.getState() == INimbleIdentityAuthenticator.NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_SUCCESS) { - arrayList.add(iNimbleIdentityAuthenticator); - } - } - } - } - } - return arrayList; - } - - public INimbleIdentityAuthenticator getMainAuthenticator() { - return this.m_mainAuthenticator; - } - - @Override // com.ea.nimble.identity.INimbleIdentity - public Map getPidMap() { - if (this.m_authenticationConductor == null) { - return null; - } - return getPidMapInternal(); - } - - public HashMap getPidMapInternal() { - return this.m_pidMap; - } - - @Override // com.ea.nimble.identity.INimbleIdentity - public INimbleIdentity.NimbleIdentityState getState() { - return this.m_state; - } - - public void handlePendingMigration(INimbleIdentityAuthenticator.NimbleIdentityAuthenticatorCallback nimbleIdentityAuthenticatorCallback, String str, INimbleIdentityAuthenticator iNimbleIdentityAuthenticator, INimbleIdentityAuthenticator iNimbleIdentityAuthenticator2) { - makeMigrationNetworkCall(nimbleIdentityAuthenticatorCallback, str, iNimbleIdentityAuthenticator, getAndValidateTokenForMigration(iNimbleIdentityAuthenticator.getAuthenticatorId()), iNimbleIdentityAuthenticator2, getAndValidateTokenForMigration(iNimbleIdentityAuthenticator2.getAuthenticatorId())); - } - - public void highlight(INimbleIdentityAuthenticator iNimbleIdentityAuthenticator) { - Log.Helper.LOGD(this, "Game wants to high light the just logged in authenticator", new Object[0]); - setMainAuthenticator(iNimbleIdentityAuthenticator); - } - - void makeMigrationNetworkCall(final INimbleIdentityAuthenticator.NimbleIdentityAuthenticatorCallback nimbleIdentityAuthenticatorCallback, String str, final INimbleIdentityAuthenticator iNimbleIdentityAuthenticator, String str2, final INimbleIdentityAuthenticator iNimbleIdentityAuthenticator2, String str3) { - ByteArrayOutputStream byteArrayOutputStream; - Log.Helper.LOGD(this, "Starting migration network call", new Object[0]); - String format = String.format(DATA_TEMPLATE_MIGRATE, this.m_configuration.getClientId(), str); - URL url = null; - try { - String serverUrlWithKey = SynergyEnvironment.getComponent().getServerUrlWithKey(SynergyEnvironment.SERVER_URL_KEY_IDENTITY_CONNECT); - String str4 = serverUrlWithKey; - if (serverUrlWithKey.substring(serverUrlWithKey.length() - 1).equals("/")) { - str4 = serverUrlWithKey.substring(0, serverUrlWithKey.length() - 1); - } - url = new URL(String.format(URL_TEMPLATE_MIGRATE, str4) + format); - try { - byte[] bytes = format.getBytes("UTF-8"); - byteArrayOutputStream = new ByteArrayOutputStream(bytes.length); - try { - byteArrayOutputStream.write(bytes); - } catch (IOException e) { - } - } catch (IOException e2) { - byteArrayOutputStream = null; - } - } catch (IOException e3) { - byteArrayOutputStream = null; - } - HashMap hashMap = new HashMap<>(); - hashMap.put(REQUEST_HEADER_CONTENT_TYPE_KEY, REQUEST_HEADER_CONTENT_TYPE_VALUE); - hashMap.put(REQUEST_HEADER_SOURCE_AT_KEY, str3); - hashMap.put(REQUEST_HEADER_TARGET_AT_KEY, str2); - HttpRequest httpRequest = new HttpRequest(url); - httpRequest.method = IHttpRequest.Method.POST; - httpRequest.headers = hashMap; - httpRequest.data = byteArrayOutputStream; - Network.getComponent().sendRequest(httpRequest, new NetworkConnectionCallback() { // from class: com.ea.nimble.identity.NimbleIdentityImpl.5 - @Override // com.ea.nimble.NetworkConnectionCallback - public void callback(NetworkConnectionHandle networkConnectionHandle) { - Exception error = networkConnectionHandle.getResponse().getError(); - if (error != null) { - Log.Helper.LOGE(this, "Request for account migration failed for error " + error, new Object[0]); - NimbleIdentityImpl.this.getAuthenticatorBaseById(iNimbleIdentityAuthenticator.getAuthenticatorId()).logout(null); - Persistence persistenceForNimbleComponent = PersistenceService.getPersistenceForNimbleComponent(NimbleIdentityImpl.this.getComponentId(), Persistence.Storage.DOCUMENT); - persistenceForNimbleComponent.setValue(INimbleIdentity.MIGRATION_PERSISTENCE_ID, null); - persistenceForNimbleComponent.synchronize(); - nimbleIdentityAuthenticatorCallback.onCallback(null, new NimbleIdentityError(NimbleIdentityError.NimbleIdentityErrorCode.NIMBLE_IDENTITY_ERROR_MIGRATION_FAILED.intValue(), error.getMessage(), error)); - return; - } - NimbleIdentityImpl.this.completeMigration(iNimbleIdentityAuthenticator2, iNimbleIdentityAuthenticator, nimbleIdentityAuthenticatorCallback); - } - }); - } - - public void migrate(INimbleIdentityAuthenticator.NimbleIdentityAuthenticatorCallback nimbleIdentityAuthenticatorCallback, INimbleIdentityAuthenticator iNimbleIdentityAuthenticator, INimbleIdentityAuthenticator iNimbleIdentityAuthenticator2) { - if (nimbleIdentityAuthenticatorCallback == null) { - Log.Helper.LOGW(this, "Request account migration without callback, no way to notify caller", new Object[0]); - return; - } - Log.Helper.LOGI(this, "Request account migration", new Object[0]); - Component component = Base.getComponent(Tracking.COMPONENT_ID); - if (component != null) { - ITracking iTracking = (ITracking) component; - HashMap hashMap = new HashMap(); - HashMap hashMap2 = new HashMap(); - hashMap2.put(iNimbleIdentityAuthenticator2.getAuthenticatorId(), iNimbleIdentityAuthenticator2.getPidInfo().getPid()); - hashMap.put(Tracking.NIMBLE_TRACKING_KEY_IDENTITY_MAP_SOURCE, Utility.convertObjectToJSONString(hashMap2)); - HashMap hashMap3 = new HashMap(); - hashMap3.put(iNimbleIdentityAuthenticator.getAuthenticatorId(), iNimbleIdentityAuthenticator.getPidInfo().getPid()); - hashMap.put(Tracking.NIMBLE_TRACKING_KEY_IDENTITY_MAP_TARGET, Utility.convertObjectToJSONString(hashMap3)); - hashMap.put(Tracking.NIMBLE_TRACKING_KEY_MIGRATION_GAME_TRIGGERED, Global.NOTIFICATION_DICTIONARY_RESULT_FAIL); - iTracking.logEvent(Tracking.NIMBLE_TRACKING_EVENT_IDENTITY_MIGRATION_STARTED, hashMap); - } - String authenticatorId = iNimbleIdentityAuthenticator2.getAuthenticatorId(); - String authenticatorId2 = iNimbleIdentityAuthenticator.getAuthenticatorId(); - Error validateMigrationIds = validateMigrationIds(authenticatorId, authenticatorId2); - if (validateMigrationIds != null) { - nimbleIdentityAuthenticatorCallback.onCallback(null, validateMigrationIds); - } - String andValidateTokenForMigration = getAndValidateTokenForMigration(authenticatorId); - String andValidateTokenForMigration2 = getAndValidateTokenForMigration(authenticatorId2); - if (andValidateTokenForMigration == null || andValidateTokenForMigration2 == null) { - NimbleIdentityError nimbleIdentityError = new NimbleIdentityError(NimbleIdentityError.NimbleIdentityErrorCode.NIMBLE_IDENTITY_ERROR_MIGRATION_NO_ACCESS_TOKENS, "Access token is empty or invalid"); - Log.Helper.LOGE(this, "Request for account migration failed for error " + nimbleIdentityError, new Object[0]); - nimbleIdentityAuthenticatorCallback.onCallback(null, nimbleIdentityError); - } - if (!Utility.validString(this.m_configuration.getClientId())) { - NimbleIdentityError nimbleIdentityError2 = new NimbleIdentityError(NimbleIdentityError.NimbleIdentityErrorCode.NIMBLE_IDENTITY_ERROR_BAD_CLIENT_ID, "ClientId is empty or invalid"); - Log.Helper.LOGE(this, "Request for account migration failed for error " + nimbleIdentityError2, new Object[0]); - nimbleIdentityAuthenticatorCallback.onCallback(null, nimbleIdentityError2); - } - String uuid = UUID.randomUUID().toString(); - Persistence persistenceForNimbleComponent = PersistenceService.getPersistenceForNimbleComponent("com.ea.nimble.identity", Persistence.Storage.DOCUMENT); - if (persistenceForNimbleComponent == null) { - Log.Helper.LOGW(this, "Attempted to save pending migration data but persistence was not available. Not saving.", new Object[0]); - } else { - persistenceForNimbleComponent.setValue(INimbleIdentity.MIGRATION_PERSISTENCE_ID, new NimbleIdentityMigrationObject(uuid, authenticatorId2, iNimbleIdentityAuthenticator.getPidInfo().getPid(), authenticatorId, iNimbleIdentityAuthenticator2.getPidInfo().getPid())); - persistenceForNimbleComponent.synchronize(); - Log.Helper.LOGV(this, "Migration object saved to persistence", new Object[0]); - } - makeMigrationNetworkCall(nimbleIdentityAuthenticatorCallback, uuid, iNimbleIdentityAuthenticator, andValidateTokenForMigration2, iNimbleIdentityAuthenticator2, andValidateTokenForMigration); - } - - void migrationFailed(INimbleIdentityAuthenticator.NimbleIdentityAuthenticatorCallback nimbleIdentityAuthenticatorCallback, INimbleIdentityAuthenticator iNimbleIdentityAuthenticator, Error error) { - Log.Helper.LOGD(this, "Migration failed for %s.", iNimbleIdentityAuthenticator); - iNimbleIdentityAuthenticator.logout(nimbleIdentityAuthenticatorCallback); - } - - @Override // com.ea.nimble.identity.INimbleIdentity - public void requestServerAuthCodeForLegacyOriginToken(String str, final String str2, final String str3, final INimbleIdentityAuthenticator.NimbleIdentityServerAuthCodeCallback nimbleIdentityServerAuthCodeCallback) { - if (nimbleIdentityServerAuthCodeCallback == null) { - Log.Helper.LOGW(this, "Request server authentication oAuth code without callback, no way to get result", new Object[0]); - return; - } - Log.Helper.LOGV(this, "Request server authentication oauth code for legacy origin ocs token", new Object[0]); - URL url = null; - try { - String format = String.format(URL_TEMPLATE_REQUEST_SERVER_AUTHENTICATION_OAUTH_CODE, this.m_configuration.getConnectServerUrl(), str2, str); - String str4 = format; - if (Utility.validString(str3)) { - str4 = format + String.format("&scope=%s", str3); - } - url = new URL(str4); - } catch (MalformedURLException e) { - } - Network.getComponent().sendGetRequest(url, new HashMap<>(), new NetworkConnectionCallback() { // from class: com.ea.nimble.identity.NimbleIdentityImpl.4 - @Override // com.ea.nimble.NetworkConnectionCallback - public void callback(NetworkConnectionHandle networkConnectionHandle) { - try { - Map parseBodyJSONData = NimbleIdentityUtility.parseBodyJSONData(networkConnectionHandle); - String str5 = (String) parseBodyJSONData.get("code"); - if (!Utility.validString(str5)) { - Error error = new Error(Error.Code.NETWORK_INVALID_SERVER_RESPONSE, "Fail to parse oAuth code from server response data " + parseBodyJSONData); - Log.Helper.LOGD(NimbleIdentityImpl.this, "Request for legacy server auth code failed for error " + error, new Object[0]); - nimbleIdentityServerAuthCodeCallback.onCallback(null, null, str2, str3, error); - return; - } - Log.Helper.LOGD(this, "Request for server auth code succeed with auth code: " + str5, new Object[0]); - nimbleIdentityServerAuthCodeCallback.onCallback(null, str5, str2, str3, null); - } catch (Error e2) { - Log.Helper.LOGD(NimbleIdentityImpl.this, "Request for legacy server auth code failed for error " + e2, new Object[0]); - nimbleIdentityServerAuthCodeCallback.onCallback(null, null, str2, str3, e2); - } - } - }); - } - - public void resolveLogout(INimbleIdentityAuthenticator iNimbleIdentityAuthenticator) { - if (iNimbleIdentityAuthenticator != null) { - setMainAuthenticator(iNimbleIdentityAuthenticator); - } - } - - @Override // com.ea.nimble.Component - public void restore() { - this.m_configuration.initialize(); - this.m_authenticators.clear(); - Component[] componentList = Base.getComponentList(INimbleIdentityAuthenticator.AUTHENTICATOR_COMPONENT_PREFIX); - Utility.registerReceiver(Global.NIMBLE_NOTIFICATION_IDENTITY_AUTHENTICATION_UPDATE, this.m_authenticationUpdateReceiver); - Utility.registerReceiver(Global.NIMBLE_NOTIFICATION_IDENTITY_PID_INFO_UPDATE, this.m_pidInfoUpdateReceiver); - for (Component component : componentList) { - if (!(component instanceof INimbleIdentityAuthenticator)) { - Log.Helper.LOGW(this, "Invalid authenticator %s", component.getComponentId()); - } else { - INimbleIdentityAuthenticator iNimbleIdentityAuthenticator = (INimbleIdentityAuthenticator) component; - this.m_authenticators.put(iNimbleIdentityAuthenticator.getAuthenticatorId(), iNimbleIdentityAuthenticator); - } - } - String loadMainAuthenticator = loadMainAuthenticator(); - String str = loadMainAuthenticator; - if (loadMainAuthenticator == null) { - Log.Helper.LOGD(this, "No existing main authenticator. Will log in anonymous authenticator", new Object[0]); - str = Global.NIMBLE_AUTHENTICATOR_ANONYMOUS; - } - Log.Helper.LOGD(this, "Main authenticator is " + str, new Object[0]); - AuthenticatorBase authenticatorBaseById = getAuthenticatorBaseById(str); - authenticatorBaseById.setState(INimbleIdentityAuthenticator.NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_OFFLINE); - authenticatorBaseById.restoreAuthenticator(new INimbleIdentityAuthenticator.NimbleIdentityAuthenticatorCallback() { // from class: com.ea.nimble.identity.NimbleIdentityImpl.3 - @Override // com.ea.nimble.identity.INimbleIdentityAuthenticator.NimbleIdentityAuthenticatorCallback - public void onCallback(INimbleIdentityAuthenticator iNimbleIdentityAuthenticator2, Error error) { - for (INimbleIdentityAuthenticator iNimbleIdentityAuthenticator3 : NimbleIdentityImpl.this.m_authenticators.values()) { - AuthenticatorBase authenticatorBase = (AuthenticatorBase) iNimbleIdentityAuthenticator3; - if (authenticatorBase != iNimbleIdentityAuthenticator2) { - authenticatorBase.restoreAuthenticator(null); - } - } - } - }); - for (INimbleIdentityAuthenticator iNimbleIdentityAuthenticator2 : this.m_authenticators.values()) { - if (iNimbleIdentityAuthenticator2.getState() == INimbleIdentityAuthenticator.NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_GOING) { - this.m_state = INimbleIdentity.NimbleIdentityState.NIMBLE_IDENTITY_AUTHENTICATING; - } - } - } - - @Override // com.ea.nimble.identity.INimbleIdentity - public void setAuthenticationConductor(INimbleIdentityAuthenticationConductor iNimbleIdentityAuthenticationConductor) { - if (this.m_authenticationConductor != null) { - Log.Helper.LOGW(this, "Attempting setAuthenticationConductor when we already have one. Unsupported. Ignoring.", new Object[0]); - } else if (iNimbleIdentityAuthenticationConductor == null) { - Log.Helper.LOGW(this, "Attempting to setAuthenticationConductor with a null conductor.", new Object[0]); - } else if (this.m_authenticationConductor != iNimbleIdentityAuthenticationConductor) { - this.m_authenticationConductor = iNimbleIdentityAuthenticationConductor; - if (iNimbleIdentityAuthenticationConductor instanceof INimbleIdentityGenericAuthenticationConductor) { - Log.Helper.LOGD(this, "Setting the generic auth conductor as our conductor.", new Object[0]); - this.m_authenticationConductorHandler = new NimbleIdentityGenericAuthenticationConductorHandler(iNimbleIdentityAuthenticationConductor); - } else if (iNimbleIdentityAuthenticationConductor instanceof INimbleIdentityMigrationAuthenticationConductor) { - Log.Helper.LOGD(this, "Setting the migration auth conductor as our conductor.", new Object[0]); - this.m_authenticationConductorHandler = new NimbleIdentityMigrationAuthenticationConductorHandler(iNimbleIdentityAuthenticationConductor); - } - for (INimbleIdentityAuthenticator iNimbleIdentityAuthenticator : getAuthenticators()) { - if (iNimbleIdentityAuthenticator != null) { - ((AuthenticatorBase) iNimbleIdentityAuthenticator).resume(); - } - } - } - } - - @Override // com.ea.nimble.identity.INimbleIdentity - public void setAutoRefreshFlag(boolean z) { - this.m_configuration.setAutoRefresh(z); - Iterator it = this.m_authenticators.values().iterator(); - while (it.hasNext()) { - ((AuthenticatorBase) it.next()).enableAutoRefresh(z); - } - } - - public void setMainAuthenticator(INimbleIdentityAuthenticator iNimbleIdentityAuthenticator) { - if (iNimbleIdentityAuthenticator == null) { - Log.Helper.LOGW(this, "Failed to set mainAuthenticator with new authenticator because given authenticator is null.", new Object[0]); - } else if (iNimbleIdentityAuthenticator == this.m_mainAuthenticator) { - Log.Helper.LOGV(this, "Skipping setMainAuthenticator because the given authenticator is the same as the previous one.", new Object[0]); - } else { - Log.Helper.LOGD(this, "Setting mainAuthenticator to: " + iNimbleIdentityAuthenticator.getAuthenticatorId(), new Object[0]); - this.m_mainAuthenticator = iNimbleIdentityAuthenticator; - HashMap hashMap = new HashMap(); - String authenticatorId = this.m_mainAuthenticator.getAuthenticatorId(); - saveMainAuthenticator(authenticatorId); - NimbleIdentityPidInfo pidInfo = this.m_mainAuthenticator.getPidInfo(); - if (pidInfo != null) { - hashMap.put(authenticatorId, pidInfo.getPid()); - } else { - hashMap.put(authenticatorId, ""); - } - HashMap hashMap2 = new HashMap(); - hashMap2.put(Tracking.NIMBLE_TRACKING_KEY_IDENTITY_MAP_SOURCE, hashMap); - Utility.sendBroadcastSerializable(Global.NIMBLE_NOTIFICATION_IDENTITY_MAIN_AUTHENTICATOR_CHANGE, hashMap2); - } - } - - public void setState(INimbleIdentity.NimbleIdentityState nimbleIdentityState) { - if (this.m_state != nimbleIdentityState) { - this.m_state = nimbleIdentityState; - Utility.sendBroadcast(INimbleIdentity.NIMBLE_NOTIFICATION_IDENTITY_UPDATE, null); - } - } - - public void switchAuthenticators(INimbleIdentityAuthenticator.NimbleIdentityAuthenticatorCallback nimbleIdentityAuthenticatorCallback, INimbleIdentityAuthenticator iNimbleIdentityAuthenticator, INimbleIdentityAuthenticator iNimbleIdentityAuthenticator2) { - if (nimbleIdentityAuthenticatorCallback == null) { - Log.Helper.LOGW(this, "Requested account switching without callback. No way to notify caller. Aborting...", new Object[0]); - } else if (iNimbleIdentityAuthenticator2 == null) { - nimbleIdentityAuthenticatorCallback.onCallback(null, new NimbleIdentityError(NimbleIdentityError.NimbleIdentityErrorCode.NIMBLE_IDENTITY_ERROR_MIGRATION_SOURCE_INVALID, "Attempted to switchAuthenticators but source authenticator was null")); - } else if (iNimbleIdentityAuthenticator == null) { - nimbleIdentityAuthenticatorCallback.onCallback(null, new NimbleIdentityError(NimbleIdentityError.NimbleIdentityErrorCode.NIMBLE_IDENTITY_ERROR_MIGRATION_TARGET_INVALID, "Attempted to switchAuthenticators but target authenticator was null")); - } else if (iNimbleIdentityAuthenticator2.getAuthenticatorId().equals(iNimbleIdentityAuthenticator.getAuthenticatorId())) { - nimbleIdentityAuthenticatorCallback.onCallback(null, new NimbleIdentityError(NimbleIdentityError.NimbleIdentityErrorCode.NIMBLE_IDENTITY_ERROR_MIGRATION_FAILED, "Attempted to switch from one authenticator to itself. Your from and your to authenticators must be different.")); - } else { - setMainAuthenticator(iNimbleIdentityAuthenticator); - if (iNimbleIdentityAuthenticator2.getAuthenticatorId() == Global.NIMBLE_AUTHENTICATOR_ANONYMOUS) { - ((AuthenticatorAnonymous) iNimbleIdentityAuthenticator2).logoutInternal(nimbleIdentityAuthenticatorCallback); - } else { - nimbleIdentityAuthenticatorCallback.onCallback(iNimbleIdentityAuthenticator, null); - } - } - } -} diff --git a/app/src/main/java/com/ea/nimble/identity/NimbleIdentityLoginParams.java b/app/src/main/java/com/ea/nimble/identity/NimbleIdentityLoginParams.java deleted file mode 100644 index 32b56ad..0000000 --- a/app/src/main/java/com/ea/nimble/identity/NimbleIdentityLoginParams.java +++ /dev/null @@ -1,111 +0,0 @@ -package com.ea.nimble.identity; - -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -/* loaded from: stdlib.jar:com/ea/nimble/identity/NimbleIdentityLoginParams.class */ -public abstract class NimbleIdentityLoginParams { - - /* loaded from: stdlib.jar:com/ea/nimble/identity/NimbleIdentityLoginParams$AnonymousLoginParams.class */ - public static class AnonymousLoginParams extends NimbleIdentityLoginParams { - } - - /* loaded from: stdlib.jar:com/ea/nimble/identity/NimbleIdentityLoginParams$FacebookAccessTokenLoginParams.class */ - public static class FacebookAccessTokenLoginParams extends NimbleIdentityLoginParams { - private Date expiryDate; - private String facebookAccessToken; - - FacebookAccessTokenLoginParams() { - this.facebookAccessToken = ""; - } - - public FacebookAccessTokenLoginParams(String str, Date date) { - this.facebookAccessToken = ""; - this.facebookAccessToken = str; - this.expiryDate = date; - } - - /* JADX INFO: Access modifiers changed from: package-private */ - public Date getExpiryDate() { - return this.expiryDate; - } - - /* JADX INFO: Access modifiers changed from: package-private */ - public String getFacebookAccessToken() { - return this.facebookAccessToken; - } - } - - /* loaded from: stdlib.jar:com/ea/nimble/identity/NimbleIdentityLoginParams$FacebookClientLoginParams.class */ - public static class FacebookClientLoginParams extends NimbleIdentityLoginParams { - private List facebookPermissions; - - public FacebookClientLoginParams(List list) { - if (list == null || list.size() <= 0) { - this.facebookPermissions = new ArrayList(); - this.facebookPermissions.add("email"); - return; - } - this.facebookPermissions = list; - if (!list.contains("email")) { - this.facebookPermissions.add("email"); - } - } - - /* JADX INFO: Access modifiers changed from: package-private */ - public List getFacebookPermissions() { - return this.facebookPermissions; - } - } - - /* loaded from: stdlib.jar:com/ea/nimble/identity/NimbleIdentityLoginParams$OriginCredentialsLoginParams.class */ - public static class OriginCredentialsLoginParams extends NimbleIdentityLoginParams { - private String password; - private String username; - - OriginCredentialsLoginParams() { - this.username = ""; - this.password = ""; - } - - public OriginCredentialsLoginParams(String str, String str2) { - this.username = ""; - this.password = ""; - this.username = str; - this.password = str2; - } - - /* JADX INFO: Access modifiers changed from: package-private */ - public String getPassword() { - return this.password; - } - - /* JADX INFO: Access modifiers changed from: package-private */ - public String getUsername() { - return this.username; - } - } - - /* loaded from: stdlib.jar:com/ea/nimble/identity/NimbleIdentityLoginParams$OriginOAuthCodeLoginParams.class */ - public static class OriginOAuthCodeLoginParams extends NimbleIdentityLoginParams { - private String oAuthCode; - - OriginOAuthCodeLoginParams() { - this.oAuthCode = ""; - } - - public OriginOAuthCodeLoginParams(String str) { - this.oAuthCode = ""; - this.oAuthCode = str; - } - - /* JADX INFO: Access modifiers changed from: package-private */ - public String getOauthCode() { - return this.oAuthCode; - } - } - - protected NimbleIdentityLoginParams() { - } -} diff --git a/app/src/main/java/com/ea/nimble/identity/NimbleIdentityMigrationAuthenticationConductorHandler.java b/app/src/main/java/com/ea/nimble/identity/NimbleIdentityMigrationAuthenticationConductorHandler.java deleted file mode 100644 index f5ab885..0000000 --- a/app/src/main/java/com/ea/nimble/identity/NimbleIdentityMigrationAuthenticationConductorHandler.java +++ /dev/null @@ -1,94 +0,0 @@ -package com.ea.nimble.identity; - -import com.ea.nimble.Global; -import com.ea.nimble.Log; -import com.ea.nimble.Persistence; -import com.ea.nimble.PersistenceService; -import com.ea.nimble.identity.INimbleIdentityAuthenticator; -import java.util.Iterator; -import java.util.List; - -/* loaded from: stdlib.jar:com/ea/nimble/identity/NimbleIdentityMigrationAuthenticationConductorHandler.class */ -class NimbleIdentityMigrationAuthenticationConductorHandler implements NimbleIdentityAuthenticationConductorHandler { - private INimbleIdentityMigrationAuthenticationConductor m_conductor; - - public NimbleIdentityMigrationAuthenticationConductorHandler(INimbleIdentityAuthenticationConductor iNimbleIdentityAuthenticationConductor) { - this.m_conductor = (INimbleIdentityMigrationAuthenticationConductor) iNimbleIdentityAuthenticationConductor; - List loggedInAuthenticators = NimbleIdentity.getComponent().getLoggedInAuthenticators(); - if (loggedInAuthenticators.size() > 0) { - if (loggedInAuthenticators.size() != 1) { - Iterator it = loggedInAuthenticators.iterator(); - while (true) { - if (!it.hasNext()) { - break; - } - INimbleIdentityAuthenticator next = it.next(); - if (!next.getAuthenticatorId().equals(Global.NIMBLE_AUTHENTICATOR_ANONYMOUS)) { - NimbleIdentityImpl.getComponent().setMainAuthenticator(next); - break; - } - } - } else { - NimbleIdentityImpl.getComponent().setMainAuthenticator(loggedInAuthenticators.get(0)); - } - } - handlePendingMigration(); - } - - @Override // com.ea.nimble.identity.NimbleIdentityAuthenticationConductorHandler - public void handleLogin(INimbleIdentityAuthenticator iNimbleIdentityAuthenticator, boolean z) { - NimbleIdentityImpl component = NimbleIdentityImpl.getComponent(); - INimbleIdentityAuthenticator mainAuthenticator = component.getMainAuthenticator(); - if (mainAuthenticator == null) { - component.setMainAuthenticator(iNimbleIdentityAuthenticator); - } else if (iNimbleIdentityAuthenticator == mainAuthenticator) { - Log.Helper.LOGW(this, "Error. Attempted to handle login on a authenticator: %s which is already mainAuthenticator", iNimbleIdentityAuthenticator.getAuthenticatorId()); - } else if (!handlePendingMigration()) { - this.m_conductor.handleLogin(new NimbleIdentityMigrationLoginResolver(iNimbleIdentityAuthenticator)); - } - } - - @Override // com.ea.nimble.identity.NimbleIdentityAuthenticationConductorHandler - public void handleLogout(INimbleIdentityAuthenticator iNimbleIdentityAuthenticator) { - if (iNimbleIdentityAuthenticator == null) { - Log.Helper.LOGF(this, "Given a null authenticator as part of logout proess.", new Object[0]); - } else if (!iNimbleIdentityAuthenticator.getAuthenticatorId().equals(Global.NIMBLE_AUTHENTICATOR_ANONYMOUS)) { - NimbleIdentityImpl component = NimbleIdentityImpl.getComponent(); - AuthenticatorBase authenticatorBaseById = component.getAuthenticatorBaseById(Global.NIMBLE_AUTHENTICATOR_ANONYMOUS); - if (authenticatorBaseById == null) { - Log.Helper.LOGF(this, "Unable to set Anonymous Authenticator as main authenticator as part of logout process.", new Object[0]); - return; - } - component.setMainAuthenticator(authenticatorBaseById); - if (authenticatorBaseById.getState() != INimbleIdentityAuthenticator.NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_SUCCESS) { - authenticatorBaseById.autoLogin(); - } - } - } - - public boolean handlePendingMigration() { - Persistence persistenceForNimbleComponent = PersistenceService.getPersistenceForNimbleComponent("com.ea.nimble.identity", Persistence.Storage.DOCUMENT); - if (persistenceForNimbleComponent == null) { - Log.Helper.LOGW(this, "Attempted to check pending migration status but persistence was not available. Failing.", new Object[0]); - return false; - } - NimbleIdentityMigrationObject nimbleIdentityMigrationObject = (NimbleIdentityMigrationObject) persistenceForNimbleComponent.getValue(INimbleIdentity.MIGRATION_PERSISTENCE_ID); - if (nimbleIdentityMigrationObject == null) { - Log.Helper.LOGI(this, "No pending migration object found in persistence!", new Object[0]); - return false; - } - NimbleIdentityImpl component = NimbleIdentityImpl.getComponent(); - AuthenticatorBase authenticatorBaseById = component.getAuthenticatorBaseById(nimbleIdentityMigrationObject.m_currentAuthenticatorId); - if (authenticatorBaseById.getState() != INimbleIdentityAuthenticator.NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_SUCCESS || !authenticatorBaseById.getPidInfo().getPid().equals(nimbleIdentityMigrationObject.m_currentAuthenticatorPid)) { - return false; - } - AuthenticatorBase authenticatorBaseById2 = component.getAuthenticatorBaseById(nimbleIdentityMigrationObject.m_newAuthenticatorId); - if (authenticatorBaseById2.getState() != INimbleIdentityAuthenticator.NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_SUCCESS || !authenticatorBaseById2.getPidInfo().getPid().equals(nimbleIdentityMigrationObject.m_newAuthenticatorPid)) { - return false; - } - NimbleIdentityPendingMigrationResolver nimbleIdentityPendingMigrationResolver = new NimbleIdentityPendingMigrationResolver(nimbleIdentityMigrationObject.m_migrationGUID, nimbleIdentityMigrationObject.m_newAuthenticatorId, nimbleIdentityMigrationObject.m_newAuthenticatorPid, nimbleIdentityMigrationObject.m_currentAuthenticatorId, nimbleIdentityMigrationObject.m_currentAuthenticatorPid); - Log.Helper.LOGI(this, "Sending request to game to handle pending migration", new Object[0]); - this.m_conductor.handlePendingMigration(nimbleIdentityPendingMigrationResolver); - return true; - } -} diff --git a/app/src/main/java/com/ea/nimble/identity/NimbleIdentityMigrationLoginResolver.java b/app/src/main/java/com/ea/nimble/identity/NimbleIdentityMigrationLoginResolver.java deleted file mode 100644 index 89ea237..0000000 --- a/app/src/main/java/com/ea/nimble/identity/NimbleIdentityMigrationLoginResolver.java +++ /dev/null @@ -1,48 +0,0 @@ -package com.ea.nimble.identity; - -import com.ea.nimble.Global; -import com.ea.nimble.identity.INimbleIdentityAuthenticator; -import java.util.ArrayList; -import java.util.List; - -/* loaded from: stdlib.jar:com/ea/nimble/identity/NimbleIdentityMigrationLoginResolver.class */ -class NimbleIdentityMigrationLoginResolver implements INimbleIdentityMigrationLoginResolver { - private INimbleIdentityAuthenticator m_authenticator; - private String m_authenticatorId; - private ArrayList m_loggedInAuthenticatorIds = new ArrayList<>(); - - /* JADX INFO: Access modifiers changed from: package-private */ - public NimbleIdentityMigrationLoginResolver(INimbleIdentityAuthenticator iNimbleIdentityAuthenticator) { - this.m_authenticator = iNimbleIdentityAuthenticator; - this.m_authenticatorId = iNimbleIdentityAuthenticator.getAuthenticatorId(); - for (INimbleIdentityAuthenticator iNimbleIdentityAuthenticator2 : NimbleIdentity.getComponent().getLoggedInAuthenticators()) { - this.m_loggedInAuthenticatorIds.add(iNimbleIdentityAuthenticator2.getAuthenticatorId()); - } - } - - @Override // com.ea.nimble.identity.INimbleIdentityMigrationLoginResolver - public List getLoggedInAuthenticatorIds() { - return this.m_loggedInAuthenticatorIds; - } - - @Override // com.ea.nimble.identity.INimbleIdentityMigrationLoginResolver - public String getLoggingInAuthenticatorId() { - return this.m_authenticatorId; - } - - @Override // com.ea.nimble.identity.INimbleIdentityMigrationLoginResolver - public void ignore() { - } - - @Override // com.ea.nimble.identity.INimbleIdentityMigrationLoginResolver - public void migrate(INimbleIdentityAuthenticator.NimbleIdentityAuthenticatorCallback nimbleIdentityAuthenticatorCallback) { - NimbleIdentityImpl component = NimbleIdentityImpl.getComponent(); - component.migrate(nimbleIdentityAuthenticatorCallback, this.m_authenticator, component.getMainAuthenticator()); - } - - @Override // com.ea.nimble.identity.INimbleIdentityMigrationLoginResolver - public void switchAuthenticators(INimbleIdentityAuthenticator.NimbleIdentityAuthenticatorCallback nimbleIdentityAuthenticatorCallback) { - NimbleIdentityImpl component = NimbleIdentityImpl.getComponent(); - component.switchAuthenticators(nimbleIdentityAuthenticatorCallback, this.m_authenticator, component.getAuthenticatorById(Global.NIMBLE_AUTHENTICATOR_ANONYMOUS)); - } -} diff --git a/app/src/main/java/com/ea/nimble/identity/NimbleIdentityMigrationObject.java b/app/src/main/java/com/ea/nimble/identity/NimbleIdentityMigrationObject.java deleted file mode 100644 index 9ffb564..0000000 --- a/app/src/main/java/com/ea/nimble/identity/NimbleIdentityMigrationObject.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.ea.nimble.identity; - -import java.io.Serializable; - -/* loaded from: stdlib.jar:com/ea/nimble/identity/NimbleIdentityMigrationObject.class */ -class NimbleIdentityMigrationObject implements Serializable { - private static final long serialVersionUID = 1; - String m_currentAuthenticatorId; - String m_currentAuthenticatorPid; - String m_migrationGUID; - String m_newAuthenticatorId; - String m_newAuthenticatorPid; - - NimbleIdentityMigrationObject() { - } - - /* JADX INFO: Access modifiers changed from: package-private */ - public NimbleIdentityMigrationObject(String str, String str2, String str3, String str4, String str5) { - this.m_migrationGUID = str; - this.m_newAuthenticatorId = str2; - this.m_newAuthenticatorPid = str3; - this.m_currentAuthenticatorId = str4; - this.m_currentAuthenticatorPid = str5; - } -} diff --git a/app/src/main/java/com/ea/nimble/identity/NimbleIdentityPendingMigrationResolver.java b/app/src/main/java/com/ea/nimble/identity/NimbleIdentityPendingMigrationResolver.java deleted file mode 100644 index c68adeb..0000000 --- a/app/src/main/java/com/ea/nimble/identity/NimbleIdentityPendingMigrationResolver.java +++ /dev/null @@ -1,41 +0,0 @@ -package com.ea.nimble.identity; - -import com.ea.nimble.identity.INimbleIdentityAuthenticator; - -/* loaded from: stdlib.jar:com/ea/nimble/identity/NimbleIdentityPendingMigrationResolver.class */ -public class NimbleIdentityPendingMigrationResolver implements INimbleIdentityPendingMigrationResolver { - private String m_GUID; - private String m_currentAuthenticatorId; - private String m_currentAuthenticatorPid; - private String m_newAuthenticatorId; - - /* JADX INFO: Access modifiers changed from: package-private */ - public NimbleIdentityPendingMigrationResolver(String str, String str2, String str3, String str4, String str5) { - this.m_GUID = str; - this.m_newAuthenticatorId = str2; - this.m_currentAuthenticatorId = str4; - this.m_currentAuthenticatorPid = str5; - } - - @Override // com.ea.nimble.identity.INimbleIdentityPendingMigrationResolver - public String getMigrationSourceAuthenticatorId() { - return this.m_currentAuthenticatorId; - } - - @Override // com.ea.nimble.identity.INimbleIdentityPendingMigrationResolver - public String getMigrationTargetAuthenticatorId() { - return this.m_newAuthenticatorId; - } - - @Override // com.ea.nimble.identity.INimbleIdentityPendingMigrationResolver - public void resume(INimbleIdentityAuthenticator.NimbleIdentityAuthenticatorCallback nimbleIdentityAuthenticatorCallback) { - NimbleIdentityImpl component = NimbleIdentityImpl.getComponent(); - INimbleIdentityAuthenticator authenticatorById = component.getAuthenticatorById(this.m_currentAuthenticatorId); - INimbleIdentityAuthenticator authenticatorById2 = component.getAuthenticatorById(this.m_newAuthenticatorId); - if (!authenticatorById.getPidInfo().getPid().equals(this.m_currentAuthenticatorPid)) { - component.completeMigration(authenticatorById, authenticatorById2, nimbleIdentityAuthenticatorCallback); - } else { - component.handlePendingMigration(nimbleIdentityAuthenticatorCallback, this.m_GUID, authenticatorById2, authenticatorById); - } - } -} diff --git a/app/src/main/java/com/ea/nimble/identity/NimbleIdentityPersona.java b/app/src/main/java/com/ea/nimble/identity/NimbleIdentityPersona.java deleted file mode 100644 index adfc882..0000000 --- a/app/src/main/java/com/ea/nimble/identity/NimbleIdentityPersona.java +++ /dev/null @@ -1,518 +0,0 @@ -package com.ea.nimble.identity; - -import com.ea.nimble.Log; - -import java.util.Date; -import java.util.Map; - -/* loaded from: stdlib.jar:com/ea/nimble/identity/NimbleIdentityPersona.class */ -public class NimbleIdentityPersona { - private String dateCreated; - private String displayName; - private Date expiryTime; - private String isVisible; - private String lastAuthenticated; - private String name; - private String namespaceName; - private long personaId; - private String pidId; - private PersonaPrivacyLevel showPersona; - private PersonaStatus status; - private PersonaStatusReasonCodes statusReasonCode; - - /* renamed from: com.ea.nimble.identity.NimbleIdentityPersona$1 reason: invalid class name */ - /* loaded from: stdlib.jar:com/ea/nimble/identity/NimbleIdentityPersona$1.class */ - static /* synthetic */ class AnonymousClass1 { - static final /* synthetic */ int[] $SwitchMap$com$ea$nimble$identity$NimbleIdentityPersona$PersonaPrivacyLevel = new int[PersonaPrivacyLevel.values().length]; - static final /* synthetic */ int[] $SwitchMap$com$ea$nimble$identity$NimbleIdentityPersona$PersonaStatus; - static final /* synthetic */ int[] $SwitchMap$com$ea$nimble$identity$NimbleIdentityPersona$PersonaStatusReasonCodes; - - static { - try { - $SwitchMap$com$ea$nimble$identity$NimbleIdentityPersona$PersonaPrivacyLevel[PersonaPrivacyLevel.PERSONA_PRIVACY_LEVEL_NO_ONE.ordinal()] = 1; - } catch (NoSuchFieldError e) { - } - try { - $SwitchMap$com$ea$nimble$identity$NimbleIdentityPersona$PersonaPrivacyLevel[PersonaPrivacyLevel.PERSONA_PRIVACY_LEVEL_EVERYONE.ordinal()] = 2; - } catch (NoSuchFieldError e2) { - } - try { - $SwitchMap$com$ea$nimble$identity$NimbleIdentityPersona$PersonaPrivacyLevel[PersonaPrivacyLevel.PERSONA_PRIVACY_LEVEL_FRIENDS.ordinal()] = 3; - } catch (NoSuchFieldError e3) { - } - try { - $SwitchMap$com$ea$nimble$identity$NimbleIdentityPersona$PersonaPrivacyLevel[PersonaPrivacyLevel.PERSONA_PRIVACY_LEVEL_FRIENDS_OF_FRIENDS.ordinal()] = 4; - } catch (NoSuchFieldError e4) { - } - $SwitchMap$com$ea$nimble$identity$NimbleIdentityPersona$PersonaStatusReasonCodes = new int[PersonaStatusReasonCodes.values().length]; - try { - $SwitchMap$com$ea$nimble$identity$NimbleIdentityPersona$PersonaStatusReasonCodes[PersonaStatusReasonCodes.PERSONA_STATUS_REASON_CODES_ONE.ordinal()] = 1; - } catch (NoSuchFieldError e5) { - } - try { - $SwitchMap$com$ea$nimble$identity$NimbleIdentityPersona$PersonaStatusReasonCodes[PersonaStatusReasonCodes.PERSONA_STATUS_REASON_CODES_REACTIVATED_CUSTOMER.ordinal()] = 2; - } catch (NoSuchFieldError e6) { - } - try { - $SwitchMap$com$ea$nimble$identity$NimbleIdentityPersona$PersonaStatusReasonCodes[PersonaStatusReasonCodes.PERSONA_STATUS_REASON_CODES_INVALID_EMAIL.ordinal()] = 3; - } catch (NoSuchFieldError e7) { - } - try { - $SwitchMap$com$ea$nimble$identity$NimbleIdentityPersona$PersonaStatusReasonCodes[PersonaStatusReasonCodes.PERSONA_STATUS_REASON_CODES_PRIVACY_POLICY.ordinal()] = 4; - } catch (NoSuchFieldError e8) { - } - try { - $SwitchMap$com$ea$nimble$identity$NimbleIdentityPersona$PersonaStatusReasonCodes[PersonaStatusReasonCodes.PERSONA_STATUS_REASON_CODES_PARENTS_REQUEST.ordinal()] = 5; - } catch (NoSuchFieldError e9) { - } - try { - $SwitchMap$com$ea$nimble$identity$NimbleIdentityPersona$PersonaStatusReasonCodes[PersonaStatusReasonCodes.PERSONA_STATUS_REASON_CODES_SUSPENDED_MISCONDUCT_GENERAL.ordinal()] = 6; - } catch (NoSuchFieldError e10) { - } - try { - $SwitchMap$com$ea$nimble$identity$NimbleIdentityPersona$PersonaStatusReasonCodes[PersonaStatusReasonCodes.PERSONA_STATUS_REASON_CODES_SUSPENDED_MISCONDUCT_HARASSMENT.ordinal()] = 7; - } catch (NoSuchFieldError e11) { - } - try { - $SwitchMap$com$ea$nimble$identity$NimbleIdentityPersona$PersonaStatusReasonCodes[PersonaStatusReasonCodes.PERSONA_STATUS_REASON_CODES_SUSPENDED_MISCONDUCT_MACROING.ordinal()] = 8; - } catch (NoSuchFieldError e12) { - } - try { - $SwitchMap$com$ea$nimble$identity$NimbleIdentityPersona$PersonaStatusReasonCodes[PersonaStatusReasonCodes.PERSONA_STATUS_REASON_CODES_SUSPENDED_MISCONDUCT_EXPLOITATION.ordinal()] = 9; - } catch (NoSuchFieldError e13) { - } - try { - $SwitchMap$com$ea$nimble$identity$NimbleIdentityPersona$PersonaStatusReasonCodes[PersonaStatusReasonCodes.PERSONA_STATUS_REASON_CODES_SUSPENDED_FRAUD.ordinal()] = 10; - } catch (NoSuchFieldError e14) { - } - try { - $SwitchMap$com$ea$nimble$identity$NimbleIdentityPersona$PersonaStatusReasonCodes[PersonaStatusReasonCodes.PERSONA_STATUS_REASON_CODES_CUSTOMER_OPT_OUT.ordinal()] = 11; - } catch (NoSuchFieldError e15) { - } - try { - $SwitchMap$com$ea$nimble$identity$NimbleIdentityPersona$PersonaStatusReasonCodes[PersonaStatusReasonCodes.PERSONA_STATUS_REASON_CODES_CUSTOMER_UNDER_AGE.ordinal()] = 12; - } catch (NoSuchFieldError e16) { - } - try { - $SwitchMap$com$ea$nimble$identity$NimbleIdentityPersona$PersonaStatusReasonCodes[PersonaStatusReasonCodes.PERSONA_STATUS_REASON_CODES_EMAIL_CONFIRMATION_REQUIRED.ordinal()] = 13; - } catch (NoSuchFieldError e17) { - } - try { - $SwitchMap$com$ea$nimble$identity$NimbleIdentityPersona$PersonaStatusReasonCodes[PersonaStatusReasonCodes.PERSONA_STATUS_REASON_CODES_MISTYPED_ID.ordinal()] = 14; - } catch (NoSuchFieldError e18) { - } - try { - $SwitchMap$com$ea$nimble$identity$NimbleIdentityPersona$PersonaStatusReasonCodes[PersonaStatusReasonCodes.PERSONA_STATUS_REASON_CODES_ABUSED_ID.ordinal()] = 15; - } catch (NoSuchFieldError e19) { - } - try { - $SwitchMap$com$ea$nimble$identity$NimbleIdentityPersona$PersonaStatusReasonCodes[PersonaStatusReasonCodes.PERSONA_STATUS_REASON_CODES_DEACTIVATED_EMAIL_LINK.ordinal()] = 16; - } catch (NoSuchFieldError e20) { - } - try { - $SwitchMap$com$ea$nimble$identity$NimbleIdentityPersona$PersonaStatusReasonCodes[PersonaStatusReasonCodes.PERSONA_STATUS_REASON_CODES_DEACTIVATED_CS.ordinal()] = 17; - } catch (NoSuchFieldError e21) { - } - try { - $SwitchMap$com$ea$nimble$identity$NimbleIdentityPersona$PersonaStatusReasonCodes[PersonaStatusReasonCodes.PERSONA_STATUS_REASON_CODES_CLAIMED_BY_TRUE_OWNER.ordinal()] = 18; - } catch (NoSuchFieldError e22) { - } - try { - $SwitchMap$com$ea$nimble$identity$NimbleIdentityPersona$PersonaStatusReasonCodes[PersonaStatusReasonCodes.PERSONA_STATUS_REASON_CODES_BANNED.ordinal()] = 19; - } catch (NoSuchFieldError e23) { - } - try { - $SwitchMap$com$ea$nimble$identity$NimbleIdentityPersona$PersonaStatusReasonCodes[PersonaStatusReasonCodes.PERSONA_STATUS_REASON_CODES_DEACTIVATED_AFFILIATE.ordinal()] = 20; - } catch (NoSuchFieldError e24) { - } - $SwitchMap$com$ea$nimble$identity$NimbleIdentityPersona$PersonaStatus = new int[PersonaStatus.values().length]; - try { - $SwitchMap$com$ea$nimble$identity$NimbleIdentityPersona$PersonaStatus[PersonaStatus.PERSONA_STATUS_PENDING.ordinal()] = 1; - } catch (NoSuchFieldError e25) { - } - try { - $SwitchMap$com$ea$nimble$identity$NimbleIdentityPersona$PersonaStatus[PersonaStatus.PERSONA_STATUS_ACTIVE.ordinal()] = 2; - } catch (NoSuchFieldError e26) { - } - try { - $SwitchMap$com$ea$nimble$identity$NimbleIdentityPersona$PersonaStatus[PersonaStatus.PERSONA_STATUS_DEACTIVATED.ordinal()] = 3; - } catch (NoSuchFieldError e27) { - } - try { - $SwitchMap$com$ea$nimble$identity$NimbleIdentityPersona$PersonaStatus[PersonaStatus.PERSONA_STATUS_DISABLED.ordinal()] = 4; - } catch (NoSuchFieldError e28) { - } - try { - $SwitchMap$com$ea$nimble$identity$NimbleIdentityPersona$PersonaStatus[PersonaStatus.PERSONA_STATUS_DELETED.ordinal()] = 5; - } catch (NoSuchFieldError e29) { - } - try { - $SwitchMap$com$ea$nimble$identity$NimbleIdentityPersona$PersonaStatus[PersonaStatus.PERSONA_STATUS_BANNED.ordinal()] = 6; - } catch (NoSuchFieldError e30) { - } - } - } - - /* loaded from: stdlib.jar:com/ea/nimble/identity/NimbleIdentityPersona$PersonaPrivacyLevel.class */ - public enum PersonaPrivacyLevel { - PERSONA_PRIVACY_LEVEL_NONE, - PERSONA_PRIVACY_LEVEL_NO_ONE, - PERSONA_PRIVACY_LEVEL_EVERYONE, - PERSONA_PRIVACY_LEVEL_FRIENDS, - PERSONA_PRIVACY_LEVEL_FRIENDS_OF_FRIENDS - } - - /* loaded from: stdlib.jar:com/ea/nimble/identity/NimbleIdentityPersona$PersonaStatus.class */ - public enum PersonaStatus { - PERSONA_STATUS_NONE, - PERSONA_STATUS_PENDING, - PERSONA_STATUS_ACTIVE, - PERSONA_STATUS_DEACTIVATED, - PERSONA_STATUS_DISABLED, - PERSONA_STATUS_DELETED, - PERSONA_STATUS_BANNED - } - - /* loaded from: stdlib.jar:com/ea/nimble/identity/NimbleIdentityPersona$PersonaStatusReasonCodes.class */ - public enum PersonaStatusReasonCodes { - PERSONA_STATUS_REASON_CODES_NONE, - PERSONA_STATUS_REASON_CODES_ONE, - PERSONA_STATUS_REASON_CODES_REACTIVATED_CUSTOMER, - PERSONA_STATUS_REASON_CODES_INVALID_EMAIL, - PERSONA_STATUS_REASON_CODES_PRIVACY_POLICY, - PERSONA_STATUS_REASON_CODES_PARENTS_REQUEST, - PERSONA_STATUS_REASON_CODES_SUSPENDED_MISCONDUCT_GENERAL, - PERSONA_STATUS_REASON_CODES_SUSPENDED_MISCONDUCT_HARASSMENT, - PERSONA_STATUS_REASON_CODES_SUSPENDED_MISCONDUCT_MACROING, - PERSONA_STATUS_REASON_CODES_SUSPENDED_MISCONDUCT_EXPLOITATION, - PERSONA_STATUS_REASON_CODES_SUSPENDED_FRAUD, - PERSONA_STATUS_REASON_CODES_CUSTOMER_OPT_OUT, - PERSONA_STATUS_REASON_CODES_CUSTOMER_UNDER_AGE, - PERSONA_STATUS_REASON_CODES_EMAIL_CONFIRMATION_REQUIRED, - PERSONA_STATUS_REASON_CODES_MISTYPED_ID, - PERSONA_STATUS_REASON_CODES_ABUSED_ID, - PERSONA_STATUS_REASON_CODES_DEACTIVATED_EMAIL_LINK, - PERSONA_STATUS_REASON_CODES_DEACTIVATED_CS, - PERSONA_STATUS_REASON_CODES_CLAIMED_BY_TRUE_OWNER, - PERSONA_STATUS_REASON_CODES_BANNED, - PERSONA_STATUS_REASON_CODES_DEACTIVATED_AFFILIATE - } - - NimbleIdentityPersona() { - } - - public NimbleIdentityPersona(Map map, Date date) { - this.personaId = getLongFromObject(map.get("personaId")); - this.pidId = map.get("pidId").toString(); - this.displayName = (String) map.get("displayName"); - this.name = (String) map.get("name"); - this.namespaceName = (String) map.get("namespaceName"); - this.status = toEnumPersonaStatus((String) map.get("status")); - this.statusReasonCode = toEnumPersonaStatusReasonCodes((String) map.get("statusReasonCode")); - this.showPersona = toEnumPersonaPrivacyLevel((String) map.get("showPersona")); - this.dateCreated = (String) map.get("dateCreated"); - this.lastAuthenticated = (String) map.get("lastAuthenticated"); - Object obj = map.get("isVisible"); - if (obj != null) { - if (obj instanceof Boolean) { - if (((Boolean) obj) == Boolean.TRUE) { - this.isVisible = "true"; - } else { - this.isVisible = "false"; - } - } else if (obj instanceof String) { - this.isVisible = (String) obj; - } - } - this.expiryTime = date; - } - - private long getLongFromObject(Object obj) { - if (obj instanceof Long) { - return ((Long) obj).longValue(); - } - if (obj instanceof Integer) { - return (long) ((Integer) obj).intValue(); - } - Log.Helper.LOGES("Identity", "Can't convert object of type " + obj.getClass().getName() + " to long", new Object[0]); - return 0; - } - - public static PersonaPrivacyLevel toEnumPersonaPrivacyLevel(String str) { - PersonaPrivacyLevel personaPrivacyLevel = PersonaPrivacyLevel.PERSONA_PRIVACY_LEVEL_NONE; - if (str.equalsIgnoreCase("NO_ONE")) { - personaPrivacyLevel = PersonaPrivacyLevel.PERSONA_PRIVACY_LEVEL_NO_ONE; - } else if (str.equalsIgnoreCase("EVERYONE")) { - return PersonaPrivacyLevel.PERSONA_PRIVACY_LEVEL_EVERYONE; - } else { - if (str.equalsIgnoreCase("FRIENDS")) { - return PersonaPrivacyLevel.PERSONA_PRIVACY_LEVEL_FRIENDS; - } - if (str.equalsIgnoreCase("FRIENDS_OF_FRIENDS")) { - return PersonaPrivacyLevel.PERSONA_PRIVACY_LEVEL_FRIENDS_OF_FRIENDS; - } - } - return personaPrivacyLevel; - } - - public static PersonaStatus toEnumPersonaStatus(String str) { - PersonaStatus personaStatus = PersonaStatus.PERSONA_STATUS_NONE; - if (str.equalsIgnoreCase("PENDING")) { - personaStatus = PersonaStatus.PERSONA_STATUS_PENDING; - } else if (str.equalsIgnoreCase("ACTIVE")) { - return PersonaStatus.PERSONA_STATUS_ACTIVE; - } else { - if (str.equalsIgnoreCase("DEACTIVATED")) { - return PersonaStatus.PERSONA_STATUS_DEACTIVATED; - } - if (str.equalsIgnoreCase("DISABLE")) { - return PersonaStatus.PERSONA_STATUS_DISABLED; - } - if (str.equalsIgnoreCase("DELETED")) { - return PersonaStatus.PERSONA_STATUS_DELETED; - } - if (str.equalsIgnoreCase("BANNED")) { - return PersonaStatus.PERSONA_STATUS_BANNED; - } - } - return personaStatus; - } - - public static PersonaStatusReasonCodes toEnumPersonaStatusReasonCodes(String str) { - PersonaStatusReasonCodes personaStatusReasonCodes = PersonaStatusReasonCodes.PERSONA_STATUS_REASON_CODES_NONE; - if (str.equalsIgnoreCase("CODES_ONE")) { - personaStatusReasonCodes = PersonaStatusReasonCodes.PERSONA_STATUS_REASON_CODES_ONE; - } else if (str.equalsIgnoreCase("REACTIVATED_CUSTOMER")) { - return PersonaStatusReasonCodes.PERSONA_STATUS_REASON_CODES_REACTIVATED_CUSTOMER; - } else { - if (str.equalsIgnoreCase("INVALID_EMAIL")) { - return PersonaStatusReasonCodes.PERSONA_STATUS_REASON_CODES_INVALID_EMAIL; - } - if (str.equalsIgnoreCase("PRIVACY_POLICY")) { - return PersonaStatusReasonCodes.PERSONA_STATUS_REASON_CODES_PRIVACY_POLICY; - } - if (str.equalsIgnoreCase("PARENTS_REQUEST")) { - return PersonaStatusReasonCodes.PERSONA_STATUS_REASON_CODES_PARENTS_REQUEST; - } - if (str.equalsIgnoreCase("SUSPENDED_MISCONDUCT_GENERAL")) { - return PersonaStatusReasonCodes.PERSONA_STATUS_REASON_CODES_SUSPENDED_MISCONDUCT_GENERAL; - } - if (str.equalsIgnoreCase("SUSPENDED_MISCONDUCT_HARASSMENT")) { - return PersonaStatusReasonCodes.PERSONA_STATUS_REASON_CODES_SUSPENDED_MISCONDUCT_HARASSMENT; - } - if (str.equalsIgnoreCase("SUSPENDED_MISCONDUCT_MACROING")) { - return PersonaStatusReasonCodes.PERSONA_STATUS_REASON_CODES_SUSPENDED_MISCONDUCT_MACROING; - } - if (str.equalsIgnoreCase("SUSPENDED_MISCONDUCT_EXPLOITATION")) { - return PersonaStatusReasonCodes.PERSONA_STATUS_REASON_CODES_SUSPENDED_MISCONDUCT_EXPLOITATION; - } - if (str.equalsIgnoreCase("SUSPENDED_FRAUD")) { - return PersonaStatusReasonCodes.PERSONA_STATUS_REASON_CODES_SUSPENDED_FRAUD; - } - if (str.equalsIgnoreCase("CUSTOMER_OPT_OUT")) { - return PersonaStatusReasonCodes.PERSONA_STATUS_REASON_CODES_CUSTOMER_OPT_OUT; - } - if (str.equalsIgnoreCase("CUSTOMER_UNDER_AGE")) { - return PersonaStatusReasonCodes.PERSONA_STATUS_REASON_CODES_CUSTOMER_UNDER_AGE; - } - if (str.equalsIgnoreCase("EMAIL_CONFIRMATION_REQUIRED")) { - return PersonaStatusReasonCodes.PERSONA_STATUS_REASON_CODES_EMAIL_CONFIRMATION_REQUIRED; - } - if (str.equalsIgnoreCase("MISTYPED_ID")) { - return PersonaStatusReasonCodes.PERSONA_STATUS_REASON_CODES_MISTYPED_ID; - } - if (str.equalsIgnoreCase("ABUSED_ID")) { - return PersonaStatusReasonCodes.PERSONA_STATUS_REASON_CODES_ABUSED_ID; - } - if (str.equalsIgnoreCase("DEACTIVATED_EMAIL_LINK")) { - return PersonaStatusReasonCodes.PERSONA_STATUS_REASON_CODES_DEACTIVATED_EMAIL_LINK; - } - if (str.equalsIgnoreCase("DEACTIVATED_CS")) { - return PersonaStatusReasonCodes.PERSONA_STATUS_REASON_CODES_DEACTIVATED_CS; - } - if (str.equalsIgnoreCase("CLAIMED_BY_TRUE_OWNER")) { - return PersonaStatusReasonCodes.PERSONA_STATUS_REASON_CODES_CLAIMED_BY_TRUE_OWNER; - } - if (str.equalsIgnoreCase("BANNED")) { - return PersonaStatusReasonCodes.PERSONA_STATUS_REASON_CODES_BANNED; - } - if (str.equalsIgnoreCase("DEACTIVATED_AFFILIATE")) { - return PersonaStatusReasonCodes.PERSONA_STATUS_REASON_CODES_DEACTIVATED_AFFILIATE; - } - } - return personaStatusReasonCodes; - } - - public static String toStringPersonaPrivacyLevel(PersonaPrivacyLevel personaPrivacyLevel) { - switch (AnonymousClass1.$SwitchMap$com$ea$nimble$identity$NimbleIdentityPersona$PersonaPrivacyLevel[personaPrivacyLevel.ordinal()]) { - case 1: - return "NO_ONE"; - case 2: - return "EVERYONE"; - case 3: - return "FRIENDS"; - case 4: - return "FRIENDS_OF_FRIENDS"; - default: - return ""; - } - } - - public static String toStringPersonaStatus(PersonaStatus personaStatus) { - switch (AnonymousClass1.$SwitchMap$com$ea$nimble$identity$NimbleIdentityPersona$PersonaStatus[personaStatus.ordinal()]) { - case 1: - return "PENDING"; - case 2: - return "ACTIVE"; - case 3: - return "DEACTIVATED"; - case 4: - return "DISABLED"; - case 5: - return "DELETED"; - case 6: - return "BANNED"; - default: - return ""; - } - } - - public static String toStringPersonaStatusReasonCodes(PersonaStatusReasonCodes personaStatusReasonCodes) { - switch (AnonymousClass1.$SwitchMap$com$ea$nimble$identity$NimbleIdentityPersona$PersonaStatusReasonCodes[personaStatusReasonCodes.ordinal()]) { - case 1: - return "CODES_ONE"; - case 2: - return "REACTIVATED_CUSTOMER"; - case 3: - return "INVALID_EMAIL"; - case 4: - return "PRIVACY_POLICY"; - case 5: - return "PARENTS_REQUEST"; - case 6: - return "SUSPENDED_MISCONDUCT_GENERAL"; - case 7: - return "SUSPENDED_MISCONDUCT_HARASSMENT"; - case 8: - return "SUSPENDED_MISCONDUCT_MACROING"; - case 9: - return "SUSPENDED_MISCONDUCT_EXPLOITATION"; - case 10: - return "SUSPENDED_FRAUD"; - case 11: - return "CUSTOMER_OPT_OUT"; - case 12: - return "CUSTOMER_UNDER_AGE"; - case 13 /* 13 */: - return "EMAIL_CONFIRMATION_REQUIRED"; - case 14: - return "MISTYPED_ID"; - case 15 /* 15 */: - return "ABUSED_ID"; - case 16: - return "DEACTIVATED_EMAIL_LINK"; - case 17: - return "DEACTIVATED_CS"; - case 18: - return "CLAIMED_BY_TRUE_OWNER"; - case 19: - return "BANNED"; - case 20: - return "DEACTIVATED_AFFILIATE"; - default: - return ""; - } - } - - public String getDateCreated() { - return this.dateCreated; - } - - public String getDisplayName() { - return this.displayName; - } - - public Date getExpiryTime() { - return this.expiryTime; - } - - public String getLastAuthenticated() { - return this.lastAuthenticated; - } - - public String getName() { - return this.name; - } - - public String getNamespaceName() { - return this.namespaceName; - } - - public long getPersonaId() { - return this.personaId; - } - - public String getPidId() { - return this.pidId; - } - - public PersonaPrivacyLevel getShowPersona() { - return this.showPersona; - } - - public PersonaStatusReasonCodes getStatusReasonCode() { - return this.statusReasonCode; - } - - public PersonaStatus getStauts() { - return this.status; - } - - public String getVisible() { - return this.isVisible; - } - - public void setDateCreated(String str) { - this.dateCreated = str; - } - - public void setDisplayName(String str) { - this.displayName = str; - } - - public void setLastAuthenticated(String str) { - this.lastAuthenticated = str; - } - - public void setName(String str) { - this.name = str; - } - - public void setNamespaceName(String str) { - this.namespaceName = str; - } - - public void setPersonaId(long j) { - this.personaId = j; - } - - public void setPidId(String str) { - this.pidId = str; - } - - public void setShowPersona(PersonaPrivacyLevel personaPrivacyLevel) { - this.showPersona = personaPrivacyLevel; - } - - public void setStatusReasonCode(PersonaStatusReasonCodes personaStatusReasonCodes) { - this.statusReasonCode = personaStatusReasonCodes; - } - - public void setStauts(PersonaStatus personaStatus) { - this.status = personaStatus; - } - - public void setVisible(String str) { - this.isVisible = str; - } -} diff --git a/app/src/main/java/com/ea/nimble/identity/NimbleIdentityPidInfo.java b/app/src/main/java/com/ea/nimble/identity/NimbleIdentityPidInfo.java deleted file mode 100644 index 98b84aa..0000000 --- a/app/src/main/java/com/ea/nimble/identity/NimbleIdentityPidInfo.java +++ /dev/null @@ -1,201 +0,0 @@ -package com.ea.nimble.identity; - -import java.io.Serializable; -import java.util.Date; -import java.util.Map; - -/* loaded from: stdlib.jar:com/ea/nimble/identity/NimbleIdentityPidInfo.class */ -public class NimbleIdentityPidInfo implements Serializable { - private static final long serialVersionUID = 2; - private String anonymousPid; - private String authenticationSource; - private String country; - private String dateCreated; - private String dateModified; - private String dob; - private Date expiryTime; - private String language; - private String lastAuthDate; - private String locale; - private String pid; - private String reasonCode; - private String registrationSource; - private String status; - private String strength; - private String tosVersion; - - NimbleIdentityPidInfo() { - } - - public NimbleIdentityPidInfo(Map map, Date date) { - Map map2; - if (map != null && (map2 = (Map) map.get("pid")) != null) { - this.pid = map2.get("pidId").toString(); - this.anonymousPid = (String) map2.get("anonymousPid"); - this.authenticationSource = (String) map2.get("authenticationSource"); - this.country = (String) map2.get("country"); - this.dateCreated = (String) map2.get("dateCreated"); - this.dateModified = (String) map2.get("dateModified"); - this.dob = (String) map2.get("dob"); - this.language = (String) map2.get("language"); - this.lastAuthDate = (String) map2.get("lastAuthDate"); - this.locale = (String) map2.get("locale"); - this.reasonCode = (String) map2.get("reasonCode"); - this.registrationSource = (String) map2.get("registrationSource"); - this.status = (String) map2.get("status"); - this.strength = (String) map2.get("strength"); - this.tosVersion = (String) map2.get("tosVersion"); - this.expiryTime = date; - } - } - - @Override // java.lang.Object - public boolean equals(Object obj) { - boolean z; - if (!(obj instanceof NimbleIdentityPidInfo)) { - z = false; - } else { - z = true; - if (this != obj) { - NimbleIdentityPidInfo nimbleIdentityPidInfo = (NimbleIdentityPidInfo) obj; - if (!this.pid.equals(nimbleIdentityPidInfo.pid) || !this.strength.equals(nimbleIdentityPidInfo.strength) || !this.dob.equals(nimbleIdentityPidInfo.dob) || !this.country.equals(nimbleIdentityPidInfo.country) || !this.language.equals(nimbleIdentityPidInfo.language) || !this.locale.equals(nimbleIdentityPidInfo.locale) || !this.status.equals(nimbleIdentityPidInfo.status) || !this.reasonCode.equals(nimbleIdentityPidInfo.reasonCode) || !this.tosVersion.equals(nimbleIdentityPidInfo.tosVersion) || !this.dateCreated.equals(nimbleIdentityPidInfo.dateCreated) || !this.dateModified.equals(nimbleIdentityPidInfo.dateModified) || !this.lastAuthDate.equals(nimbleIdentityPidInfo.lastAuthDate) || !this.registrationSource.equals(nimbleIdentityPidInfo.registrationSource) || !this.authenticationSource.equals(nimbleIdentityPidInfo.authenticationSource)) { - return false; - } - z = true; - if (!this.anonymousPid.equals(nimbleIdentityPidInfo.anonymousPid)) { - return false; - } - } - } - return z; - } - - public String getAnonymousPid() { - return this.anonymousPid; - } - - public String getAuthenticationSource() { - return this.authenticationSource; - } - - public String getCountry() { - return this.country; - } - - public String getDateCreated() { - return this.dateCreated; - } - - public String getDateModified() { - return this.dateModified; - } - - public String getDob() { - return this.dob; - } - - public Date getExpiryTime() { - return this.expiryTime; - } - - public String getLanguage() { - return this.language; - } - - public String getLastAuthDate() { - return this.lastAuthDate; - } - - public String getLocale() { - return this.locale; - } - - public String getPid() { - return this.pid; - } - - public String getReasonCode() { - return this.reasonCode; - } - - public String getRegistrationSource() { - return this.registrationSource; - } - - public String getStatus() { - return this.status; - } - - public String getStrength() { - return this.strength; - } - - public String getTosVersion() { - return this.tosVersion; - } - - public void setAnonymousPid(String str) { - this.anonymousPid = str; - } - - public void setAuthenticationSource(String str) { - this.authenticationSource = str; - } - - public void setCountry(String str) { - this.country = str; - } - - public void setDateCreated(String str) { - this.dateCreated = str; - } - - public void setDateModified(String str) { - this.dateModified = str; - } - - public void setDob(String str) { - this.dob = str; - } - - /* JADX INFO: Access modifiers changed from: package-private */ - public void setExpiryTime(Date date) { - this.expiryTime = date; - } - - public void setLanguage(String str) { - this.language = str; - } - - public void setLastAuthDate(String str) { - this.lastAuthDate = str; - } - - public void setLocale(String str) { - this.locale = str; - } - - public void setPidId(String str) { - this.pid = str; - } - - public void setReasonCode(String str) { - this.reasonCode = str; - } - - public void setRegistrationSource(String str) { - this.registrationSource = str; - } - - public void setStatus(String str) { - this.status = str; - } - - public void setStrength(String str) { - this.strength = str; - } - - public void setTosVersion(String str) { - this.tosVersion = str; - } -} diff --git a/app/src/main/java/com/ea/nimble/identity/NimbleIdentityPlainAuthenticationConductorHandler.java b/app/src/main/java/com/ea/nimble/identity/NimbleIdentityPlainAuthenticationConductorHandler.java deleted file mode 100644 index 5c29d21..0000000 --- a/app/src/main/java/com/ea/nimble/identity/NimbleIdentityPlainAuthenticationConductorHandler.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.ea.nimble.identity; - -import com.ea.nimble.Global; -import com.ea.nimble.Log; - -/* loaded from: stdlib.jar:com/ea/nimble/identity/NimbleIdentityPlainAuthenticationConductorHandler.class */ -public class NimbleIdentityPlainAuthenticationConductorHandler implements NimbleIdentityAuthenticationConductorHandler { - private INimbleIdentityPlainAuthenticationConductor m_conductor; - - public NimbleIdentityPlainAuthenticationConductorHandler(INimbleIdentityAuthenticationConductor iNimbleIdentityAuthenticationConductor) { - this.m_conductor = (INimbleIdentityPlainAuthenticationConductor) iNimbleIdentityAuthenticationConductor; - } - - @Override // com.ea.nimble.identity.NimbleIdentityAuthenticationConductorHandler - public void handleLogin(INimbleIdentityAuthenticator iNimbleIdentityAuthenticator, boolean z) { - if (iNimbleIdentityAuthenticator.getAuthenticatorId() == Global.NIMBLE_AUTHENTICATOR_ANONYMOUS && NimbleIdentityImpl.getComponent().getMainAuthenticator() == null) { - NimbleIdentityImpl.getComponent().setMainAuthenticator(iNimbleIdentityAuthenticator); - } - Log.Helper.LOGD(this, "New authenticator %s being LogIn handled by Plain authenticator.", iNimbleIdentityAuthenticator.getAuthenticatorId()); - } - - @Override // com.ea.nimble.identity.NimbleIdentityAuthenticationConductorHandler - public void handleLogout(INimbleIdentityAuthenticator iNimbleIdentityAuthenticator) { - Log.Helper.LOGD(this, "New authenticator %s being LogOut handled by Plain authenticator.", iNimbleIdentityAuthenticator.getAuthenticatorId()); - } -} diff --git a/app/src/main/java/com/ea/nimble/identity/NimbleIdentityToken.java b/app/src/main/java/com/ea/nimble/identity/NimbleIdentityToken.java deleted file mode 100644 index e1c1e12..0000000 --- a/app/src/main/java/com/ea/nimble/identity/NimbleIdentityToken.java +++ /dev/null @@ -1,76 +0,0 @@ -package com.ea.nimble.identity; - -import com.ea.nimble.Log; -import java.io.Serializable; -import java.util.Date; -import java.util.Map; - -/* JADX INFO: Access modifiers changed from: package-private */ -/* loaded from: stdlib.jar:com/ea/nimble/identity/NimbleIdentityToken.class */ -public class NimbleIdentityToken implements Serializable { - private static final String NIMBLE_IDENTITY_REFRESH_TOKEN_EXPIRES_IN = "refresh_token_expires_in"; - private static final String NIMBLE_IDENTITY_TOKEN_ACCESS_TOKEN = "access_token"; - private static final String NIMBLE_IDENTITY_TOKEN_EXPIRES_IN = "expires_in"; - private static final String NIMBLE_IDENTITY_TOKEN_ID_TOKEN = "id_token"; - private static final String NIMBLE_IDENTITY_TOKEN_REFRESH_TOKEN = "refresh_token"; - private static final String NIMBLE_IDENTITY_TOKEN_TYPE = "token_type"; - private static final long serialVersionUID = 2; - private String accessToken; - private Date accessTokenExpiryTime; - private String idToken; - private String refreshToken; - private Date refreshTokenExpiryTime; - private String type; - - public NimbleIdentityToken() { - } - - public NimbleIdentityToken(Map map) { - this.accessToken = (String) map.get("access_token"); - this.refreshToken = (String) map.get(NIMBLE_IDENTITY_TOKEN_REFRESH_TOKEN); - this.idToken = (String) map.get(NIMBLE_IDENTITY_TOKEN_ID_TOKEN); - this.type = (String) map.get(NIMBLE_IDENTITY_TOKEN_TYPE); - long currentTimeMillis = System.currentTimeMillis(); - this.accessTokenExpiryTime = new Date(getTimeFromObject(map.get("expires_in")) + currentTimeMillis); - this.refreshTokenExpiryTime = new Date(getTimeFromObject(map.get(NIMBLE_IDENTITY_REFRESH_TOKEN_EXPIRES_IN)) + currentTimeMillis); - } - - private long getTimeFromObject(Object obj) { - double d; - if (obj instanceof String) { - d = Double.parseDouble((String) obj); - } else if (obj instanceof Double) { - d = ((Double) obj).doubleValue(); - } else if (obj instanceof Integer) { - return (long) (((Integer) obj).intValue() * 1000); - } else { - Log.Helper.LOGES("Identity", "Couldn't get time from object of type " + obj.getClass().getName(), new Object[0]); - d = 0.0d; - } - return (long) (1000.0d * d); - } - - public String getAccessToken() { - return this.accessToken; - } - - public Date getAccessTokenExpiryTime() { - return this.accessTokenExpiryTime; - } - - public String getIdToken() { - return this.idToken; - } - - public String getRefreshToken() { - return this.refreshToken; - } - - public Date getRefreshTokenExpiryTime() { - return this.refreshTokenExpiryTime; - } - - public String getType() { - return this.type; - } -} diff --git a/app/src/main/java/com/ea/nimble/identity/NimbleIdentityUserInfo.java b/app/src/main/java/com/ea/nimble/identity/NimbleIdentityUserInfo.java deleted file mode 100644 index 14a0e2b..0000000 --- a/app/src/main/java/com/ea/nimble/identity/NimbleIdentityUserInfo.java +++ /dev/null @@ -1,92 +0,0 @@ -package com.ea.nimble.identity; - -import java.io.Serializable; -import java.util.Date; - -/* loaded from: stdlib.jar:com/ea/nimble/identity/NimbleIdentityUserInfo.class */ -public class NimbleIdentityUserInfo implements Serializable, Cloneable { - private static final long serialVersionUID = 1; - private String avatarUri; - private String dateOfBirth; - private String displayName; - private String email; - private Date expiryTime; - private String pid; - private String userId; - private String userName; - - @Override // java.lang.Object - public NimbleIdentityUserInfo clone() { - try { - return (NimbleIdentityUserInfo) super.clone(); - } catch (CloneNotSupportedException e) { - return null; - } - } - - public String getAvatarUri() { - return this.avatarUri; - } - - public String getDateOfBirth() { - return this.dateOfBirth; - } - - public String getDisplayName() { - return this.displayName; - } - - public String getEmail() { - return this.email; - } - - public Date getExpiryTime() { - return this.expiryTime; - } - - public String getPid() { - return this.pid; - } - - public String getUserId() { - return this.userId; - } - - public String getuserName() { - return this.userName; - } - - public void setAvatarUri(String str) { - this.avatarUri = str; - } - - public void setDateOfBirth(String str) { - this.dateOfBirth = str; - } - - public void setDisplayName(String str) { - this.displayName = str; - } - - public void setEmail(String str) { - this.email = str; - } - - /* JADX INFO: Access modifiers changed from: package-private */ - public void setExpiryTime(Date date) { - this.expiryTime = date; - } - - public void setPid(String str) { - this.pid = str; - } - - /* JADX INFO: Access modifiers changed from: package-private */ - public void setUserId(String str) { - this.userId = str; - } - - public void setUserName(String str) { - this.userName = str; - } -} diff --git a/app/src/main/java/com/ea/nimble/identity/NimbleIdentityUtility.java b/app/src/main/java/com/ea/nimble/identity/NimbleIdentityUtility.java deleted file mode 100644 index 23a037a..0000000 --- a/app/src/main/java/com/ea/nimble/identity/NimbleIdentityUtility.java +++ /dev/null @@ -1,92 +0,0 @@ -package com.ea.nimble.identity; - -import android.annotation.SuppressLint; - -import com.ea.nimble.Error; -import com.ea.nimble.NetworkConnectionHandle; -import com.ea.nimble.Utility; - -import org.json.JSONException; -import org.json.JSONObject; - -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.UnsupportedEncodingException; -import java.text.SimpleDateFormat; -import java.util.Date; -import java.util.HashMap; -import java.util.Map; -import java.util.TimeZone; - -/* loaded from: stdlib.jar:com/ea/nimble/identity/NimbleIdentityUtility.class */ -class NimbleIdentityUtility { - public static final String NIMBLE_IDENTITY_DEVICE_UNIQUE_IDENTIFIER = "nimble.identity.device.unique.identifier"; - static int counter = 0; - - NimbleIdentityUtility() { - } - - @SuppressLint({"SimpleDateFormat"}) - public static String getCurrentTimeString() { - return new SimpleDateFormat("yyyy-MM-DD HH:mm:ss").format(new Date()); - } - - @SuppressLint({"SimpleDateFormat"}) - public static String getTimeString(Date date) { - SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-DD HH:mm:ss"); - simpleDateFormat.setTimeZone(TimeZone.getTimeZone("GMT")); - return simpleDateFormat.format(date); - } - - public static Map parseBodyJSONData(NetworkConnectionHandle networkConnectionHandle) throws Error { - return Utility.convertJSONObjectToMap(parseJsonResponse(networkConnectionHandle)); - } - - public static JSONObject parseJsonResponse(NetworkConnectionHandle networkConnectionHandle) throws Error { - Exception error = networkConnectionHandle.getResponse().getError(); - if (error == null) { - InputStream dataStream = networkConnectionHandle.getResponse().getDataStream(); - if (dataStream == null) { - throw new Error(Error.Code.NETWORK_INVALID_SERVER_RESPONSE, "Cannot understand server response, expecting JSON string but get invalid data"); - } - try { - try { - JSONObject jSONObject = new JSONObject(Utility.readStringFromStream(dataStream)); - if (!Utility.validString((String) jSONObject.opt("error"))) { - return jSONObject; - } - throw NimbleIdentityError.createWithData(Utility.convertJSONObjectToMap(jSONObject)); - } catch (JSONException e) { - throw new Error(Error.Code.NETWORK_INVALID_SERVER_RESPONSE, "Invalid JSON received from server", e); - } - } catch (IOException e2) { - throw new Error(Error.Code.NETWORK_INVALID_SERVER_RESPONSE, "Error reading server response", e2); - } - } else if (error instanceof Error) { - throw ((Error) error); - } else { - throw new Error(Error.Code.UNKNOWN, "Unknown error while parsing network response", error); - } - } - - public static HashMap parseRedirectURLParameters(NetworkConnectionHandle networkConnectionHandle) { - String url = networkConnectionHandle.getResponse().getUrl().toString(); - HashMap hashMap = new HashMap<>(); - String str = ""; - if (url.split("\\?").length == 2) { - str = url.split("\\?")[0]; - } - String[] split = str.split("&"); - for (String str2 : split) { - if (str2.split("=").length == 2) { - hashMap.put(str2.split("=")[0], str2.split("=")[1]); - } - } - return hashMap; - } - - public static ByteArrayOutputStream toJSONString(HashMap hashMap) { - return null; - } -} diff --git a/app/src/main/java/com/ea/nimble/inappmessage/IInAppMessage.java b/app/src/main/java/com/ea/nimble/inappmessage/IInAppMessage.java deleted file mode 100644 index f61d174..0000000 --- a/app/src/main/java/com/ea/nimble/inappmessage/IInAppMessage.java +++ /dev/null @@ -1,10 +0,0 @@ -package com.ea.nimble.inappmessage; - -import com.ea.nimble.inappmessage.Message; - -public interface IInAppMessage { - Message popMessageFromCache(); - - void showInAppMessage(); -} - diff --git a/app/src/main/java/com/ea/nimble/inappmessage/InAppMessage.java b/app/src/main/java/com/ea/nimble/inappmessage/InAppMessage.java deleted file mode 100644 index 82cb634..0000000 --- a/app/src/main/java/com/ea/nimble/inappmessage/InAppMessage.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Decompiled with CFR 0.152. - */ -package com.ea.nimble.inappmessage; - -import com.ea.nimble.Base; -import com.ea.nimble.Log; -import com.ea.nimble.inappmessage.IInAppMessage; -import com.ea.nimble.inappmessage.InAppMessageImpl; - -public class InAppMessage { - public static final String COMPONENT_ID = "com.ea.nimble.inappmessage"; - public static final String MESSAGE_EXCLUDE_ID = "messageExcludeID"; - static final String MESSAGE_PERSISTENCE_ID = "currentInAppMessage"; - public static final String NOTIFICATION_IN_APP_MESSAGE_REFRESH = "nimble.inappmessage.notification.message_refresh"; - - public static IInAppMessage getComponent() { - return (IInAppMessage)((Object)Base.getComponent(COMPONENT_ID)); - } - - private static void initialize() { - Log.Helper.LOGDS("IAM", "IAM initialize"); - Base.registerComponent(new InAppMessageImpl(), COMPONENT_ID); - } -} - diff --git a/app/src/main/java/com/ea/nimble/inappmessage/InAppMessageImpl.java b/app/src/main/java/com/ea/nimble/inappmessage/InAppMessageImpl.java deleted file mode 100644 index 3a9ad87..0000000 --- a/app/src/main/java/com/ea/nimble/inappmessage/InAppMessageImpl.java +++ /dev/null @@ -1,304 +0,0 @@ -/* - * Decompiled with CFR 0.152. - * - * Could not load the following classes: - * android.app.AlertDialog$Builder - * android.content.BroadcastReceiver - * android.content.ContentResolver - * android.content.Context - * android.content.DialogInterface - * android.content.DialogInterface$OnClickListener - * android.content.Intent - * android.net.Uri - * android.provider.Settings$Secure - * org.json.JSONException - * org.json.JSONObject - */ -package com.ea.nimble.inappmessage; - -import android.app.AlertDialog; -import android.content.BroadcastReceiver; -import android.content.ContentResolver; -import android.content.Context; -import android.content.Intent; -import android.net.Uri; -import android.os.Bundle; -import android.provider.Settings; - -import com.ea.nimble.ApplicationEnvironment; -import com.ea.nimble.Component; -import com.ea.nimble.IApplicationEnvironment; -import com.ea.nimble.ISynergyEnvironment; -import com.ea.nimble.ISynergyIdManager; -import com.ea.nimble.Log; -import com.ea.nimble.LogSource; -import com.ea.nimble.Persistence; -import com.ea.nimble.PersistenceService; -import com.ea.nimble.SynergyEnvironment; -import com.ea.nimble.SynergyIdManager; -import com.ea.nimble.SynergyNetwork; -import com.ea.nimble.SynergyNetworkConnectionCallback; -import com.ea.nimble.SynergyNetworkConnectionHandle; -import com.ea.nimble.Utility; - -import org.json.JSONException; -import org.json.JSONObject; - -import java.io.Serializable; -import java.net.HttpURLConnection; -import java.net.URL; -import java.net.URLConnection; -import java.util.HashMap; -import java.util.Locale; - -public class InAppMessageImpl -extends Component -implements LogSource, -IInAppMessage { - private BroadcastReceiver m_receiver; - private SynergyNetworkConnectionHandle m_synergyNetworkConnectionHandle; - - static /* synthetic */ SynergyNetworkConnectionHandle access$102(InAppMessageImpl inAppMessageImpl, SynergyNetworkConnectionHandle synergyNetworkConnectionHandle) { - inAppMessageImpl.m_synergyNetworkConnectionHandle = synergyNetworkConnectionHandle; - return synergyNetworkConnectionHandle; - } - - private static void addMessageToCache(Message message) { - int n2; - if (message == null) { - return; - } - Persistence persistence = PersistenceService.getPersistenceForNimbleComponent("com.ea.nimble.inappmessage", Persistence.Storage.CACHE); - Serializable serializable = persistence.getValue("messageExcludeID"); - int n3 = n2 = -1; - if (serializable != null) { - n3 = n2; - if (serializable.getClass() == Integer.class) { - try { - n3 = (Integer)serializable; - } - catch (ClassCastException classCastException) { - Log.Helper.LOGES("IAM", "Invalid persistence value for excludeID, expected Integer"); - n3 = n2; - } - } - } - if (message.m_messageID <= n3) return; - persistence.setValue("currentInAppMessage", message); - persistence.synchronize(); - Utility.sendBroadcast("nimble.inappmessage.notification.message_refresh", null); - } - - private Message getMessageFromCache() { - Message message = null; - Message message2 = (Message)PersistenceService.getPersistenceForNimbleComponent("com.ea.nimble.inappmessage", Persistence.Storage.CACHE).getValue("currentInAppMessage"); - if (message2 == null) return message; - return message2; - } - - private void refreshInAppMessage() { - Log.Helper.LOGD(this, "refresh in app message cache"); - IApplicationEnvironment iApplicationEnvironment = ApplicationEnvironment.getComponent(); - ISynergyEnvironment iSynergyEnvironment = SynergyEnvironment.getComponent(); - ISynergyIdManager iSynergyIdManager = SynergyIdManager.getComponent(); - HashMap hashMap = new HashMap(); - hashMap.put("language", iApplicationEnvironment.getShortApplicationLanguageCode()); - hashMap.put("localization", iApplicationEnvironment.getApplicationLanguageCode()); - hashMap.put("deviceLanguage", Locale.getDefault().getLanguage()); - hashMap.put("deviceLocale", Locale.getDefault().toString()); - hashMap.put("apiVer", "1.0.1"); - hashMap.put("appVer", iApplicationEnvironment.getApplicationVersion()); - hashMap.put("hwId", iSynergyEnvironment.getEAHardwareId()); - hashMap.put("sellId", SynergyEnvironment.getComponent().getSellId()); - hashMap.put("uid", iSynergyIdManager.getSynergyId()); - hashMap.put("type", "4"); - hashMap.put("excludeIds", ""); - this.m_synergyNetworkConnectionHandle = SynergyNetwork.getComponent().sendGetRequest(SynergyEnvironment.getComponent().getServerUrlWithKey("synergy.m2u"), "/m2u/api/core/getMessage", hashMap, new SynergyNetworkConnectionCallback(){ - - /* - * Enabled unnecessary exception pruning - */ - @Override - public void callback(SynergyNetworkConnectionHandle object) { - Log.Helper.LOGD(this, "IAM callback done is status code: " + object.getResponse().getHttpResponse().getStatusCode()); - InAppMessageImpl.access$102(InAppMessageImpl.this, null); - if (object.getResponse().getError() != null) return; - try { - JSONObject jsonObject = new JSONObject(object.getResponse().getJsonData()); - String string2 = jsonObject.getString("resultCode"); - Log.Helper.LOGD(this, "getMessage result code " + string2 + "~"); - if (string2.compareTo("-50005") == 0) { - return; - } - if (string2.compareTo("1") != 0) return; - Log.Helper.LOGD(this, "getMessage BODY: " + object); - String string3 = jsonObject.getString("message"); - String string4 = jsonObject.getString("title"); - Object object2 = jsonObject.getString("url"); - int n2 = jsonObject.getInt("messageId"); - string2 = ""; - String shortApplicationLanguageCode = ApplicationEnvironment.getComponent().getShortApplicationLanguageCode(); - - try { - object2 = (HttpURLConnection)new URL((String)object2).openConnection(); - ((URLConnection)object2).setConnectTimeout(15000); - ((URLConnection)object2).setReadTimeout(15000); - ((HttpURLConnection)object2).setInstanceFollowRedirects(false); - ((URLConnection)object2).connect(); - object2 = ((URLConnection)object2).getHeaderField("Location"); - String string5 = Settings.Secure.getString((ContentResolver)ApplicationEnvironment.getComponent().getApplicationContext().getContentResolver(), (String)"android_id"); - String string6 = ApplicationEnvironment.getComponent().getGoogleAdvertisingId(); - string5 = (String)object2 + "&android_id=" + string5; - object2 = string5; - if (string6 != null) { - object2 = string5; - if (string6.length() == 0) { - object2 = string5 + "&google_aid=" + string6; - } - } - InAppMessageImpl.addMessageToCache(new Message(n2, string4, string3, (String)object2, string2, null, null)); - return; - } - catch (Exception exception) { - System.out.println("error happened: " + exception.toString()); - } - return; - } - catch (JSONException jSONException) { - jSONException.printStackTrace(); - return; - } - } - }); - } - - private boolean refreshInAppMessageCache() { - if (SynergyEnvironment.getComponent().isDataAvailable()) { - this.refreshInAppMessage(); - return true; - } - if (this.m_receiver != null) return false; - this.m_receiver = new BroadcastReceiver(){ - - public void onReceive(Context context, Intent intent) { - Bundle extras = intent.getExtras(); - if (extras == null) return; - if (!extras.getString("result").equals("1")) return; - InAppMessageImpl.this.refreshInAppMessage(); - } - }; - Utility.registerReceiver("nimble.environment.notification.startup_requests_finished", this.m_receiver); - Utility.registerReceiver("nimble.environment.notification.restored_from_persistent", this.m_receiver); - return false; - } - - private void removeMessageFromCache(Message message) { - if (message == null) { - Log.Helper.LOGD(this, "Removing msg from cache but no message to remove"); - return; - } - Persistence persistence = PersistenceService.getPersistenceForNimbleComponent("com.ea.nimble.inappmessage", Persistence.Storage.CACHE); - Message message2 = (Message)persistence.getValue("currentInAppMessage"); - if (message2 == null) { - Log.Helper.LOGD(this, "Removing message from cache but nothing in the cache"); - return; - } - if (message2.m_messageID != message.m_messageID) return; - Log.Helper.LOGD(this, "Removing message from cache. Removed successfully"); - persistence.setValue("currentInAppMessage", null); - persistence.setValue("messageExcludeID", Integer.valueOf(message.m_messageID)); - persistence.synchronize(); - } - - @Override - public void cleanup() { - Log.Helper.LOGD(this, "cleanup"); - SynergyNetworkConnectionHandle synergyNetworkConnectionHandle = this.m_synergyNetworkConnectionHandle; - if (synergyNetworkConnectionHandle != null) { - Log.Helper.LOGD(this, "Canceling network connection."); - synergyNetworkConnectionHandle.cancel(); - this.m_synergyNetworkConnectionHandle = null; - } - if (this.m_receiver == null) return; - Utility.unregisterReceiver(this.m_receiver); - this.m_receiver = null; - } - - @Override - public String getComponentId() { - return "com.ea.nimble.inappmessage"; - } - - @Override - public String getLogSourceTitle() { - return "IAM"; - } - - @Override - public Message popMessageFromCache() { - Message message = this.getMessageFromCache(); - if (message != null) { - this.removeMessageFromCache(message); - Log.Helper.LOGV(this, "----- BEGIN POPPED IAM INFO -----"); - Log.Helper.LOGV(this, "messageId = " + message.getMessageId()); - Log.Helper.LOGV(this, "title = " + message.getTitle()); - Log.Helper.LOGV(this, "message = " + message.getMessage()); - Log.Helper.LOGV(this, "url = " + message.getUrl()); - Log.Helper.LOGV(this, "buttonLabel1 = " + message.buttonLabel1Title()); - Log.Helper.LOGV(this, "buttonLabel2 = " + message.buttonLabel2Title()); - Log.Helper.LOGV(this, "buttonLabel3 = " + message.buttonLabel3Title()); - Log.Helper.LOGV(this, "----- END POPPED IAM INFO -----"); - return message; - } - Log.Helper.LOGD(this, "No message in cache to display info for."); - return null; - } - - @Override - public void restore() { - Log.Helper.LOGD(this, "restore"); - this.refreshInAppMessageCache(); - } - - @Override - public void resume() { - Log.Helper.LOGD(this, "resume"); - this.refreshInAppMessageCache(); - } - - @Override - public void setup() { - Log.Helper.LOGD(this, "setup"); - } - - @Override - public void showInAppMessage() { - final Message message = (Message)PersistenceService.getPersistenceForNimbleComponent("com.ea.nimble.inappmessage", Persistence.Storage.CACHE).getValue("currentInAppMessage"); - if (message == null) { - return; - } - this.removeMessageFromCache(message); - final AlertDialog.Builder builder = new AlertDialog.Builder(ApplicationEnvironment.getCurrentActivity()); - builder.setTitle(message.m_title); - builder.setMessage(message.m_message); - if (message.m_buttonLabel1Title != null && message.m_url != null && !message.m_url.equals("")) { - builder.setPositiveButton(message.m_buttonLabel1Title, (dialogInterface, n2) -> { - Intent intent = new Intent("android.intent.action.VIEW", Uri.parse(message.m_url)); - ApplicationEnvironment.getCurrentActivity().startActivity(intent); - }); - } - if (message.m_buttonLabel2Title != null) { - builder.setNegativeButton((CharSequence)message.m_buttonLabel2Title, (dialogInterface, n2) -> dialogInterface.cancel()); - } - ApplicationEnvironment.getCurrentActivity().runOnUiThread(builder::show); - } - - @Override - public void suspend() { - if (this.m_synergyNetworkConnectionHandle == null) return; - Log.Helper.LOGD(this, "Canceling network connection."); - this.m_synergyNetworkConnectionHandle.cancel(); - this.m_synergyNetworkConnectionHandle = null; - } -} - diff --git a/app/src/main/java/com/ea/nimble/inappmessage/Message.java b/app/src/main/java/com/ea/nimble/inappmessage/Message.java deleted file mode 100644 index ddfeb49..0000000 --- a/app/src/main/java/com/ea/nimble/inappmessage/Message.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Decompiled with CFR 0.152. - */ -package com.ea.nimble.inappmessage; - -import java.io.Serializable; - -public class Message -implements Serializable { - private static final long serialVersionUID = 1L; - String m_buttonLabel1Title; - String m_buttonLabel2Title; - String m_buttonLabel3Title; - String m_message; - int m_messageID; - String m_title; - String m_url; - - Message() { - } - - Message(int n2, String string2, String string3, String string4, String string5, String string6, String string7) { - this.m_messageID = n2; - this.m_title = string2; - this.m_message = string3; - this.m_url = string4; - this.m_buttonLabel1Title = string5; - this.m_buttonLabel2Title = string6; - this.m_buttonLabel3Title = string7; - } - - public String buttonLabel1Title() { - return this.m_buttonLabel1Title; - } - - public String buttonLabel2Title() { - return this.m_buttonLabel2Title; - } - - public String buttonLabel3Title() { - return this.m_buttonLabel3Title; - } - - public String getMessage() { - return this.m_message; - } - - public int getMessageId() { - return this.m_messageID; - } - - public String getTitle() { - return this.m_title; - } - - public String getUrl() { - return this.m_url; - } -} - diff --git a/app/src/main/java/com/ea/nimble/mtx/INimbleMTX.java b/app/src/main/java/com/ea/nimble/mtx/INimbleMTX.java deleted file mode 100644 index 75b44ce..0000000 --- a/app/src/main/java/com/ea/nimble/mtx/INimbleMTX.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Decompiled with CFR 0.152. - */ -package com.ea.nimble.mtx; - -import com.ea.nimble.Error; -import com.ea.nimble.mtx.NimbleCatalogItem; -import com.ea.nimble.mtx.NimbleMTXTransaction; -import java.util.List; -import java.util.Map; - -public interface INimbleMTX { - public static final String NIMBLE_NOTIFICATION_MTX_REFRESH_CATALOG_FINISHED = "nimble.notification.mtx.refreshcatalogfinished"; - public static final String NIMBLE_NOTIFICATION_MTX_RESTORE_PURCHASED_TRANSACTIONS_FINISHED = "nimble.notification.mtx.restorepurchasedtransactionsfinished"; - public static final String NIMBLE_NOTIFICATION_MTX_TRANSACTIONS_RECOVERED = "nimble.notification.mtx.transactionsrecovered"; - public static final String NOTIFICATION_DICTIONARY_KEY_TRANSACTIONID = "TRANSACTION_ID"; - - public Error finalizeTransaction(String var1, FinalizeTransactionCallback var2); - - public List getAvailableCatalogItems(); - - public List getPendingTransactions(); - - public List getPurchasedTransactions(); - - public List getRecoveredTransactions(); - - public Error itemGranted(String var1, NimbleCatalogItem.ItemType var2, ItemGrantedCallback var3); - - public Error purchaseItem(String var1, PurchaseTransactionCallback var2); - - public void refreshAvailableCatalogItems(); - - public void restorePurchasedTransactions(); - - public Error resumeTransaction(String var1, PurchaseTransactionCallback var2, ItemGrantedCallback var3, FinalizeTransactionCallback var4); - - public void setPlatformParameters(Map var1); - - public static interface FinalizeTransactionCallback { - public void finalizeComplete(NimbleMTXTransaction var1); - } - - public static interface ItemGrantedCallback { - public void itemGrantedComplete(NimbleMTXTransaction var1); - } - - public static interface PurchaseTransactionCallback { - public void purchaseComplete(NimbleMTXTransaction var1); - - public void unverifiedReceiptReceived(NimbleMTXTransaction var1); - } -} - diff --git a/app/src/main/java/com/ea/nimble/mtx/NimbleCatalogItem.java b/app/src/main/java/com/ea/nimble/mtx/NimbleCatalogItem.java deleted file mode 100644 index 9703b9a..0000000 --- a/app/src/main/java/com/ea/nimble/mtx/NimbleCatalogItem.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Decompiled with CFR 0.152. - */ -package com.ea.nimble.mtx; - -import java.util.Map; - -public abstract class NimbleCatalogItem { - public abstract Map getAdditionalInfo(); - - public abstract String getDescription(); - - public abstract ItemType getItemType(); - - public abstract String getMetaDataUrl(); - - public abstract float getPriceDecimal(); - - public abstract String getPriceWithCurrencyAndFormat(); - - public abstract String getSku(); - - public abstract String getTitle(); - - public static enum ItemType { - UNKNOWN, - NONCONSUMABLE, - CONSUMABLE; - - } -} - diff --git a/app/src/main/java/com/ea/nimble/mtx/NimbleMTX.java b/app/src/main/java/com/ea/nimble/mtx/NimbleMTX.java deleted file mode 100644 index 21f485a..0000000 --- a/app/src/main/java/com/ea/nimble/mtx/NimbleMTX.java +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Decompiled with CFR 0.152. - */ -package com.ea.nimble.mtx; - -import com.ea.nimble.Base; -import com.ea.nimble.Component; -import com.ea.nimble.Log; -import com.ea.nimble.mtx.INimbleMTX; - -public class NimbleMTX { - public static final String COMPONENT_ID = "com.ea.nimble.mtx"; - - public static INimbleMTX getComponent() { - Component[] componentArray = Base.getComponentList(COMPONENT_ID); - if (componentArray == null) return null; - if (componentArray.length <= 0) return null; - if (componentArray.length == 1) return (INimbleMTX)((Object)componentArray[0]); - Log.Helper.LOGFS("MTX", "More than one MTX component registered!", new Object[0]); - return (INimbleMTX)((Object)componentArray[0]); - } -} - diff --git a/app/src/main/java/com/ea/nimble/mtx/NimbleMTXError.java b/app/src/main/java/com/ea/nimble/mtx/NimbleMTXError.java deleted file mode 100644 index 2ca05a3..0000000 --- a/app/src/main/java/com/ea/nimble/mtx/NimbleMTXError.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Decompiled with CFR 0.152. - */ -package com.ea.nimble.mtx; - -import com.ea.nimble.Error; - -public class NimbleMTXError -extends Error { - public static final String ERROR_DOMAIN = "NimbleMTXError"; - private static final long serialVersionUID = 1L; - - public NimbleMTXError() { - } - - public NimbleMTXError(Code code, String string2) { - super(ERROR_DOMAIN, code.intValue(), string2, null); - } - - public NimbleMTXError(Code code, String string2, Throwable throwable) { - super(ERROR_DOMAIN, code.intValue(), string2, throwable); - } - - public static enum Code { - BILLING_NOT_AVAILABLE(20000), - ITEM_ALREADY_OWNED(20001), - ITEM_NOT_OWNED(20002), - USER_CANCELED(20003), - VERIFICATION_ERROR(20004), - GET_NONCE_ERROR(20005), - NON_CRITICAL_INTERRUPTION(20006), - INTERNAL_STATE(20007), - TRANSACTION_PENDING(20008), - TRANSACTION_NOT_RESUMABLE(20009), - UNRECOGNIZED_TRANSACTION_ID(20010), - INVALID_TRANSACTION_STATE(20011), - UNABLE_TO_CONSTRUCT_REQUEST(20012), - PLATFORM_ERROR(20013), - INVALID_SERVER_RESPONSE(20014), - ERROR_GETTING_PREPURCHASE_INFO(20015), - ITEM_UNAVAILABLE(20016), - INVALID_SKU(20017), - TRANSACTION_DEFERRED(20018), - TRANSACTION_SUPERSEDED(20019); - - 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/mtx/NimbleMTXTransaction.java b/app/src/main/java/com/ea/nimble/mtx/NimbleMTXTransaction.java deleted file mode 100644 index 7a5bd53..0000000 --- a/app/src/main/java/com/ea/nimble/mtx/NimbleMTXTransaction.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Decompiled with CFR 0.152. - */ -package com.ea.nimble.mtx; - -import java.util.Date; -import java.util.Map; - -public interface NimbleMTXTransaction { - public Map getAdditionalInfo(); - - public Exception getError(); - - public String getItemSku(); - - public float getPriceDecimal(); - - public String getReceipt(); - - public Date getTimeStamp(); - - public String getTransactionId(); - - public TransactionState getTransactionState(); - - public TransactionType getTransactionType(); - - public static enum TransactionState { - UNDEFINED, - USER_INITIATED, - WAITING_FOR_PREPURCHASE_INFO, - WAITING_FOR_PLATFORM_RESPONSE, - WAITING_FOR_VERIFICATION, - WAITING_FOR_GAME_TO_CONFIRM_ITEM_GRANT, - WAITING_FOR_PLATFORM_CONSUMPTION, - COMPLETE; - - } - - public static enum TransactionType { - PURCHASE, - RESTORE; - - } -} - diff --git a/app/src/main/java/com/ea/nimble/mtx/catalog/synergy/ItemCategory.java b/app/src/main/java/com/ea/nimble/mtx/catalog/synergy/ItemCategory.java deleted file mode 100644 index fccf5d4..0000000 --- a/app/src/main/java/com/ea/nimble/mtx/catalog/synergy/ItemCategory.java +++ /dev/null @@ -1,12 +0,0 @@ -/* - * Decompiled with CFR 0.152. - */ -package com.ea.nimble.mtx.catalog.synergy; - -public class ItemCategory { - public int m_id; - public byte[] m_regularImageData; - public byte[] m_selectedImageData; - public String m_title; -} - diff --git a/app/src/main/java/com/ea/nimble/mtx/catalog/synergy/SynergyCatalog.java b/app/src/main/java/com/ea/nimble/mtx/catalog/synergy/SynergyCatalog.java deleted file mode 100644 index 2cbaa20..0000000 --- a/app/src/main/java/com/ea/nimble/mtx/catalog/synergy/SynergyCatalog.java +++ /dev/null @@ -1,219 +0,0 @@ -/* - * Decompiled with CFR 0.152. - * - * Could not load the following classes: - * android.util.Base64 - */ -package com.ea.nimble.mtx.catalog.synergy; - -import com.ea.nimble.ApplicationEnvironment; -import com.ea.nimble.IApplicationEnvironment; -import com.ea.nimble.IHttpRequest; -import com.ea.nimble.Log; -import com.ea.nimble.LogSource; -import com.ea.nimble.Network; -import com.ea.nimble.NetworkConnectionCallback; -import com.ea.nimble.NetworkConnectionHandle; -import com.ea.nimble.SynergyEnvironment; -import com.ea.nimble.SynergyIdManager; -import com.ea.nimble.SynergyNetwork; -import com.ea.nimble.SynergyNetworkConnectionCallback; -import com.ea.nimble.SynergyRequest; -import com.ea.nimble.Utility; -import com.ea.nimble.mtx.NimbleCatalogItem; - -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.net.MalformedURLException; -import java.net.URL; -import java.util.Collection; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Set; - -public class SynergyCatalog -implements LogSource { - public static final String MTX_INFO_KEY_CURRENCY = "localCurrency"; - private static final String SYNERGY_API_GET_AVAILABLE_ITEMS = "/product/api/core/getAvailableItems"; - private static final String SYNERGY_API_GET_CATEGORIES = "/product/api/core/getMTXGameCategories"; - private static final String SYNERGY_API_GET_DOWNLOAD_URL = "/product/api/core/getDownloadItemUrl"; - private static final String SYNERGY_API_GET_NONCE = "/drm/api/core/getNonce"; - private static final String SYNERGY_API_GET_PURCHASED_ITEMS = "/drm/api/core/getPurchasedItems"; - private String m_itemSkuPrefix; - private int m_itemsLoadingBinaryData = 0; - - public SynergyCatalog(StoreType storeType) { - if (storeType == StoreType.AMAZON) { - this.m_itemSkuPrefix = ApplicationEnvironment.getComponent().getApplicationBundleId() + "."; - return; - } - this.m_itemSkuPrefix = ""; - } - - static /* synthetic */ int access$106(SynergyCatalog synergyCatalog) { - int n2; - synergyCatalog.m_itemsLoadingBinaryData = n2 = synergyCatalog.m_itemsLoadingBinaryData - 1; - return n2; - } - - private SynergyCatalogItem createItemFromMap(Map object) { - SynergyCatalogItem synergyCatalogItem = new SynergyCatalogItem(); - synergyCatalogItem.m_sku = this.m_itemSkuPrefix + object.get("sellId"); - synergyCatalogItem.m_title = (String)object.get("title"); - NimbleCatalogItem.ItemType itemType = (Boolean)object.get("consumable") != false ? NimbleCatalogItem.ItemType.CONSUMABLE : NimbleCatalogItem.ItemType.NONCONSUMABLE; - synergyCatalogItem.m_type = itemType; - synergyCatalogItem.m_description = (String)object.get("desc"); - synergyCatalogItem.m_metaDataUrl = (String)object.get("packUrl"); - synergyCatalogItem.m_isFree = (Boolean)object.get("free"); - synergyCatalogItem.m_additionalInfo.putAll((Map)object); - return synergyCatalogItem; - } - - private void downloadContent(String string2, final DataCallback dataCallback) { - try { - URL uRL = new URL(string2); - Network.getComponent().sendGetRequest(uRL, null, networkConnectionHandle -> { - if (networkConnectionHandle.getResponse().getError() == null) { - dataCallback.callback(networkConnectionHandle.getResponse().getDataStream(), null); - return; - } - dataCallback.callback(null, networkConnectionHandle.getResponse().getError()); - }); - } - catch (MalformedURLException malformedURLException) { - Log.Helper.LOGE(this, "Invalid url: " + string2); - } - } - - private void getDownloadUrlForItem(SynergyCatalogItem object, StringCallback object2) { - - } - - public void downloadItem(SynergyCatalogItem synergyCatalogItem, final DataCallback dataCallback) { - this.getDownloadUrlForItem(synergyCatalogItem, new StringCallback(){ - - @Override - public void callback(String string2, Exception exception) { - if (exception == null) { - SynergyCatalog.this.downloadContent(string2, dataCallback); - return; - } - this.callback(null, exception); - } - }); - } - - public void getCategories(CategoryCallback object) {} - - public void getItemCatalog(ItemCallback object) { - Object object2 = (SynergyRequest.SynergyRequestPreparingCallback) synergyRequest -> { - IApplicationEnvironment iApplicationEnvironment = ApplicationEnvironment.getComponent(); - Object object1 = SynergyEnvironment.getComponent(); - HashMap hashMap = new HashMap(); - hashMap.put("masterSellId", null); - hashMap.put("typeSubstr", "1"); - hashMap.put("apiVer", "1.0.0"); - hashMap.put("ver", iApplicationEnvironment.getApplicationVersion()); - object1 = Utility.validString(SynergyIdManager.getComponent().getSynergyId()) ? SynergyIdManager.getComponent().getSynergyId() : "0"; - hashMap.put("uid", (String) object1); - hashMap.put("sdkVer", "1.23.14.1217"); - hashMap.put("langCode", iApplicationEnvironment.getShortApplicationLanguageCode()); - synergyRequest.urlParameters = hashMap; - synergyRequest.send(); - }; - object2 = new SynergyRequest(SYNERGY_API_GET_AVAILABLE_ITEMS, IHttpRequest.Method.GET, (SynergyRequest.SynergyRequestPreparingCallback)object2); - SynergyNetwork.getComponent().sendRequest((SynergyRequest)object2, (SynergyNetworkConnectionCallback)object); - } - - public String getItemSkuPrefix() { - return this.m_itemSkuPrefix; - } - - @Override - public String getLogSourceTitle() { - return "SynergyCatalog"; - } - - public void getNonce(StringCallback object){} - - public void getPurchasedItems(ItemSkuCallback object) {} - - public void loadBinaryDataForItems(Collection object, final CompletionCallback completionCallback) { - if (this.m_itemsLoadingBinaryData != 0) { - Log.Helper.LOGE(this, "Error: items already loading binary data"); - return; - } - for (SynergyCatalogItem catalogItem : object) { - String string2; - final SynergyCatalogItem synergyCatalogItem = catalogItem; - if (synergyCatalogItem.m_additionalInfo.get("binaryData") != null || (string2 = synergyCatalogItem.getMetaDataUrl()) == null) - continue; - try { - URL uRL = new URL(string2); - ++this.m_itemsLoadingBinaryData; - Network.getComponent().sendGetRequest(uRL, null, new NetworkConnectionCallback() { - - /* - * Enabled unnecessary exception pruning - */ - @Override - public void callback(NetworkConnectionHandle object) { - InputStream inputStream = object.getResponse().getDataStream(); - ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); - try { - int n2; - byte[] byArray = new byte[4096]; - while ((n2 = inputStream.read(byArray, 0, byArray.length)) != -1) { - ((ByteArrayOutputStream) object).write(byArray, 0, n2); - } - ((OutputStream) object).flush(); - } catch (IOException iOException) { - Log.Helper.LOGE(this, "Error reading binary data"); - } - byte[] bytes = byteArrayOutputStream.toByteArray(); - synergyCatalogItem.getAdditionalInfo().put("binaryData", bytes); - SynergyCatalog.access$106(SynergyCatalog.this); - if (SynergyCatalog.this.m_itemsLoadingBinaryData != 0) return; - completionCallback.callback(null); - } - }); - } catch (MalformedURLException malformedURLException) { - Log.Helper.LOGE(this, "Error: Malformed item url: " + string2); - } - } - } - - public static interface CategoryCallback { - public void callback(Set var1, Exception var2); - } - - public static interface CompletionCallback { - public void callback(Exception var1); - } - - public static interface DataCallback { - public void callback(InputStream var1, Exception var2); - } - - public static interface ItemCallback { - public void callback(List var1, Exception var2); - } - - public static interface ItemSkuCallback { - public void callback(List var1, Exception var2); - } - - public static enum StoreType { - GOOGLE, - AMAZON; - - } - - public static interface StringCallback { - public void callback(String var1, Exception var2); - } -} - diff --git a/app/src/main/java/com/ea/nimble/mtx/catalog/synergy/SynergyCatalogItem.java b/app/src/main/java/com/ea/nimble/mtx/catalog/synergy/SynergyCatalogItem.java deleted file mode 100644 index 3e825a1..0000000 --- a/app/src/main/java/com/ea/nimble/mtx/catalog/synergy/SynergyCatalogItem.java +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Decompiled with CFR 0.152. - */ -package com.ea.nimble.mtx.catalog.synergy; - -import com.ea.nimble.mtx.NimbleCatalogItem; -import java.io.Serializable; -import java.util.HashMap; -import java.util.Map; - -public class SynergyCatalogItem -extends NimbleCatalogItem -implements Serializable { - private static final long serialVersionUID = 1L; - Map m_additionalInfo = new HashMap(); - String m_description; - String m_formattedPrice; - boolean m_isFree; - String m_metaDataUrl; - float m_price; - String m_sku; - String m_title; - NimbleCatalogItem.ItemType m_type; - - public SynergyCatalogItem() { - } - - public SynergyCatalogItem(String string2) { - this(); - this.m_sku = string2; - } - - @Override - public Map getAdditionalInfo() { - return this.m_additionalInfo; - } - - @Override - public String getDescription() { - return this.m_description; - } - - @Override - public NimbleCatalogItem.ItemType getItemType() { - return this.m_type; - } - - @Override - public String getMetaDataUrl() { - return this.m_metaDataUrl; - } - - @Override - public float getPriceDecimal() { - return this.m_price; - } - - @Override - public String getPriceWithCurrencyAndFormat() { - return this.m_formattedPrice; - } - - @Override - public String getSku() { - return this.m_sku; - } - - @Override - public String getTitle() { - return this.m_title; - } - - public boolean isFree() { - return this.m_isFree; - } - - public void setDescription(String string2) { - this.m_description = string2; - } - - public void setPriceDecimal(float f2) { - this.m_price = f2; - } - - public void setPriceWithCurrencyAndFormat(String string2) { - this.m_formattedPrice = string2; - } - - public void setTitle(String string2) { - this.m_title = string2; - } -} - diff --git a/app/src/main/java/com/ea/nimble/pushnotificationgoogle/IPushNotification.java b/app/src/main/java/com/ea/nimble/pushnotificationgoogle/IPushNotification.java deleted file mode 100644 index a63ed2c..0000000 --- a/app/src/main/java/com/ea/nimble/pushnotificationgoogle/IPushNotification.java +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Decompiled with CFR 0.152. - */ -package com.ea.nimble.pushnotificationgoogle; - -import java.util.Map; - -public interface IPushNotification { - public void cleanup(); - - public void register(); - - public void sendPushNotificationTemplate(String var1, String var2, Map var3, Map var4); -} - diff --git a/app/src/main/java/com/ea/nimble/pushnotificationgoogle/PushNotification.java b/app/src/main/java/com/ea/nimble/pushnotificationgoogle/PushNotification.java deleted file mode 100644 index 5bc8350..0000000 --- a/app/src/main/java/com/ea/nimble/pushnotificationgoogle/PushNotification.java +++ /dev/null @@ -1,230 +0,0 @@ -/* - * Decompiled with CFR 0.152. - * - * Could not load the following classes: - * android.content.BroadcastReceiver - * android.content.Context - * android.content.Intent - * android.util.Log - */ -package com.ea.nimble.pushnotificationgoogle; - -import static com.ea.easp.Debug.Log.d; - -import android.content.BroadcastReceiver; -import android.content.Context; -import android.content.Intent; -import android.os.Bundle; -import android.util.Log; - -import com.ea.nimble.ApplicationEnvironment; -import com.ea.nimble.Base; -import com.ea.nimble.Log.Helper; -import com.ea.nimble.SynergyEnvironment; -import com.ea.nimble.SynergyIdManager; -import com.ea.nimble.SynergyNetwork; -import com.ea.nimble.SynergyNetworkConnectionCallback; -import com.ea.nimble.SynergyNetworkConnectionHandle; -import com.ea.nimble.Utility; -import com.ea.nimble.identity.INimbleIdentity; -import com.ea.nimble.identity.INimbleIdentityAuthenticator; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Locale; - -public class PushNotification { - public static final String COMPONENT_ID = "com.ea.nimble.pushnotificationgoogle"; - static String s_registerId = null; - - static void callSynergyRevokePushTokenByPid(String string2) { - Helper.LOGIS("PN", "GCM- SYNERGY ID2.0 registering device (regId = " + string2 + ")"); - HashMap hashMap = new HashMap(); - hashMap.put("pids", new String[]{string2}); - hashMap.put("sellId", Utility.safeString(SynergyEnvironment.getComponent().getSellId())); - hashMap.put("clientApiVersion", "1.0.1"); - hashMap.put("hwId", SynergyEnvironment.getComponent().getEAHardwareId()); - SynergyNetwork.getComponent().sendPostRequest(SynergyEnvironment.getComponent().getServerUrlWithKey("synergy.m2u"), "/m2u/api/android/revokePids", null, hashMap, new SynergyNetworkConnectionCallback() { - - @Override - public void callback(SynergyNetworkConnectionHandle synergyNetworkConnectionHandle) { - if (synergyNetworkConnectionHandle.getResponse().getError() == null) { - Helper.LOGD(this, "Push Token revoke sent to synergy. Status code: " + synergyNetworkConnectionHandle.getResponse().getHttpResponse().getStatusCode()); - return; - } - Helper.LOGD(this, "Error: Push Token revoke unable to be sent. " + synergyNetworkConnectionHandle.getResponse().getHttpResponse().getStatusCode()); - } - }); - } - - static void callSynergyStorePushTokenByPid(String string2) { - if (!Utility.validString(string2)) { - return; - } - PushNotification.callSynergyStorePushTokenByPidArray(new String[]{string2}); - } - - private static void callSynergyStorePushTokenByPidArray(String[] stringArray) { - Helper.LOGIS("PN", "GCM- SYNERGY registering device with pids. PIDS WERE FOUND."); - if (!Utility.validString(s_registerId)) { - Helper.LOGW("PN", "No valid push token was found. GCM registration has failed. Please check the log above for a reason.\n Aborting storing token to synergy"); - return; - } - HashMap hashMap = new HashMap(); - hashMap.put("pids", stringArray); - hashMap.put("registrationId", s_registerId); - hashMap.put("language", Utility.safeString(ApplicationEnvironment.getComponent().getShortApplicationLanguageCode())); - hashMap.put("localization", Utility.safeString(ApplicationEnvironment.getComponent().getApplicationLanguageCode())); - hashMap.put("deviceLanguage", Utility.safeString(Locale.getDefault().getLanguage())); - hashMap.put("deviceLocale", Utility.safeString(Locale.getDefault().toString())); - hashMap.put("sellId", Utility.safeString(SynergyEnvironment.getComponent().getSellId())); - hashMap.put("network", "1"); - hashMap.put("clientApiVersion", "1.0.1"); - hashMap.put("hwId", SynergyEnvironment.getComponent().getEAHardwareId()); - SynergyNetwork.getComponent().sendPostRequest(SynergyEnvironment.getComponent().getServerUrlWithKey("synergy.m2u"), "/m2u/api/android/storePids", null, hashMap, new SynergyNetworkConnectionCallback() { - - @Override - public void callback(SynergyNetworkConnectionHandle synergyNetworkConnectionHandle) { - if (synergyNetworkConnectionHandle.getResponse().getError() == null) { - Helper.LOGD(this, "Push Token sent to synergy. Status code: " + synergyNetworkConnectionHandle.getResponse().getHttpResponse().getStatusCode()); - return; - } - Helper.LOGD(this, "Error: Push Token unable to be sent. " + synergyNetworkConnectionHandle.getResponse().getHttpResponse().getStatusCode()); - } - }); - } - - public static IPushNotification getComponent() { - return (IPushNotification) ((Object) Base.getComponent(COMPONENT_ID)); - } - - private static void initialize() { - Helper.LOGDS("PN", "initialize"); - Base.registerComponent(new PushNotificationImpl(), COMPONENT_ID); - } - - static boolean register(Context object, final String string2) { - boolean bl2; - boolean bl3 = bl2 = false; - if (!ApplicationEnvironment.isMainApplicationRunning()) return bl3; - bl3 = bl2; - if (ApplicationEnvironment.getCurrentActivity() == null) return bl3; - Helper.LOGDS("PN", "Push token returned from OS. Attempting to register token with snyergy backend."); - if (SynergyEnvironment.getComponent().getServerUrlWithKey("synergy.m2u") != null) { - PushNotification.registerTokenWithSynergy(object, string2); - return true; - } - Helper.LOGDS("PN", "Synergy backend URL is missing. /GetDirection is probably not finished or callback has not fired. Waiting... "); - BroadcastReceiver broadcastReceiver = new BroadcastReceiver() { - - public void onReceive(Context context, Intent intent) { - Helper.LOGDS("PN", "Synergy PN URL found/startup is finished. Try PNs now."); - Bundle extras = intent.getExtras(); - if (extras == null) return; - if (!extras.getString("result").equals("1")) return; - PushNotification.registerTokenWithSynergy(context, string2); - } - }; - Utility.registerReceiver("nimble.environment.notification.startup_requests_finished", broadcastReceiver); - Utility.registerReceiver("nimble.environment.notification.restored_from_persistent", broadcastReceiver); - return false; - } - - static void registerTokenWithSynergy(Context context, String string2) { - boolean bl2; - boolean bl3 = bl2 = false; - if (Base.getComponent("com.ea.nimble.identity") != null) { - List list = ((INimbleIdentity) ((Object) Base.getComponent("com.ea.nimble.identity"))).getAuthenticators(); - bl3 = bl2; - if (list != null) { - bl3 = bl2; - if (!list.isEmpty()) { - PushNotification.registerTokenWithSynergyID20Internal(context, string2); - bl3 = true; - } - } - } - if (bl3) return; - PushNotification.registerTokenWithSynergyInternal(context, string2); - } - - private static void registerTokenWithSynergyID20Internal(Context object, String list) { - s_registerId = list; - if (Base.getComponent("com.ea.nimble.identity") == null) return; - INimbleIdentity component = (INimbleIdentity) Base.getComponent("com.ea.nimble.identity"); - ArrayList arrayList = new ArrayList<>(); - arrayList.add(SynergyIdManager.getComponent().getSynergyId()); - if (arrayList.isEmpty()) return; - PushNotification.callSynergyStorePushTokenByPidArray(arrayList.toArray(new String[0])); - } - - private static void registerTokenWithSynergyInternal(final Context context, String string2) { - Helper.LOGIS("PN", "GCM- SYNERGY registering device (regId = " + string2 + ") using synergyId. PIDS WERE NOT FOUND."); - s_registerId = string2; - HashMap hashMap = new HashMap(); - hashMap.put("uid", Utility.safeString(SynergyIdManager.getComponent().getSynergyId())); - hashMap.put("registrationId", string2); - hashMap.put("language", Utility.safeString(ApplicationEnvironment.getComponent().getShortApplicationLanguageCode())); - hashMap.put("localization", Utility.safeString(ApplicationEnvironment.getComponent().getApplicationLanguageCode())); - hashMap.put("deviceLanguage", Utility.safeString(Locale.getDefault().getLanguage())); - hashMap.put("deviceLocale", Utility.safeString(Locale.getDefault().toString())); - hashMap.put("sellId", Utility.safeString(SynergyEnvironment.getComponent().getSellId())); - hashMap.put("network", "1"); - SynergyNetwork.getComponent().sendGetRequest(SynergyEnvironment.getComponent().getServerUrlWithKey("synergy.m2u"), "/m2u/api/android/storePushRegistrationId", hashMap, new SynergyNetworkConnectionCallback() { - - @Override - public void callback(SynergyNetworkConnectionHandle synergyNetworkConnectionHandle) { - if (synergyNetworkConnectionHandle.getResponse().getError() != null) return; - Helper.LOGD(this, "GCM Push Token registered with synergy. Status code: " + synergyNetworkConnectionHandle.getResponse().getHttpResponse().getStatusCode()); - } - }); - } - - static void unregister(Context object, String object2) { - ArrayList object3 = new ArrayList(); - Log.d((String) "PN", (String) ("GCM - unregistering device (regId = " + (String) object2 + ")")); - ArrayList arrayList = new ArrayList(); - if (Base.getComponent("com.ea.nimble.identity") != null && ((INimbleIdentity) ((Object) Base.getComponent("com.ea.nimble.identity"))).getAuthenticators() != null) { - for (int i2 = 0; i2 < object3.size(); ++i2) { - if (((INimbleIdentityAuthenticator) object3.get(i2)).getPidInfo() == null || !Utility.validString(((INimbleIdentityAuthenticator) object3.get(i2)).getPidInfo().getPid())) - continue; - arrayList.add(((INimbleIdentityAuthenticator) object3.get(i2)).getPidInfo().getPid()); - } - } - - - HashMap hashMap = new HashMap<>(); - hashMap.put("pids", arrayList); - hashMap.put("registrationId", object2); - hashMap.put("language", Utility.safeString(ApplicationEnvironment.getComponent().getShortApplicationLanguageCode())); - hashMap.put("localization", Utility.safeString(ApplicationEnvironment.getComponent().getApplicationLanguageCode())); - hashMap.put("deviceLanguage", Utility.safeString(Locale.getDefault().getLanguage())); - hashMap.put("deviceLocale", Utility.safeString(Locale.getDefault().toString())); - hashMap.put("network", "1"); - hashMap.put("clientApiVersion", "1.0.0"); - SynergyNetwork.getComponent().sendPostRequest((String) object2, "/m2u/api/android/revokePids", null, null, new SynergyNetworkConnectionCallback() { - - @Override - public void callback(SynergyNetworkConnectionHandle synergyNetworkConnectionHandle) { - if (synergyNetworkConnectionHandle.getResponse().getError() == null) { - Helper.LOGD(this, "Push Token removed to synergy. Status code: " + synergyNetworkConnectionHandle.getResponse().getHttpResponse().getStatusCode()); - return; - } - Helper.LOGD(this, "Error: Push Token removal unable to be sent. " + synergyNetworkConnectionHandle.getResponse().getHttpResponse().getStatusCode()); - } - }); - - - HashMap object5 = new HashMap<>(); - - object5.put("uid", Utility.safeString(SynergyIdManager.getComponent().getSynergyId())); - object5.put("sellId", Utility.safeString(SynergyEnvironment.getComponent().getSellId())); - final Context finalContext = object; - SynergyNetwork.getComponent().sendGetRequest(SynergyEnvironment.getComponent().getServerUrlWithKey("synergy.m2u"), "/m2u/api/android/revokePushRegistrationId", object5, synergyNetworkConnectionHandle -> { - if (synergyNetworkConnectionHandle.getResponse().getError() != null) return; - d("GCM", "GCM Push Token unregistered with synergy. Status code: " + synergyNetworkConnectionHandle.getResponse().getHttpResponse().getStatusCode()); - }); - } -} - diff --git a/app/src/main/java/com/ea/nimble/pushnotificationgoogle/PushNotificationImpl.java b/app/src/main/java/com/ea/nimble/pushnotificationgoogle/PushNotificationImpl.java deleted file mode 100644 index 90fbfe2..0000000 --- a/app/src/main/java/com/ea/nimble/pushnotificationgoogle/PushNotificationImpl.java +++ /dev/null @@ -1,237 +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 - */ -package com.ea.nimble.pushnotificationgoogle; - -import android.content.BroadcastReceiver; -import android.content.Context; -import android.content.Intent; -import android.content.IntentFilter; - -import com.ea.nimble.ApplicationEnvironment; -import com.ea.nimble.Base; -import com.ea.nimble.Component; -import com.ea.nimble.Log; -import com.ea.nimble.LogSource; -import com.ea.nimble.SynergyEnvironment; -import com.ea.nimble.SynergyIdManager; -import com.ea.nimble.SynergyNetwork; -import com.ea.nimble.SynergyNetworkConnectionCallback; -import com.ea.nimble.SynergyNetworkConnectionHandle; -import com.ea.nimble.Utility; -import com.ea.nimble.identity.INimbleIdentity; -import com.ea.nimble.identity.INimbleIdentityAuthenticator; - -import java.io.UnsupportedEncodingException; -import java.net.URLEncoder; -import java.util.HashMap; -import java.util.Locale; -import java.util.Map; - -public class PushNotificationImpl -extends Component -implements LogSource, -IPushNotification { - private BroadcastReceiver mAppLangChangedReceiver; - private BroadcastReceiver m_IdentityChangedReceiver; - private BroadcastReceiver m_handleMessageReceiver = new BroadcastReceiver(){ - - public void onReceive(Context context, Intent intent) { - Log.Helper.LOGV((Object)this, "got a message! someone loves me! wake up"); - } - }; - private BroadcastReceiver m_synergyIdChangedReceiver = new BroadcastReceiver(){ - - public void onReceive(Context context, Intent intent) { - PushNotificationImpl.this.onSynergyIdChanged(intent); - } - }; - - public PushNotificationImpl() { - this.mAppLangChangedReceiver = new BroadcastReceiver(){ - - public void onReceive(Context context, Intent intent) { - PushNotificationImpl.this.register(); - } - }; - this.m_IdentityChangedReceiver = new BroadcastReceiver(){ - - public void onReceive(Context object, Intent object2) { - Log.Helper.LOGD((Object)this, "identity changed - PN system attempting to register"); - if (object2 == null) return; - if (object2.getExtras() == null) return; - if (Base.getComponent("com.ea.nimble.identity") == null) { - Log.Helper.LOGD((Object)this, "identity changed - ID comp not found. Early out."); - return; - } - String authenticatorId = object2.getExtras().getString("authenticatorId"); - INimbleIdentityAuthenticator authenticatorById = ((INimbleIdentity) Base.getComponent("com.ea.nimble.identity")).getAuthenticatorById(authenticatorId); - if (object == null || authenticatorById.getPidInfo() == null) { - if (object == null) { - Log.Helper.LOGD(this, "identity changed - authObj was null"); - return; - } - Log.Helper.LOGD(this, "identity chagned - authObj.getPidInfo null"); - return; - } - String pid = authenticatorById.getPidInfo().getPid(); - if (authenticatorById.getState() == INimbleIdentityAuthenticator.NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_SUCCESS) { - Log.Helper.LOGD((Object)this, "identity changed - PN system will store pid"); - PushNotification.callSynergyStorePushTokenByPid(pid); - return; - } - Log.Helper.LOGD((Object)this, "identity changed - PN system will revoke pid"); - PushNotification.callSynergyRevokePushTokenByPid(pid); - } - }; - } - - private void checkNotNull(Object object, String string2) { - if (object != null) return; - throw new NullPointerException("Error: null ptr"); - } - - private void onSynergyIdChanged(Intent object) { - String string2 = object.getStringExtra("previousSynergyId"); - if (!Utility.validString(object.getStringExtra("currentSynergyId"))) return; - if (PushNotification.s_registerId == null) return; - HashMap hashMap = new HashMap(); - hashMap.put("uid", ""); - hashMap.put("registrationId", PushNotification.s_registerId); - hashMap.put("language", Utility.safeString(ApplicationEnvironment.getComponent().getShortApplicationLanguageCode())); - hashMap.put("localization", Utility.safeString(ApplicationEnvironment.getComponent().getApplicationLanguageCode())); - hashMap.put("deviceLanguage", Utility.safeString(Locale.getDefault().getLanguage())); - hashMap.put("deviceLocale", Utility.safeString(Locale.getDefault().toString())); - hashMap.put("sellId", SynergyEnvironment.getComponent().getSellId()); - hashMap.put("network", "1"); - if (Utility.validString(string2)) { - hashMap.put("revokeId", string2); - } - SynergyNetwork.getComponent().sendGetRequest(SynergyEnvironment.getComponent().getServerUrlWithKey("synergy.m2u"), "/m2u/api/android/storePushRegistrationId", hashMap, new SynergyNetworkConnectionCallback(){ - - @Override - public void callback(SynergyNetworkConnectionHandle synergyNetworkConnectionHandle) { - if (synergyNetworkConnectionHandle.getResponse().getError() != null) { - Log.Helper.LOGD(this, "ERROR: unable to register token with synergy: " + synergyNetworkConnectionHandle.getResponse().getError()); - return; - } - Log.Helper.LOGD(this, "PUSH NOTIFICATION TOKEN sent to synergy"); - } - }); - } - - @Override - public void cleanup() { - Context context = ApplicationEnvironment.getComponent().getApplicationContext(); - if (this.m_handleMessageReceiver != null) { - context.unregisterReceiver(this.m_handleMessageReceiver); - } - Utility.unregisterReceiver(this.m_synergyIdChangedReceiver); - Utility.unregisterReceiver(this.m_IdentityChangedReceiver); - } - - @Override - public String getComponentId() { - return "com.ea.nimble.pushnotificationgoogle"; - } - - @Override - public String getLogSourceTitle() { - return "PN"; - } - - @Override - public void register() { - - } - - @Override - public void restore() { - Log.Helper.LOGD(this, "restore"); - this.register(); - Utility.registerReceiver("nimble.synergyidmanager.notification.synergy_id_changed", this.m_synergyIdChangedReceiver); - Utility.registerReceiver("nimble.notification.LanguageChanged", this.mAppLangChangedReceiver); - Utility.registerReceiver("nimble.notification.identity.authenticator.pid.info.update", this.m_IdentityChangedReceiver); - } - - @Override - public void resume() { - Log.Helper.LOGD(this, "resume"); - this.register(); - Utility.registerReceiver("nimble.synergyidmanager.notification.synergy_id_changed", this.m_synergyIdChangedReceiver); - } - - @Override - public void sendPushNotificationTemplate(String string2, String string3, Map arrayList, Map object) { - Object object2; - Log.Helper.LOGI(this, "GCM- SYNERGY "); - HashMap hashMap = new HashMap<>(); - String object3 = ""; - if (!arrayList.isEmpty()) { - for (Map.Entry object4 : arrayList.entrySet()) { - object2 = new HashMap(); - hashMap.put(object4.getKey(), object4.getValue()); - } - } - hashMap.put("overrideValues", object3); - if (!object.isEmpty()) { - for (Map.Entry entry : object.entrySet()) { - object3 = "custom_" + (String)entry.getKey(); - object2 = (String)entry.getValue(); - try { - String string4 = URLEncoder.encode((String)object3, "UTF-8").replaceAll("\\*", "%2A"); - object2 = URLEncoder.encode((String)object2, "UTF-8").replaceAll("\\*", "%2A"); - HashMap hashMap2 = new HashMap(); - hashMap2.put("name", string4); - hashMap2.put("value", object2); - } - catch (UnsupportedEncodingException unsupportedEncodingException) { - Log.Helper.LOGD(this, "Error: PushNotificationTemplate can not parse the custom parameter fields for key" + (String)object3); - unsupportedEncodingException.printStackTrace(); - } - } - } - hashMap.put("customMessages", arrayList); - hashMap.put("uid", Utility.safeString(SynergyIdManager.getComponent().getSynergyId())); - hashMap.put("targetUserId", string2); - hashMap.put("language", Utility.safeString(ApplicationEnvironment.getComponent().getShortApplicationLanguageCode())); - hashMap.put("localization", Utility.safeString(ApplicationEnvironment.getComponent().getApplicationLanguageCode())); - hashMap.put("deviceLanguage", Utility.safeString(Locale.getDefault().getLanguage())); - hashMap.put("deviceLocale", Utility.safeString(Locale.getDefault().toString())); - hashMap.put("sellId", Utility.safeString(SynergyEnvironment.getComponent().getSellId())); - hashMap.put("clientApiVersion", "1.2.1"); - hashMap.put("templateCode", string3); - hashMap.put("verificationCode", ""); - SynergyNetwork.getComponent().sendPostRequest(SynergyEnvironment.getComponent().getServerUrlWithKey("synergy.m2u"), "/m2u/api/android/sendPushNotificationTemplateByUid", null, hashMap, new SynergyNetworkConnectionCallback(){ - - @Override - public void callback(SynergyNetworkConnectionHandle synergyNetworkConnectionHandle) { - if (synergyNetworkConnectionHandle.getResponse().getError() == null) { - Log.Helper.LOGD(this, "Push Notification sent to synergy. Status code: " + synergyNetworkConnectionHandle.getResponse().getHttpResponse().getStatusCode()); - return; - } - Log.Helper.LOGD(this, "Error: PN unable to be sent. " + synergyNetworkConnectionHandle.getResponse().getHttpResponse().getStatusCode()); - } - }); - } - - @Override - public void setup() { - Log.Helper.LOGD(this, "setup"); - } - - @Override - public void suspend() { - Log.Helper.LOGD(this, "suspend"); - Utility.unregisterReceiver(this.m_synergyIdChangedReceiver); - } - - public void trackStuff(){} -} - diff --git a/app/src/main/java/com/ea/nimble/tracking/ITracking.java b/app/src/main/java/com/ea/nimble/tracking/ITracking.java deleted file mode 100644 index 88487b1..0000000 --- a/app/src/main/java/com/ea/nimble/tracking/ITracking.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Decompiled with CFR 0.152. - */ -package com.ea.nimble.tracking; - -import java.util.Map; - -public interface ITracking { - public void addCustomSessionData(String var1, String var2); - - public void clearCustomSessionData(); - - public boolean getEnable(); - - public void logEvent(String var1, Map var2); - - public void setEnable(boolean var1); - - public void setTrackingAttribute(String var1, String var2); -} - diff --git a/app/src/main/java/com/ea/nimble/tracking/NimbleTrackingImplBase.java b/app/src/main/java/com/ea/nimble/tracking/NimbleTrackingImplBase.java deleted file mode 100644 index a3fbbf7..0000000 --- a/app/src/main/java/com/ea/nimble/tracking/NimbleTrackingImplBase.java +++ /dev/null @@ -1,807 +0,0 @@ -/* - * Decompiled with CFR 0.152. - * - * Could not load the following classes: - * android.app.Activity - * android.app.ActivityManager - * android.app.ActivityManager$MemoryInfo - * android.content.BroadcastReceiver - * android.content.Context - * android.content.Intent - * android.util.Log - */ -package com.ea.nimble.tracking; - -import android.app.Activity; -import android.app.ActivityManager; -import android.content.BroadcastReceiver; -import android.content.Context; -import android.content.Intent; -import android.util.Log; - -import com.ea.nimble.ApplicationEnvironment; -import com.ea.nimble.Component; -import com.ea.nimble.EASPDataLoader; -import com.ea.nimble.IHttpResponse; -import com.ea.nimble.Log.Helper; -import com.ea.nimble.LogSource; -import com.ea.nimble.Network; -import com.ea.nimble.Persistence; -import com.ea.nimble.PersistenceService; -import com.ea.nimble.SynergyEnvironment; -import com.ea.nimble.SynergyNetwork; -import com.ea.nimble.SynergyNetworkConnectionCallback; -import com.ea.nimble.SynergyNetworkConnectionHandle; -import com.ea.nimble.SynergyRequest; -import com.ea.nimble.Utility; - -import java.io.Serializable; -import java.util.ArrayList; -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Locale; -import java.util.Map; -import java.util.concurrent.ScheduledFuture; - -abstract class NimbleTrackingImplBase -extends Component -implements LogSource, -ITracking { - private static final int DATA_VERSION_CURRENT = 3; - private static final int DEFAULT_MAX_QUEUE_LENGTH = 3; - protected static final double DEFAULT_POST_INTERVAL = 1.0; - protected static final double DEFAULT_REPOST_MULTIPLIER = 2.0; - protected static final double DEFAULT_RETRY_DELAY = 1.0; - protected static final double MAX_POST_RETRY_DELAY = 300.0; - private static final int MAX_QUEUED_EVENTS = 50; - private static final int MAX_QUEUED_SESSIONS = 50; - protected static final double NOW_POST_INTERVAL = 0.0; - private static final String ORIGIN_LOGIN_STATUS_STRING_AUTO_LOGGING_IN = "autoLogin"; - private static final String ORIGIN_LOGIN_STATUS_STRING_LIVE_USER = "live"; - private static final String ORIGIN_NOTIFICATION_LOGIN_STATUS_UPDATE_KEY_STATUS = "STATUS"; - private static final String PERSISTENCE_CURRENT_SESSION_ID = "currentSessionObject"; - private static final String PERSISTENCE_ENABLE_FLAG = "trackingEnabledFlag"; - private static final String PERSISTENCE_EVENT_QUEUE_ID = "eventQueue"; - private static final String PERSISTENCE_FIRST_SESSION_ID_NUMBER = "firstSessionIDNumber"; - private static final String PERSISTENCE_LAST_SESSION_ID_NUMBER = "lastSessionIDNumber"; - private static final String PERSISTENCE_LOGGED_IN_TO_ORIGIN_ID = "loggedInToOrigin"; - private static final String PERSISTENCE_QUEUED_SESSIONS_ID = "queuedSessionObjects"; - private static final String PERSISTENCE_SAVED_SESSION_ID_NUMBER = "savedSession"; - private static final String PERSISTENCE_SESSION_DATA_ID = "sessionData"; - private static final String PERSISTENCE_TOTAL_SESSION_COUNT = "totalSessionCount"; - private static final String PERSISTENCE_TRACKING_ATTRIBUTES = "trackingAttributes"; - private static final String PERSISTENCE_VERSION_ID = "dataVersion"; - private static final String SESSION_FILE_FORMAT = "%sSession%d"; - protected TrackingBaseSessionObject m_currentSessionObject; - protected ArrayList m_customSessionData; - private boolean m_enable = true; - private long m_firstSessionIDNumber = 0L; - private boolean m_isPostPending = false; - private boolean m_isRequestInProgress = false; - private long m_lastSessionIDNumber = -1L; - protected boolean m_loggedInToOrigin = false; - private int m_maxQueueLength = 3; - private BroadcastReceiver m_networkStatusChangedReceiver = null; - private OriginLoginStatusChangedReceiver m_originLoginStatusChangedReceiver = null; - private ArrayList> m_pendingEvents; - private double m_postInterval = 1.0; - protected double m_postRetryDelay; - private ScheduledFuture m_postTimer; - private StartupRequestsFinishedReceiver m_receiver = null; - private ArrayList m_sessionsToPost = new ArrayList(); - protected NimbleTrackingThreadManager m_threadManager; - private long m_totalSessions = 0L; - protected HashMap m_trackingAttributes; - - NimbleTrackingImplBase() { - this.m_pendingEvents = new ArrayList(); - this.m_customSessionData = new ArrayList(); - this.m_currentSessionObject = new TrackingBaseSessionObject(); - this.m_trackingAttributes = new HashMap(); - } - - private void addCurrentSessionObjectToBackOfQueue() { - ++this.m_lastSessionIDNumber; - ++this.m_totalSessions; - if (this.m_sessionsToPost.size() >= this.m_maxQueueLength) { - this.saveSessionToFile(this.m_currentSessionObject, this.m_lastSessionIDNumber); - } else { - this.m_sessionsToPost.add(this.m_currentSessionObject); - } - this.saveToPersistence(); - } - - private void configureTrackingOnFirstInstall() { - Helper.LOGD(this, "First Install. Look for App Settings to enable/disable tracking"); - try { - String string2 = ApplicationEnvironment.getCurrentActivity().getPackageManager().getApplicationInfo((String)ApplicationEnvironment.getCurrentActivity().getPackageName(), (int)128).metaData.getString("com.ea.nimble.tracking.defaultEnable"); - if (Utility.validString(string2)) { - if (string2.equalsIgnoreCase("enable")) { - Helper.LOGD(this, "Default App Setting : Enable Tracking"); - this.m_enable = true; - return; - } - if (!string2.equalsIgnoreCase("disable")) return; - Helper.LOGD(this, "Default App Setting : Disable Tracking"); - this.m_enable = false; - return; - } - } - catch (Exception exception) { - // empty catch block - } - Log.e((String)"Nimble", (String)"WARNING! Cannot find valid TrackingEnable from AndroidManifest.xml"); - } - - private void dropExtraSessions() { - if (this.dropExtraSessions(true)) return; - Helper.LOGD(this, "Failed to drop enough sessions. Dropping sessions without checking canDropSession."); - if (this.dropExtraSessions(false)) return; - Helper.LOGE(this, "Still unable to drop enough sessions. Remaining number: " + (this.m_lastSessionIDNumber - this.m_firstSessionIDNumber + 1L)); - } - - private boolean dropExtraSessions(boolean bl2) { - long l2; - if (this.m_totalSessions < 50L) { - return true; - } - Helper.LOGD(this, "Current number of sessions (%d) has reached maximum (%d). Removing old sessions.", this.m_totalSessions, 50); - ArrayList arrayList = new ArrayList(); - for (l2 = this.m_firstSessionIDNumber; l2 <= this.m_lastSessionIDNumber; ++l2) { - TrackingBaseSessionObject trackingBaseSessionObject; - long l3 = l2 - this.m_firstSessionIDNumber; - if (l3 < (long)this.m_sessionsToPost.size()) { - trackingBaseSessionObject = this.m_sessionsToPost.get((int)l3); - } else { - TrackingBaseSessionObject trackingBaseSessionObject2; - trackingBaseSessionObject = trackingBaseSessionObject2 = this.loadSessionFromFile(l2); - if (trackingBaseSessionObject2 == null) continue; - } - if (arrayList.size() == 0 || this.isSameSession(arrayList.get(arrayList.size() - 1), trackingBaseSessionObject)) { - arrayList.add(trackingBaseSessionObject); - continue; - } - if (!bl2 || this.canDropSession(arrayList)) { - this.dropSessions(arrayList, l2 - 1L); - } - arrayList.clear(); - if (this.m_totalSessions < 50L) { - this.fillSessionsToPost(); - return true; - } - arrayList.add(trackingBaseSessionObject); - } - if (arrayList.size() > 0 && (!bl2 || this.canDropSession(arrayList))) { - this.dropSessions(arrayList, l2 - 1L); - } - this.fillSessionsToPost(); - if (this.m_totalSessions >= 50L) return false; - return true; - } - - private void dropSessions(ArrayList arrayList, long l2) { - for (int i2 = 0; i2 < arrayList.size(); ++i2) { - this.m_sessionsToPost.remove(arrayList.get(i2)); - PersistenceService.removePersistenceForNimbleComponent(this.getFilenameForSessionID(l2 - (long)i2), Persistence.Storage.DOCUMENT); - } - if (l2 - (long)arrayList.size() + 1L == this.m_firstSessionIDNumber) { - this.m_firstSessionIDNumber += (long)arrayList.size(); - } - this.m_totalSessions -= (long)arrayList.size(); - this.saveToPersistence(); - } - - private void fillSessionsToPost() { - int n2 = this.m_sessionsToPost.size(); - while (n2 < this.m_maxQueueLength) { - long l2 = this.m_firstSessionIDNumber + (long)n2; - if (l2 > this.m_lastSessionIDNumber) { - return; - } - TrackingBaseSessionObject trackingBaseSessionObject = this.loadSessionFromFile(l2); - if (trackingBaseSessionObject != null) { - this.m_sessionsToPost.add(trackingBaseSessionObject); - PersistenceService.removePersistenceForNimbleComponent(this.getFilenameForSessionID(l2), Persistence.Storage.DOCUMENT); - } else { - ++this.m_firstSessionIDNumber; - } - ++n2; - } - } - - private String getFilenameForSessionID(long l2) { - if (l2 >= 0L) return String.format(Locale.US, SESSION_FILE_FORMAT, this.getComponentId(), l2); - Helper.LOGE(this, "Trying to find the filename for an invalid sessionID!"); - return null; - } - - private boolean isAbleToPostEvent(boolean bl2) { - if (!this.m_enable) { - return false; - } - if (!(bl2 || ApplicationEnvironment.isMainApplicationRunning() && ApplicationEnvironment.getCurrentActivity() != null)) { - Helper.LOGD(this, "isAbleToPostEvent - return because the app is in background"); - return false; - } - if (Network.getComponent().getStatus() != Network.Status.OK) { - if (this.m_networkStatusChangedReceiver != null) return false; - Helper.LOGD(this, "Network status not OK for event post. Adding receiver for network status change."); - this.killPostTimer(); - this.m_networkStatusChangedReceiver = new BroadcastReceiver(){ - - public void onReceive(Context context, Intent intent) { - if (!intent.getAction().equals("nimble.notification.networkStatusChanged")) return; - NimbleTrackingImplBase.this.m_threadManager.runInWorkerThread(new Runnable(){ - - @Override - public void run() { - NimbleTrackingImplBase.this.onNetworkStatusChange(); - } - }); - } - }; - Utility.registerReceiver("nimble.notification.networkStatusChanged", this.m_networkStatusChangedReceiver); - return false; - } - if (SynergyEnvironment.getComponent().isDataAvailable()) return true; - this.m_isPostPending = true; - this.addObserverForSynergyEnvironmentUpdateFinished(); - return false; - } - - private void killPostTimer() { - if (this.m_postTimer == null) return; - this.m_postTimer.cancel(false); - this.m_postTimer = null; - } - - private TrackingBaseSessionObject loadSessionFromFile(long l2) { - Object object = PersistenceService.getPersistenceForNimbleComponent(this.getFilenameForSessionID(l2), Persistence.Storage.DOCUMENT); - if (object == null) return null; - if ((object = ((Persistence)object).getValue(PERSISTENCE_SAVED_SESSION_ID_NUMBER)) == null) return null; - if (object.getClass() != TrackingBaseSessionObject.class) return null; - return (TrackingBaseSessionObject)object; - } - - private void logEvent(Tracking.Event iterator, boolean bl2) { - List> maps = this.convertEvent((Tracking.Event) ((Object) iterator)); - if (maps != null && !maps.isEmpty()) { - for (Map map : maps) { - this.m_currentSessionObject.events.add(map); - Helper.LOGD(this, "Logged event, %s: \n", map); - } - this.saveToPersistence(); - if (!bl2 && (this.m_postTimer == null || this.m_postTimer.isDone() && !this.m_isRequestInProgress) && this.isAbleToPostEvent(false)) { - this.resetPostTimer(); - } - } - boolean bl3 = bl2; - if (this.m_currentSessionObject.events.size() >= 50) { - Helper.LOGD(this, "Current number of events (%d) has reached maximum (%d). Posting event queue now.", this.m_currentSessionObject.events.size(), 50); - bl3 = true; - } - if (!bl3) return; - this.killPostTimer(); - this.packageCurrentSession(); - this.postPendingEvents(bl2); - } - - private void onNetworkStatusChange() { - if (Network.getComponent().getStatus() != Network.Status.OK) return; - Helper.LOGD(this, "Network status restored, kicking off event post."); - Utility.unregisterReceiver(this.m_networkStatusChangedReceiver); - this.m_networkStatusChangedReceiver = null; - this.resetPostTimer(0.0); - } - - private void onOriginLoginStatusChanged(Intent object) { - if (object.getExtras() == null) { - Helper.LOGI(this, "Login status updated event received without extras bundle. Marking NOT logged in to Origin."); - this.m_loggedInToOrigin = false; - return; - } - if (!(object.getExtras().getString(ORIGIN_NOTIFICATION_LOGIN_STATUS_UPDATE_KEY_STATUS)).equals(ORIGIN_LOGIN_STATUS_STRING_LIVE_USER) && !object.equals(ORIGIN_LOGIN_STATUS_STRING_AUTO_LOGGING_IN)) { - Helper.LOGI(this, "Login status update, FALSE"); - this.m_loggedInToOrigin = false; - return; - } - Helper.LOGI(this, "Login status update, TRUE"); - this.m_loggedInToOrigin = true; - } - - private void onPostComplete(SynergyNetworkConnectionHandle synergyNetworkConnectionHandle, TrackingBaseSessionObject trackingBaseSessionObject) { - if (synergyNetworkConnectionHandle == null || synergyNetworkConnectionHandle.getResponse() == null) { - Helper.LOGE(this, "No response exists in this post!"); - return; - } - boolean bl2 = false; - double d2 = 1.0; - if (synergyNetworkConnectionHandle.getResponse().getError() == null) { - this.removeSessionAndFillQueue(trackingBaseSessionObject); - this.m_postRetryDelay = 1.0; - d2 = this.m_postInterval; - } else { - IHttpResponse iHttpResponse = synergyNetworkConnectionHandle.getResponse().getHttpResponse(); - if (iHttpResponse != null && (iHttpResponse.getStatusCode() == 400 || iHttpResponse.getStatusCode() == 415)) { - Helper.LOGE(this, "Received HTTP status %d. Discarding post.", iHttpResponse.getStatusCode()); - this.removeSessionAndFillQueue(trackingBaseSessionObject); - this.m_postRetryDelay = 1.0; - d2 = this.m_postInterval; - } else { - Helper.LOGE(this, "Failed to send tracking events. Error: %s", synergyNetworkConnectionHandle.getResponse().getError().getLocalizedMessage()); - bl2 = true; - } - } - Helper.LOGI(this, "Telemetry post request finished, resetting isRequestInProgress flag to false."); - this.m_isRequestInProgress = false; - if (bl2) { - d2 = this.m_postRetryDelay; - this.m_postRetryDelay *= 2.0; - if (this.m_postRetryDelay > 300.0) { - this.m_postRetryDelay = 300.0; - } - Helper.LOGI(this, "Posting a retry with delay of %s due to failed send. Queue size: %d", d2, this.m_sessionsToPost.size()); - this.resetPostTimer(d2, false); - return; - } - if (this.m_sessionsToPost != null && !this.m_sessionsToPost.isEmpty()) { - Helper.LOGI(this, "More items found in the queue. Post the next one now. Queue size: %d", this.m_sessionsToPost.size()); - this.resetPostTimer(0.0, false); - return; - } - Helper.LOGI(this, "No more items found in the queue. Wait on the timer. Queue size: %d", this.m_sessionsToPost.size()); - this.resetPostTimer(d2, true); - } - - private void onStartupRequestsFinished(Intent object) { - if (object.getExtras() == null) return; - if (!object.getExtras().getString("result").equals("1")) return; - int n2 = SynergyEnvironment.getComponent().getTrackingPostInterval(); - this.m_postInterval = n2 < 0 || n2 == -1 ? 1.0 : (double)n2; - if (this.m_sessionsToPost != null) { - for (TrackingBaseSessionObject trackingBaseSessionObject : this.m_sessionsToPost) { - if (trackingBaseSessionObject == null || trackingBaseSessionObject.sessionData == null) continue; - Object object2 = trackingBaseSessionObject.sessionData.get("sellId"); - if (object2 != null && object2 instanceof String && (((String)object2).equals("") || ((String)object2).equals("0"))) { - object2 = SynergyEnvironment.getComponent().getSellId(); - trackingBaseSessionObject.sessionData.put("sellId", Utility.safeString((String)object2)); - if (object2 == null || ((String)object2).equals("") || ((String)object2).equals("0")) { - Helper.LOGE(this, "Sell Id was still null after synergy update"); - } - } - if ((object2 = trackingBaseSessionObject.sessionData.get("hwId")) != null && object2 instanceof String && ((String)object2).equals("")) { - object2 = SynergyEnvironment.getComponent().getEAHardwareId(); - trackingBaseSessionObject.sessionData.put("hwId", Utility.safeString((String)object2)); - if (object2 == null || ((String)object2).equals("")) { - Helper.LOGE(this, "Hardware Id was still null after synergy update"); - } - } - if ((object2 = trackingBaseSessionObject.sessionData.get("deviceId")) == null || !(object2 instanceof String) || !((String)object2).equals("") && !((String)object2).equals("0")) continue; - object2 = SynergyEnvironment.getComponent().getEADeviceId(); - trackingBaseSessionObject.sessionData.put("deviceId", Utility.safeString((String)object2)); - if (object2 != null && !((String)object2).equals("") && !((String)object2).equals("0")) continue; - Helper.LOGE(this, "Device Id was still null after synergy update"); - } - } - Helper.LOGI(this, "Synergy environment update successful. Removing observer and re-attempting event post."); - if (this.m_receiver != null) { - Utility.unregisterReceiver(this.m_receiver); - this.m_receiver = null; - } - if (!this.m_isPostPending) return; - this.m_isPostPending = false; - this.resetPostTimer(0.0); - } - - private void postIntervalTimerExpired(boolean bl2) { - if (bl2) { - this.packageCurrentSession(); - } - this.postPendingEvents(false); - } - - private void postPendingEvents(boolean bl2) { - if (!this.isAbleToPostEvent(bl2)) { - return; - } - if (this.m_sessionsToPost == null || this.m_sessionsToPost.size() <= 0) { - Helper.LOGD(this, "No tracking sessions to post."); - return; - } - TrackingBaseSessionObject trackingBaseSessionObject = this.m_sessionsToPost.get(0); - while (trackingBaseSessionObject == null) { - this.removeSessionAndFillQueue(null); - if (this.m_sessionsToPost.size() <= 0) { - Helper.LOGD(this, "No valid tracking sessions to post."); - return; - } - trackingBaseSessionObject = this.m_sessionsToPost.get(0); - } - SynergyRequest synergyRequest = this.createPostRequest(trackingBaseSessionObject); - if (synergyRequest == null) return; - synergyRequest.httpRequest.runInBackground = bl2; - Helper.LOGD(this, "Event queue marshalled. Incrementing repost count from %d to %d", trackingBaseSessionObject.repostCount, trackingBaseSessionObject.repostCount + 1); - ++trackingBaseSessionObject.repostCount; - this.m_isRequestInProgress = true; - final NimbleTrackingThreadManager nimbleTrackingThreadManager = NimbleTrackingThreadManager.acquireInstance(); - try { - TrackingBaseSessionObject finalTrackingBaseSessionObject = trackingBaseSessionObject; - SynergyNetwork.getComponent().sendRequest(synergyRequest, new SynergyNetworkConnectionCallback(){ - - @Override - public void callback(final SynergyNetworkConnectionHandle synergyNetworkConnectionHandle) { - nimbleTrackingThreadManager.runInWorkerThread(new Runnable(){ - - @Override - public void run() { - NimbleTrackingImplBase.this.onPostComplete(synergyNetworkConnectionHandle, finalTrackingBaseSessionObject); - } - }); - NimbleTrackingThreadManager.releaseInstance(); - } - }); - return; - } - catch (OutOfMemoryError outOfMemoryError) { - Activity activity = ApplicationEnvironment.getCurrentActivity(); - if (activity != null) { - ActivityManager.MemoryInfo memoryInfo = new ActivityManager.MemoryInfo(); - ((ActivityManager)activity.getSystemService(Activity.ACTIVITY_SERVICE)).getMemoryInfo(memoryInfo); - long l2 = memoryInfo.availMem / 0x100000L; - Helper.LOGI(this, "OutOfMemoryError with " + l2 + " MB left. Dropping current session"); - } else { - Helper.LOGI(this, "Out of memory. Dropping current session"); - } - NimbleTrackingThreadManager.releaseInstance(); - double d2 = this.m_postInterval; - this.removeSessionAndFillQueue(trackingBaseSessionObject); - this.m_postRetryDelay = 1.0; - this.m_isRequestInProgress = false; - if (this.m_sessionsToPost != null && !this.m_sessionsToPost.isEmpty()) { - Helper.LOGI(this, "More items found in the queue. Post the next one now. Queue size: %d", this.m_sessionsToPost.size()); - this.resetPostTimer(0.0, false); - return; - } - Helper.LOGI(this, "No more items found in the queue. Wait on the timer. Queue size: %d", this.m_sessionsToPost.size()); - this.resetPostTimer(d2, true); - return; - } - } - - private void removeSessionAndFillQueue(TrackingBaseSessionObject trackingBaseSessionObject) { - this.m_sessionsToPost.remove(trackingBaseSessionObject); - ++this.m_firstSessionIDNumber; - --this.m_totalSessions; - this.fillSessionsToPost(); - this.saveToPersistence(); - } - - private void resetPostTimer() { - this.resetPostTimer(this.m_postInterval); - } - - private void resetPostTimer(double d2, boolean bl2) { - double d3; - double d4 = d3 = d2; - if (d3 < 0.0) { - Helper.LOGE(this, "resetPostTimer called with an invalid period: period < 0.0. Timer reset with period 0.0 instead"); - d4 = 0.0; - } - Helper.LOGI(this, "Resetting event post timer for %s seconds.", d2); - this.killPostTimer(); - this.m_postTimer = this.m_threadManager.createTimer(d4, new PostTask(bl2)); - } - - private void saveSessionDataToPersistent() { - Persistence persistence = PersistenceService.getPersistenceForNimbleComponent(this.getComponentId(), Persistence.Storage.CACHE); - Helper.LOGI(this, "Saving event queue to persistence."); - persistence.setValue(PERSISTENCE_SESSION_DATA_ID, this.m_customSessionData); - persistence.synchronize(); - } - - /* - * Unable to fully structure code - */ - private void saveSessionToFile(TrackingBaseSessionObject var1_1, long var2_3) { - String var4_4 = this.getFilenameForSessionID(var2_3); - Persistence var5_5 = PersistenceService.getPersistenceForNimbleComponent(var4_4, Persistence.Storage.DOCUMENT); - if (var5_5.getBackUp()) { - var5_5.setBackUp(false); - } - try { - var5_5.setValue("savedSession", var1_1); - var5_5.synchronize(); - } - catch (OutOfMemoryError var1_2) { - Helper.LOGE(this, "OutOfMemoryError occurred while saving a session object to file. Exception: %s", var1_2.getLocalizedMessage()); - } - PersistenceService.cleanReferenceToPersistence(var4_4, Persistence.Storage.DOCUMENT); - } - - /* - * Exception decompiling - */ - private void saveToPersistence() { - /* - * This method has failed to decompile. When submitting a bug report, please provide this stack trace, and (if you hold appropriate legal rights) the relevant class file. - * - * org.benf.cfr.reader.util.ConfusedCFRException: Tried to end blocks [0[TRYBLOCK]], but top level block is 3[CATCHBLOCK] - * at org.benf.cfr.reader.bytecode.analysis.opgraph.Op04StructuredStatement.processEndingBlocks(Op04StructuredStatement.java:435) - * at org.benf.cfr.reader.bytecode.analysis.opgraph.Op04StructuredStatement.buildNestedBlocks(Op04StructuredStatement.java:484) - * at org.benf.cfr.reader.bytecode.analysis.opgraph.Op03SimpleStatement.createInitialStructuredBlock(Op03SimpleStatement.java:736) - * at org.benf.cfr.reader.bytecode.CodeAnalyser.getAnalysisInner(CodeAnalyser.java:850) - * at org.benf.cfr.reader.bytecode.CodeAnalyser.getAnalysisOrWrapFail(CodeAnalyser.java:278) - * at org.benf.cfr.reader.bytecode.CodeAnalyser.getAnalysis(CodeAnalyser.java:201) - * at org.benf.cfr.reader.entities.attributes.AttributeCode.analyse(AttributeCode.java:94) - * at org.benf.cfr.reader.entities.Method.analyse(Method.java:531) - * at org.benf.cfr.reader.entities.ClassFile.analyseMid(ClassFile.java:1055) - * at org.benf.cfr.reader.entities.ClassFile.analyseTop(ClassFile.java:942) - * at org.benf.cfr.reader.Driver.doJarVersionTypes(Driver.java:257) - * at org.benf.cfr.reader.Driver.doJar(Driver.java:139) - * at org.benf.cfr.reader.CfrDriverImpl.analyse(CfrDriverImpl.java:76) - * at org.benf.cfr.reader.Main.main(Main.java:54) - * at the.bytecode.club.bytecodeviewer.decompilers.impl.CFRDecompiler.decompileToZip(CFRDecompiler.java:306) - * at the.bytecode.club.bytecodeviewer.resources.ResourceDecompiling.lambda$null$1(ResourceDecompiling.java:114) - * at the.bytecode.club.bytecodeviewer.resources.ResourceDecompiling$$Lambda$144/691390785.run(Unknown Source) - * at java.lang.Thread.run(Unknown Source) - */ - throw new IllegalStateException("Decompilation failed"); - } - - @Override - public void addCustomSessionData(String string2, String string3) { - if (!Utility.validString(string2)) return; - if (!Utility.validString(string3)) { - return; - } - SessionData sessionData = new SessionData(); - sessionData.key = string2; - sessionData.value = string3; - this.m_customSessionData.add(sessionData); - this.saveSessionDataToPersistent(); - } - - protected void addObserverForSynergyEnvironmentUpdateFinished() { - if (this.m_receiver != null) return; - this.m_receiver = new StartupRequestsFinishedReceiver(); - Utility.registerReceiver("nimble.environment.notification.startup_requests_finished", this.m_receiver); - } - - protected boolean canDropSession(List list) { - return true; - } - - @Override - protected void cleanup() { - this.killPostTimer(); - EASPDataLoader.deleteDatFile(EASPDataLoader.getTrackingDatFilePath()); - } - - @Override - public void clearCustomSessionData() { - this.m_customSessionData.clear(); - this.saveSessionDataToPersistent(); - } - - protected abstract List> convertEvent(Tracking.Event var1); - - protected abstract SynergyRequest createPostRequest(TrackingBaseSessionObject var1); - - @Override - public boolean getEnable() { - return this.m_enable; - } - - @Override - public String getLogSourceTitle() { - return "TrackingBase"; - } - - protected abstract String getPersistenceIdentifier(); - - protected boolean isSameSession(TrackingBaseSessionObject trackingBaseSessionObject, TrackingBaseSessionObject trackingBaseSessionObject2) { - return false; - } - - @Override - public void logEvent(String string2, Map map) { - if (!this.m_enable) { - return; - } - boolean bl2 = false; - if (string2.equals("NIMBLESTANDARD::SESSION_END")) { - Helper.LOGD(this, "Logging session end event, " + string2 + ". Posting event queue now."); - bl2 = true; - } - Tracking.Event event = new Tracking.Event(); - event.type = string2; - event.parameters = map; - event.timestamp = new Date(); - this.logEvent(event, bl2); - } - - protected abstract void packageCurrentSession(); - - protected void queueCurrentEventsForPost() { - Helper.LOGI(this, "queueCurrentEventsForPost called. Starting queue size: %d", this.m_sessionsToPost.size()); - if (this.m_sessionsToPost == null) { - this.m_sessionsToPost = new ArrayList(); - } - if (this.m_currentSessionObject == null) { - Helper.LOGE(this, "Unexpected state, currentSessionObject is null."); - } else if (this.m_currentSessionObject.countOfEvents() == 0) { - Helper.LOGE(this, "Unexpected state, currentSessionObject events list is null or empty."); - } else { - this.addCurrentSessionObjectToBackOfQueue(); - this.dropExtraSessions(); - } - this.m_currentSessionObject = new TrackingBaseSessionObject(new HashMap(this.m_currentSessionObject.sessionData)); - } - - protected void resetPostTimer(double d2) { - this.resetPostTimer(d2, true); - } - - /* - * Exception decompiling - */ - @Override - protected void restore() { - /* - * This method has failed to decompile. When submitting a bug report, please provide this stack trace, and (if you hold appropriate legal rights) the relevant class file. - * - * org.benf.cfr.reader.util.ConfusedCFRException: Started 2 blocks at once - * at org.benf.cfr.reader.bytecode.analysis.opgraph.Op04StructuredStatement.getStartingBlocks(Op04StructuredStatement.java:412) - * at org.benf.cfr.reader.bytecode.analysis.opgraph.Op04StructuredStatement.buildNestedBlocks(Op04StructuredStatement.java:487) - * at org.benf.cfr.reader.bytecode.analysis.opgraph.Op03SimpleStatement.createInitialStructuredBlock(Op03SimpleStatement.java:736) - * at org.benf.cfr.reader.bytecode.CodeAnalyser.getAnalysisInner(CodeAnalyser.java:850) - * at org.benf.cfr.reader.bytecode.CodeAnalyser.getAnalysisOrWrapFail(CodeAnalyser.java:278) - * at org.benf.cfr.reader.bytecode.CodeAnalyser.getAnalysis(CodeAnalyser.java:201) - * at org.benf.cfr.reader.entities.attributes.AttributeCode.analyse(AttributeCode.java:94) - * at org.benf.cfr.reader.entities.Method.analyse(Method.java:531) - * at org.benf.cfr.reader.entities.ClassFile.analyseMid(ClassFile.java:1055) - * at org.benf.cfr.reader.entities.ClassFile.analyseTop(ClassFile.java:942) - * at org.benf.cfr.reader.Driver.doJarVersionTypes(Driver.java:257) - * at org.benf.cfr.reader.Driver.doJar(Driver.java:139) - * at org.benf.cfr.reader.CfrDriverImpl.analyse(CfrDriverImpl.java:76) - * at org.benf.cfr.reader.Main.main(Main.java:54) - * at the.bytecode.club.bytecodeviewer.decompilers.impl.CFRDecompiler.decompileToZip(CFRDecompiler.java:306) - * at the.bytecode.club.bytecodeviewer.resources.ResourceDecompiling.lambda$null$1(ResourceDecompiling.java:114) - * at the.bytecode.club.bytecodeviewer.resources.ResourceDecompiling$$Lambda$144/691390785.run(Unknown Source) - * at java.lang.Thread.run(Unknown Source) - */ - throw new IllegalStateException("Decompilation failed"); - } - - @Override - protected void resume() { - if (this.getEnable()) { - this.resetPostTimer(); - } - if (this.m_originLoginStatusChangedReceiver == null) { - this.m_originLoginStatusChangedReceiver = new OriginLoginStatusChangedReceiver(); - Utility.registerReceiver("nimble.notification.LoginStatusChanged", this.m_originLoginStatusChangedReceiver); - } - this.m_postRetryDelay = 1.0; - } - - @Override - public void setEnable(boolean bl2) { - Object object = bl2 ? "ENABLED" : "DISABLED"; - Helper.LOGI(this, "setEnable called. enable = %s", object); - if (this.m_enable == bl2) { - return; - } - if (!bl2) { - object = new HashMap(); - ((HashMap)object).put("eventType", "NIMBLESTANDARD::USER_TRACKING_OPTOUT"); - this.logEvent("NIMBLESTANDARD::USER_TRACKING_OPTOUT", (Map)object); - this.packageCurrentSession(); - this.postPendingEvents(false); - if (this.m_currentSessionObject.countOfEvents() > 0) { - Helper.LOGI(this, "Removing %d remaining events that couldn't be sent from queue.", this.m_currentSessionObject.countOfEvents()); - } - this.m_currentSessionObject = new TrackingBaseSessionObject(); - if (this.m_sessionsToPost != null && this.m_sessionsToPost.size() > 0) { - Helper.LOGI(this, "Removing unposted sessions."); - this.m_sessionsToPost.clear(); - } - this.killPostTimer(); - } else { - this.resetPostTimer(); - } - this.m_enable = bl2; - this.saveToPersistence(); - } - - @Override - public void setTrackingAttribute(String string2, String string3) { - if (!Utility.validString(string2)) return; - if (!Utility.validString(string3)) return; - this.m_trackingAttributes.put(string2, string3); - } - - @Override - protected void setup() { - this.m_postRetryDelay = 1.0; - this.m_threadManager = NimbleTrackingThreadManager.acquireInstance(); - } - - @Override - protected void suspend() { - if (this.m_networkStatusChangedReceiver != null) { - Utility.unregisterReceiver(this.m_networkStatusChangedReceiver); - this.m_networkStatusChangedReceiver = null; - } - if (this.m_originLoginStatusChangedReceiver != null) { - Utility.unregisterReceiver(this.m_originLoginStatusChangedReceiver); - this.m_originLoginStatusChangedReceiver = null; - } - this.killPostTimer(); - this.saveToPersistence(); - EASPDataLoader.deleteDatFile(EASPDataLoader.getTrackingDatFilePath()); - } - - @Override - protected void teardown() { - NimbleTrackingThreadManager.releaseInstance(); - this.m_threadManager = null; - } - - private class OriginLoginStatusChangedReceiver - extends BroadcastReceiver { - private OriginLoginStatusChangedReceiver() { - } - - public void onReceive(Context context, final Intent intent) { - if (!intent.getAction().equals("nimble.notification.LoginStatusChanged")) return; - NimbleTrackingImplBase.this.m_threadManager.runInWorkerThread(new Runnable(){ - - @Override - public void run() { - NimbleTrackingImplBase.this.onOriginLoginStatusChanged(intent); - } - }); - } - } - - private class PostTask - implements Runnable { - private boolean m_packageEventsOnExpiry = false; - - public PostTask(boolean bl2) { - this.m_packageEventsOnExpiry = bl2; - } - - @Override - public void run() { - NimbleTrackingImplBase.this.postIntervalTimerExpired(this.m_packageEventsOnExpiry); - } - } - - public static class SessionData - implements Serializable { - private static final long serialVersionUID = 465486L; - String key; - String value; - } - - private class StartupRequestsFinishedReceiver - extends BroadcastReceiver { - private StartupRequestsFinishedReceiver() { - } - - public void onReceive(Context context, final Intent intent) { - if (!intent.getAction().equals("nimble.environment.notification.startup_requests_finished")) return; - NimbleTrackingImplBase.this.m_threadManager.runInWorkerThread(new Runnable(){ - - @Override - public void run() { - NimbleTrackingImplBase.this.onStartupRequestsFinished(intent); - } - }); - } - } -} - diff --git a/app/src/main/java/com/ea/nimble/tracking/NimbleTrackingS2SComponent.java b/app/src/main/java/com/ea/nimble/tracking/NimbleTrackingS2SComponent.java deleted file mode 100644 index 25cd1e5..0000000 --- a/app/src/main/java/com/ea/nimble/tracking/NimbleTrackingS2SComponent.java +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Decompiled with CFR 0.152. - */ -package com.ea.nimble.tracking; - -import com.ea.nimble.Base; -import com.ea.nimble.tracking.NimbleTrackingS2SImpl; -import com.ea.nimble.tracking.NimbleTrackingThreadProxy; - -class NimbleTrackingS2SComponent -extends NimbleTrackingThreadProxy { - static final String COMPONENT_ID = "com.ea.nimble.trackingimpl.s2s"; - - private NimbleTrackingS2SComponent() { - super(new NimbleTrackingS2SImpl()); - } - - static void initialize() { - Base.registerComponent(new NimbleTrackingS2SComponent(), COMPONENT_ID); - } -} - diff --git a/app/src/main/java/com/ea/nimble/tracking/NimbleTrackingS2SImpl.java b/app/src/main/java/com/ea/nimble/tracking/NimbleTrackingS2SImpl.java deleted file mode 100644 index f201c47..0000000 --- a/app/src/main/java/com/ea/nimble/tracking/NimbleTrackingS2SImpl.java +++ /dev/null @@ -1,416 +0,0 @@ -package com.ea.nimble.tracking; - -import android.content.Context; -import android.content.pm.ApplicationInfo; -import android.content.pm.PackageManager; -import android.database.Cursor; -import android.net.Uri; -import android.os.Build; -import android.provider.Settings; -import android.telephony.TelephonyManager; - -import com.ea.ironmonkey.devmenu.util.Observer; -import com.ea.nimble.ApplicationEnvironment; -import com.ea.nimble.Global; -import com.ea.nimble.IApplicationEnvironment; -import com.ea.nimble.IHttpRequest; -import com.ea.nimble.ISynergyEnvironment; -import com.ea.nimble.ISynergyIdManager; -import com.ea.nimble.Log; -import com.ea.nimble.LogSource; -import com.ea.nimble.SynergyEnvironment; -import com.ea.nimble.SynergyIdManager; -import com.ea.nimble.SynergyRequest; -import com.ea.nimble.Utility; - -import java.util.ArrayList; -import java.util.Calendar; -import java.util.Date; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import java.util.Locale; -import java.util.Map; -import java.util.TimeZone; -import java.util.UUID; - -/* loaded from: stdlib.jar:com/ea/nimble/tracking/NimbleTrackingS2SImpl.class */ -public class NimbleTrackingS2SImpl extends NimbleTrackingImplBase implements LogSource { - public static final int EVENT_APPRESUMED = 103; - public static final int EVENT_APPSTARTED = 102; - public static final int EVENT_APPSTARTED_AFTERINSTALL = 101; - public static final int EVENT_LEVEL_UP = 108; - public static final int EVENT_MTXVIEW_ITEM_PURCHASED = 105; - private static final String EVENT_PREFIX = "SYNERGYS2S::"; - public static final int EVENT_REFERRERID_RECEIVED = 106; - public static final int EVENT_TUTORIAL_COMPLETE = 107; - public static final int EVENT_USER_REGISTERED = 104; - private static final double MARS_DEFAULT_POST_INTERVAL = 60.0d; - private static final double MARS_MAX_POST_RETRY_DELAY = 86400.0d; - private static final String SYNERGY_API_POST_EVENTS = "/s2s/api/core/postEvents"; - - private Map createEventRequestPostMap() { - String str; - String gameSpecifiedPlayerId; - IApplicationEnvironment component = ApplicationEnvironment.getComponent(); - ISynergyEnvironment component2 = SynergyEnvironment.getComponent(); - ISynergyIdManager component3 = SynergyIdManager.getComponent(); - Date date = new Date(); - HashMap hashMap = new HashMap<>(); - String str2 = ""; - boolean z = true; - try { - String googleAdvertisingId = ApplicationEnvironment.getComponent().getGoogleAdvertisingId(); - str2 = googleAdvertisingId; - z = ApplicationEnvironment.getComponent().isLimitAdTrackingEnabled(); - str2 = googleAdvertisingId; - } catch (Exception e) { - Log.Helper.LOGW(this, "Exception when getting advertising ID for Android"); - } - hashMap.put("advertiserID", str2); - hashMap.put("limitAdTracking", z+""); - hashMap.put("bundleId", Utility.safeString(component.getApplicationBundleId())); - hashMap.put("sellId", Utility.safeString(component2.getSellId())); - hashMap.put("appName", Utility.safeString(component.getApplicationName())); - hashMap.put("appVersion", Utility.safeString(component.getApplicationVersion())); - hashMap.put("deviceId", Utility.safeString(component2.getEADeviceId())); - hashMap.put("deviceNativeId", Utility.safeString(Settings.Secure.getString(component.getApplicationContext().getContentResolver(), "android_id"))); - hashMap.put("systemName", "Android"); - hashMap.put("systemVersion", Build.VERSION.RELEASE); - hashMap.put("deviceType", Build.MODEL); - hashMap.put("deviceBrand", Build.BRAND); - PackageManager packageManager = component.getApplicationContext().getPackageManager(); - TelephonyManager telephonyManager = (TelephonyManager) component.getApplicationContext().getSystemService(Context.TELEPHONY_SERVICE); - hashMap.put("carrierName", Utility.safeString(telephonyManager.getNetworkOperatorName())); - if (packageManager.checkPermission("android.permission.READ_PHONE_STATE", component.getApplicationContext().getPackageName()) == PackageManager.PERMISSION_GRANTED) { - hashMap.put("imei", Utility.safeString(telephonyManager.getDeviceId())); - } - hashMap.put("androidId", Utility.safeString(Settings.Secure.getString(component.getApplicationContext().getContentResolver(), "android_id"))); - hashMap.put("countryCode", Utility.safeString(Locale.getDefault().getCountry())); - hashMap.put("appLanguage", Utility.safeString(component.getShortApplicationLanguageCode())); - hashMap.put("localization", Utility.safeString(component.getApplicationLanguageCode())); - hashMap.put("deviceLanguage", Utility.safeString(Locale.getDefault().getLanguage())); - hashMap.put("deviceLocale", Utility.safeString(Locale.getDefault().toString())); - hashMap.put("timezone", String.format(Locale.US, "%tZ", Calendar.getInstance())); - hashMap.put("gmtOffset", String.valueOf(TimeZone.getDefault().getOffset(date.getTime()) / 1000)); - hashMap.put("synergyId", Utility.safeString(component3.getSynergyId())); - hashMap.put("macAddress", Utility.safeString(component.getMACAddress())); - hashMap.put("jflag", component.isDeviceRooted() ? Global.NOTIFICATION_DICTIONARY_RESULT_SUCCESS : Global.NOTIFICATION_DICTIONARY_RESULT_FAIL); - if (!((gameSpecifiedPlayerId = component.getGameSpecifiedPlayerId()) == null || gameSpecifiedPlayerId.length() <= 0)) { - hashMap.put("gamePlayerId", gameSpecifiedPlayerId); - } - try { - Context applicationContext = ApplicationEnvironment.getComponent().getApplicationContext(); - ApplicationInfo applicationInfo = applicationContext.getPackageManager().getApplicationInfo(applicationContext.getPackageName(), PackageManager.GET_META_DATA); - str = null; - if (applicationInfo.metaData != null) { - str = applicationInfo.metaData.getString("com.facebook.sdk.ApplicationId"); - } - } catch (PackageManager.NameNotFoundException e2) { - str = null; - } - if (Utility.validString(str)) { - hashMap.put("fbAppId", str); - } - try { - Cursor query = ApplicationEnvironment.getComponent().getApplicationContext().getContentResolver().query(Uri.parse("content://com.facebook.katana.provider.AttributionIdProvider"), null, null, null, null); - if (query != null) { - query.moveToFirst(); - hashMap.put("fbAttrId", query.getString(0)); - } - } catch (IllegalStateException e3) { - e3.printStackTrace(); - } catch (Exception e4) { - e4.printStackTrace(); - } - hashMap.put("originUser", this.m_loggedInToOrigin ? "Y" : "N"); - int size = this.m_customSessionData.size(); - if (size > 0) { - for (int i = 0; i < size; i++) { - hashMap.put(((NimbleTrackingImplBase.SessionData) this.m_customSessionData.get(i)).key, ((NimbleTrackingImplBase.SessionData) this.m_customSessionData.get(i)).value); - } - } - if (!(this.m_currentSessionObject == null || this.m_currentSessionObject.events == null)) { - ArrayList arrayList = new ArrayList(this.m_currentSessionObject.events); - Iterator it = arrayList.iterator(); - while (it.hasNext()) { - Map map = (Map) it.next(); - if (map.containsKey("referrer")) { - map.remove("referrer"); - hashMap.put("referrer", (String) map.get("referrer")); - } - } - hashMap.put("adEvents", arrayList.toString()); - } - return hashMap; - } - - private static boolean isS2SEvent(String str) { - if (str == null) { - return false; - } - return str.startsWith(EVENT_PREFIX); - } - - @Override // com.ea.nimble.tracking.NimbleTrackingImplBase - protected boolean canDropSession(List list) { - TrackingBaseSessionObject trackingBaseSessionObject = list.get(0); - if (trackingBaseSessionObject.events.size() == 0) { - Log.Helper.LOGE(this, "Trying to drop session with no events"); - return true; - } - for (Map map : trackingBaseSessionObject.events) { - String str = map.get("eventType"); - if (str != null && str.equals(String.valueOf((int) EVENT_APPSTARTED_AFTERINSTALL))) { - return false; - } - } - return true; - } - - @Override // com.ea.nimble.tracking.NimbleTrackingImplBase - protected List> convertEvent(Tracking.Event event) { - int i; - String str; - String str2; - String str3; - String str4; - String str5 = null; - String str6 = null; - String str7 = null; - if (!Tracking.isNimbleStandardEvent(event.type) && !isS2SEvent(event.type)) { - return null; - } - HashMap hashMap = new HashMap(7); - if (event.type.equals(Tracking.EVENT_APPSTART_AFTERINSTALL)) { - i = EVENT_APPSTARTED_AFTERINSTALL; - str5 = "Launch"; - str4 = null; - str3 = null; - str2 = null; - str = null; - } else if (event.type.equals(Tracking.EVENT_APPSTART_NORMAL) || event.type.equals(Tracking.EVENT_APPSTART_AFTERUPGRADE) || event.type.equals(Tracking.EVENT_APPSTART_FROMURL)) { - i = 102; - str5 = "Launch"; - str = null; - str2 = null; - str3 = null; - str4 = null; - } else if (event.type.equals(Tracking.EVENT_APPSTART_FROMPUSH)) { - i = 102; - str5 = "NotificationLaunch"; - str = null; - str2 = null; - str3 = null; - str4 = null; - } else if (event.type.equals(Tracking.EVENT_APPRESUME_NORMAL) || event.type.equals(Tracking.EVENT_SESSION_START) || event.type.equals(Tracking.EVENT_APPRESUME_FROMURL) || event.type.equals(Tracking.EVENT_APPRESUME_FROMEBISU)) { - i = 103; - str5 = "Resume"; - str = null; - str2 = null; - str3 = null; - str4 = null; - } else if (event.type.equals(Tracking.EVENT_APPRESUME_FROMPUSH)) { - i = 103; - str5 = "NotificationResume"; - str = null; - str2 = null; - str3 = null; - str4 = null; - } else if (event.type.equals(Tracking.EVENT_USER_REGISTERED)) { - String str8 = event.parameters.get(Tracking.KEY_USERNAME); - str6 = "username"; - str = null; - str2 = null; - str7 = str8; - str3 = null; - str4 = null; - str5 = "Registration"; - i = 104; - if (str8 == null) { - Log.Helper.LOGE(this, "Error: missing event parameter \"%s\"", Tracking.KEY_USERNAME); - str6 = "username"; - str = null; - str2 = null; - str7 = str8; - str3 = null; - str4 = null; - str5 = "Registration"; - i = 104; - } - } else if (event.type.equals(Tracking.EVENT_MTX_ITEM_PURCHASED)) { - String str9 = event.parameters.get(Tracking.KEY_MTX_CURRENCY); - String str10 = event.parameters.get(Tracking.KEY_MTX_PRICE); - if (str9 == null) { - Log.Helper.LOGE(this, "Error: missing event parameter \"%s\"", Tracking.KEY_MTX_CURRENCY); - } - str6 = "tvalue"; - str = "fvalue"; - str2 = null; - str7 = str9; - str3 = str10; - str4 = null; - str5 = "Purchase"; - i = 105; - if (str10 == null) { - Log.Helper.LOGE(this, "Error: missing event parameter \"%s\"", Tracking.KEY_MTX_PRICE); - str6 = "tvalue"; - str = "fvalue"; - str2 = null; - str7 = str9; - str3 = str10; - str4 = null; - str5 = "Purchase"; - i = 105; - } - } else if (event.type.equals(Tracking.EVENT_REFERRERID_RECEIVED)) { - str7 = event.parameters.get(Tracking.KEY_REFERRER_ID); - if (str7 == null) { - Log.Helper.LOGE(this, "Error: invalid (null) referrer id."); - return null; - } - i = 106; - str5 = "Referrer"; - str6 = "referrerId"; - str = null; - str2 = null; - str3 = null; - str4 = null; - } else if (event.type.equals(Tracking.EVENT_TUTORIAL_COMPLETE)) { - i = 107; - str5 = "TutorialComplete"; - str = null; - str2 = null; - str3 = null; - str4 = null; - } else if (event.type.equals(Tracking.EVENT_LEVEL_UP)) { - i = 108; - str5 = "LevelUp"; - str6 = "duration"; - str7 = event.parameters.get(Tracking.KEY_DURATION); - str = "gameplayDuration"; - str3 = event.parameters.get(Tracking.KEY_GAMEPLAY_DURATION); - str2 = "userLevel"; - str4 = event.parameters.get(Tracking.KEY_USER_LEVEL); - } else if (!event.type.equals(TrackingS2S.EVENT_CUSTOM)) { - return null; - } else { - i = Integer.parseInt(event.parameters.get("eventType")); - str6 = event.parameters.get("keyType01"); - str7 = event.parameters.get("keyValue01"); - str = event.parameters.get("keyType02"); - str3 = event.parameters.get("keyValue02"); - str2 = event.parameters.get("keyType03"); - str4 = event.parameters.get("keyValue03"); - } - hashMap.put("eventType", String.valueOf(i)); - hashMap.put("eventName", str5); - hashMap.put("timestamp", Utility.getUTCDateStringFormat(event.timestamp)); - hashMap.put("eventKeyType01", str6 == null ? Global.NOTIFICATION_DICTIONARY_RESULT_FAIL : str6); - hashMap.put("eventValue01", str7 == null ? "" : str7); - hashMap.put("eventKeyType02", str == null ? Global.NOTIFICATION_DICTIONARY_RESULT_FAIL : str); - hashMap.put("eventValue02", str3 == null ? "" : str3); - hashMap.put("eventKeyType03", str2 == null ? Global.NOTIFICATION_DICTIONARY_RESULT_FAIL : str2); - hashMap.put("eventValue03", str4 == null ? "" : str4); - hashMap.put("transactionId", UUID.randomUUID().toString()); - if (i == 101 || i == 102 || i == 103) { - if (this.m_currentSessionObject.sessionData.size() > 0) { - queueCurrentEventsForPost(); - } - Log.Helper.LOGD(this, "Logging session start event. Posting event queue now."); - resetPostTimer(0.0d); - } - ArrayList arrayList = new ArrayList(); - arrayList.add(hashMap); - return arrayList; - } - - @Override // com.ea.nimble.tracking.NimbleTrackingImplBase - protected SynergyRequest createPostRequest(TrackingBaseSessionObject trackingBaseSessionObject) { - HashMap hashMap = new HashMap(); - hashMap.put("apiVer", "1.0.0"); - String serverUrlWithKey = SynergyEnvironment.getComponent().getServerUrlWithKey(SynergyEnvironment.SERVER_URL_KEY_SYNERGY_S2S); - if (serverUrlWithKey == null) { - Log.Helper.LOGI(this, "Tracking server URL from NimbleEnvironment is nil. Adding observer for environment update finish."); - super.addObserverForSynergyEnvironmentUpdateFinished(); - return null; - } - HashMap hashMap2 = new HashMap(trackingBaseSessionObject.sessionData); - hashMap2.put("now_timestamp", Utility.getUTCDateStringFormat(new Date())); - if (hashMap2.get("synergyId") == null || hashMap2.get("synergyId").toString().length() == 0) { - String synergyId = SynergyIdManager.getComponent().getSynergyId(); - if (Utility.validString(synergyId)) { - Log.Helper.LOGV(this, "Creating post request. No synergyId in session info dictionary, inserting synergyId value %s now.", synergyId); - hashMap2.put("synergyId", synergyId); - } else { - Log.Helper.LOGV(this, "Creating post request. No synergyId in session info dictionary, still no synergyId available now."); - } - } - SynergyRequest synergyRequest = new SynergyRequest(SYNERGY_API_POST_EVENTS, IHttpRequest.Method.POST, null); - synergyRequest.baseUrl = serverUrlWithKey; - synergyRequest.urlParameters = hashMap; - synergyRequest.jsonData = hashMap2; - return synergyRequest; - } - - @Override // com.ea.nimble.Component - public String getComponentId() { - return "com.ea.nimble.trackingimpl.s2s"; - } - - @Override // com.ea.nimble.tracking.NimbleTrackingImplBase, com.ea.nimble.LogSource - public String getLogSourceTitle() { - return "TrackingS2S"; - } - - @Override // com.ea.nimble.tracking.NimbleTrackingImplBase - protected String getPersistenceIdentifier() { - return "S2S"; - } - - /* JADX WARN: Multi-variable type inference failed */ - /* JADX WARN: Type inference failed for: r0v30, types: [double] */ - /* JADX WARN: Type inference failed for: r0v9, types: [double] */ - /* JADX WARN: Type inference failed for: r10v1 */ - /* JADX WARN: Type inference failed for: r10v2 */ - /* JADX WARN: Type inference failed for: r10v3, types: [double] */ - /* JADX WARN: Type inference failed for: r10v4 */ - /* JADX WARN: Type inference failed for: r10v5 */ - /* JADX WARN: Type inference failed for: r8v0, types: [double] */ - /* JADX WARN: Type inference failed for: r8v12 */ - /* JADX WARN: Type inference failed for: r8v5 */ - /* JADX WARN: Unknown variable types count: 4 */ - /* - Code decompiled incorrectly, please refer to instructions dump. - To view partially-correct code enable 'Show inconsistent code' option in preferences - */ - public double getRetryTime(com.ea.nimble.SynergyNetworkConnectionHandle r7) { - /* - Method dump skipped, instructions count: 349 - To view this dump change 'Code comments level' option to 'DEBUG' - */ - throw new UnsupportedOperationException("Method not decompiled: com.ea.nimble.tracking.NimbleTrackingS2SImpl.getRetryTime(com.ea.nimble.SynergyNetworkConnectionHandle):double"); - } - - @Override // com.ea.nimble.tracking.NimbleTrackingImplBase - protected void packageCurrentSession() { - if (this.m_currentSessionObject.countOfEvents() > 0) { - this.m_currentSessionObject.sessionData = new HashMap(createEventRequestPostMap()); - if (!((ArrayList) this.m_currentSessionObject.sessionData.get("adEvents")).isEmpty()) { - queueCurrentEventsForPost(); - } - } - } - - /* JADX WARN: Code restructure failed: missing block: B:18:0x007d, code lost: - if (r6 > -22000) goto L_0x0080; - */ - /* - Code decompiled incorrectly, please refer to instructions dump. - To view partially-correct code enable 'Show inconsistent code' option in preferences - */ - public boolean shouldAttemptReTrans(com.ea.nimble.SynergyNetworkConnectionHandle r5) { - Observer.onCallingMethod(Observer.Method.IMPOSSIBLE_TO_DECOMPILE); - return true; - } -} diff --git a/app/src/main/java/com/ea/nimble/tracking/NimbleTrackingSynergyComponent.java b/app/src/main/java/com/ea/nimble/tracking/NimbleTrackingSynergyComponent.java deleted file mode 100644 index 1f83663..0000000 --- a/app/src/main/java/com/ea/nimble/tracking/NimbleTrackingSynergyComponent.java +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Decompiled with CFR 0.152. - */ -package com.ea.nimble.tracking; - -import com.ea.nimble.Base; -import com.ea.nimble.tracking.NimbleTrackingSynergyImpl; -import com.ea.nimble.tracking.NimbleTrackingThreadProxy; - -class NimbleTrackingSynergyComponent -extends NimbleTrackingThreadProxy { - static final String COMPONENT_ID = "com.ea.nimble.trackingimpl.synergy"; - - private NimbleTrackingSynergyComponent() { - super(new NimbleTrackingSynergyImpl()); - } - - static void initialize() { - Base.registerComponent(new NimbleTrackingSynergyComponent(), COMPONENT_ID); - } -} - diff --git a/app/src/main/java/com/ea/nimble/tracking/NimbleTrackingSynergyImpl.java b/app/src/main/java/com/ea/nimble/tracking/NimbleTrackingSynergyImpl.java deleted file mode 100644 index 571ea87..0000000 --- a/app/src/main/java/com/ea/nimble/tracking/NimbleTrackingSynergyImpl.java +++ /dev/null @@ -1,679 +0,0 @@ -/* - * Decompiled with CFR 0.152. - * - * Could not load the following classes: - * android.content.BroadcastReceiver - * android.content.ContentResolver - * android.content.Context - * android.content.Intent - * android.os.Build$VERSION - * android.provider.Settings$Secure - */ -package com.ea.nimble.tracking; - -import android.content.BroadcastReceiver; -import android.content.ContentResolver; -import android.content.Context; -import android.content.Intent; -import android.os.Build; -import android.provider.Settings; - -import com.ea.ironmonkey.devmenu.util.Observer; -import com.ea.nimble.ApplicationEnvironment; -import com.ea.nimble.IApplicationEnvironment; -import com.ea.nimble.IHttpRequest; -import com.ea.nimble.INetwork; -import com.ea.nimble.ISynergyEnvironment; -import com.ea.nimble.ISynergyIdManager; -import com.ea.nimble.Log; -import com.ea.nimble.LogSource; -import com.ea.nimble.Network; -import com.ea.nimble.SynergyEnvironment; -import com.ea.nimble.SynergyIdManager; -import com.ea.nimble.SynergyRequest; -import com.ea.nimble.Utility; - -import java.util.ArrayList; -import java.util.Calendar; -import java.util.Date; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import java.util.Locale; -import java.util.Map; -import java.util.Random; -import java.util.Set; - -class NimbleTrackingSynergyImpl - extends NimbleTrackingImplBase - implements LogSource { - private static final String EVENT_PREFIX = "SYNERGYTRACKING::"; - private static final int MAX_CUSTOM_EVENT_PARAMETERS = 20; - private int m_eventNumber; - private Map m_mainAuthenticator; - private final BroadcastReceiver m_mainAuthenticatorUpdateReceiver; - private List> m_pendingEvents; - private final BroadcastReceiver m_pidInfoUpdateReceiver = new BroadcastReceiver() { - - public void onReceive(Context context, final Intent intent) { - NimbleTrackingSynergyImpl.this.m_threadManager.runInWorkerThread(new Runnable() { - - @Override - public void run() { - NimbleTrackingSynergyImpl.this.onPidInfoUpdate(intent); - } - }); - } - }; - private Map m_pidMap; - private String m_sessionId; - private SynergyIdChangedReceiver m_synergyIdChangedReceiver; - - NimbleTrackingSynergyImpl() { - this.m_mainAuthenticatorUpdateReceiver = new BroadcastReceiver() { - - public void onReceive(Context context, final Intent intent) { - NimbleTrackingSynergyImpl.this.m_threadManager.runInWorkerThread(() -> NimbleTrackingSynergyImpl.this.onMainAuthenticatorUpdate(intent)); - } - }; - this.m_synergyIdChangedReceiver = new SynergyIdChangedReceiver(); - this.m_pendingEvents = new ArrayList>(); - } - - private void addPushTNGTrackingParams(Tracking.Event event, Map map) { - map.put("eventKeyType01", String.valueOf(SynergyConstants.EVT_KEYTYPE_MESSAGEID.value)); - map.put("eventValue01", event.parameters.get("NIMBLESTANDARD::KEY_PN_MESSAGE_ID")); - map.put("eventKeyType02", String.valueOf(SynergyConstants.EVT_KEYTYPE_ENUMERATION.value)); - map.put("eventValue02", event.parameters.get("NIMBLESTANDARD::KEY_PN_MESSAGE_TYPE")); - map.put("eventKeyType03", String.valueOf(SynergyConstants.EVT_KEYTYPE_ENUMERATION.value)); - map.put("eventValue03", event.parameters.get("NIMBLESTANDARD::KEY_PN_DEVICE_ID")); - } - - /* - * Unable to fully structure code - */ - private Map generateSessionInfoDictionary(String var1_1) { - ISynergyEnvironment var12_2 = SynergyEnvironment.getComponent(); - ISynergyIdManager var10_3 = SynergyIdManager.getComponent(); - IApplicationEnvironment var9_4 = ApplicationEnvironment.getComponent(); - HashMap var8_5 = new HashMap(); - String var6_6 = ""; - Boolean var4_7 = true; - try { - String var7_8 = ApplicationEnvironment.getComponent().getGoogleAdvertisingId(); - var4_7 = ApplicationEnvironment.getComponent().isLimitAdTrackingEnabled(); - var6_6 = var7_8; - var8_5.put("advertiserID", var6_6); - } catch (Exception var7_9) { - Log.Helper.LOGW(this, "Exception when getting advertising ID for Android"); - } - var8_5.put("limitAdTracking", var4_7); - String var7_8 = var12_2.getSellId(); - String var11_11 = var12_2.getEAHardwareId(); - String eaDeviceId = var12_2.getEADeviceId(); // var12_2 - String var13_12 = Build.VERSION.RELEASE; - var6_6 = ApplicationEnvironment.getComponent().getCarrier(); - String var14_13 = ApplicationEnvironment.getComponent().getApplicationVersion(); - String var15_14 = String.format(Locale.US, "%tZ", Calendar.getInstance()); - var8_5.put("carrier", var6_6); - var8_5.put("timezone", var15_14); - var6_6 = var9_4.isAppCracked() ? "1" : "0"; - var8_5.put("pflag", var6_6); - var6_6 = var9_4.isDeviceRooted() ? "1" : "0"; - var8_5.put("jflag", var6_6); - var8_5.put("firmwareVer", var13_12); - var8_5.put("sellId", Utility.safeString(var7_8)); - var8_5.put("buildId", Utility.safeString(var14_13)); - var8_5.put("sdkVer", "1.23.14.1217"); - var8_5.put("sdkCfg", "DL"); - var8_5.put("deviceId", Utility.safeString(eaDeviceId)); - var8_5.put("hwId", Utility.safeString(var11_11)); - var8_5.put("schemaVer", "2"); - var8_5.put("platform", "android"); - var6_6 = "N"; - INetwork component = Network.getComponent();//var7_8 - if (component.getStatus() == Network.Status.OK) { - var6_6 = component.isNetworkWifi() ? "W" : "G"; - } - var8_5.put("networkAccess", var6_6); - var6_6 = this.m_loggedInToOrigin ? "Y" : "N"; - var8_5.put("originUser", var6_6); - if (Utility.validString(var1_1)) { - var8_5.put("uid", Utility.safeString(var1_1)); - var8_5.put("androidId", Utility.safeString(Settings.Secure.getString((ContentResolver) var9_4.getApplicationContext().getContentResolver(), (String) "android_id"))); - var8_5.put("macHash", Utility.safeString(Utility.SHA256HashString(var9_4.getMACAddress()))); - var8_5.put("aut", Utility.safeString("")); - if (this.m_pidMap != null && this.m_pidMap.size() > 0) { - var8_5.put("pidMap", this.m_pidMap); - } - if ((var1_1 = var9_4.getGameSpecifiedPlayerId()) != null && var1_1.length() > 0) { - var8_5.put("gamePlayerId", var1_1); - } - if (this.m_customSessionData.size() <= 0) return var8_5; - - for (SessionData base : this.m_customSessionData) { - var8_5.put(base.key, base.value); - } - } - return var8_5; - } - - private String generateSynergySessionId() { - Object object = Utility.getUTCDateStringFormat(new Date()).replace("_", ""); - StringBuilder stringBuilder = new StringBuilder(24); - stringBuilder.append((String) object); - int n2 = stringBuilder.length(); - object = new Random(); - int n3 = 0; - while (n3 < 24 - n2) { - stringBuilder.append(((Random) object).nextInt(10)); - ++n3; - } - return stringBuilder.toString(); - } - - private static boolean isSynergyEvent(String string2) { - if (string2 != null) return string2.startsWith(EVENT_PREFIX); - return false; - } - - private void onMainAuthenticatorUpdate(Intent object) { - Observer.onCallingMethod(Observer.Method.SUSPICIOUS_METHOD); - } - - private void onPidInfoUpdate(Intent object) { - if ((object.getSerializableExtra("pidMapId")) == null) return; - this.m_currentSessionObject.sessionData.put("pidMap", this.m_pidMap); - } - - private void onSynergyIdChanged(Intent object) { - String string2 = object.getStringExtra("previousSynergyId"); - String currentSynergyId = object.getStringExtra("currentSynergyId"); - HashMap hashMap = new HashMap(); - hashMap.put("eventType", String.valueOf(SynergyConstants.EVT_SESSION_END_SYNERGYID_CHANGE.value)); - hashMap.put("keyType01", String.valueOf(SynergyConstants.EVT_KEYTYPE_SYNERGYID.value)); - hashMap.put("keyValue01", Utility.safeString(string2)); - hashMap.put("keyType02", String.valueOf(SynergyConstants.EVT_KEYTYPE_SYNERGYID.value)); - hashMap.put("keyValue02", Utility.safeString(currentSynergyId)); - this.logEvent("SYNERGYTRACKING::CUSTOM", hashMap); - this.m_currentSessionObject.sessionData = new HashMap<>(this.generateSessionInfoDictionary(string2)); - this.queueCurrentEventsForPost(); - hashMap.put("eventType", String.valueOf(SynergyConstants.EVT_NEW_SESSION_START_SYNERGYID_CHANGE.value)); - this.logEvent("SYNERGYTRACKING::CUSTOM", hashMap); - } - - /* - * Exception decompiling - */ - private void parseCustomParameters(Map var1_1, Map var2_2) { - Observer.onCallingMethod(Observer.Method.IMPOSSIBLE_TO_DECOMPILE, Observer.Method.SUSPICIOUS_METHOD); - } - - private void resetSession() { - this.m_sessionId = this.generateSynergySessionId(); - this.m_eventNumber = 1; - } - - private void sleep() { - Utility.unregisterReceiver(this.m_synergyIdChangedReceiver); - } - - private void wakeup() { - Utility.registerReceiver("nimble.synergyidmanager.notification.synergy_id_changed", this.m_synergyIdChangedReceiver); - } - - @Override - protected boolean canDropSession(List iterator) { - String string2; - TrackingBaseSessionObject trackingBaseSessionObject = iterator.get(0); - if (trackingBaseSessionObject.events.size() == 0) { - Log.Helper.LOGE(this, "Trying to drop session with no events"); - return true; - } - Iterator> iterator1 = trackingBaseSessionObject.events.iterator(); - do { - if (!iterator1.hasNext()) return true; - } while ((string2 = iterator1.next().get("eventType")) == null || !string2.equals(String.valueOf(SynergyConstants.EVT_APPSTART_AFTERINSTALL.value))); - return false; - } - - @Override - protected void cleanup() { - this.sleep(); - super.cleanup(); - } - - /* - * Loose catch block - * Enabled unnecessary exception pruning - */ - @Override - protected List> convertEvent(Tracking.Event arrayList) { - Object object; - Object object2222222; - HashMap hashMap; - Object object3; - Object object4; - - object4 = SynergyConstants.EVT_UNDEFINED; - object3 = -1; - hashMap = new HashMap(); - if (!Tracking.isNimbleStandardEvent(((Tracking.Event) ((Object) arrayList)).type) && !NimbleTrackingSynergyImpl.isSynergyEvent(((Tracking.Event) ((Object) arrayList)).type)) { - return null; - } - - switch (arrayList.type) { - case "NIMBLESTANDARD::APPSTART_NORMAL": { - object4 = SynergyConstants.EVT_APPSTART_NORMALLY; - } - case "NIMBLESTANDARD::APPSTART_AFTERINSTALL": { - object4 = SynergyConstants.EVT_APPSTART_AFTERINSTALL; - } - case "NIMBLESTANDARD::APPSTART_AFTERUPGRADE": { - object4 = SynergyConstants.EVT_APPSTART_AFTERUPGRADE; - } - case "NIMBLESTANDARD::APPSTART_FROMURL": { - object4 = SynergyConstants.EVT_APPSTART_FROM_URL; - } - case "NIMBLESTANDARD::APPSTART_FROMPUSH": { - object4 = SynergyConstants.EVT_APPSTART_FROMPUSH; - try { - object2222222 = ApplicationEnvironment.getComponent().getApplicationContext().getSharedPreferences("PushNotification", 0).getString("messageId", null); - if (object2222222 == null) { - this.addPushTNGTrackingParams((Tracking.Event) ((Object) arrayList), (Map) hashMap); - object2222222 = object3; - } - hashMap.put("eventKeyType01", String.valueOf(SynergyConstants.EVT_KEYTYPE_MESSAGEID.value)); - hashMap.put("eventValue01", (String) object2222222); - ApplicationEnvironment.getComponent().getApplicationContext().getSharedPreferences("PushNotification", 0).edit().remove("messageId").commit(); - ApplicationEnvironment.getComponent().getApplicationContext().getSharedPreferences("PushNotification", 0).edit().remove("PushNotification").commit(); - object2222222 = object3; - } catch (Exception exception) { - exception.printStackTrace(); - object2222222 = object3; - } - } - case "NIMBLESTANDARD::APPRESUME_FROMURL": { - object4 = SynergyConstants.EVT_APP_ENTER_FOREGROUND_FROM_URL; - } - case "NIMBLESTANDARD::APPRESUME_FROMEBISU": { - object4 = SynergyConstants.EVT_APP_ENTER_FOREGROUND_FROM_EBISU; - } - case "NIMBLESTANDARD::APPRESUME_FROMPUSH": { - object4 = SynergyConstants.EVT_APP_RESUME_FROM_PUSH; - try { - object2222222 = ApplicationEnvironment.getComponent().getApplicationContext().getSharedPreferences("PushNotification", 0).getString("messageId", null); - if (object2222222 == null) { - this.addPushTNGTrackingParams((Tracking.Event) ((Object) arrayList), (Map) hashMap); - object2222222 = object3; - } - hashMap.put("eventKeyType01", String.valueOf(SynergyConstants.EVT_KEYTYPE_MESSAGEID.value)); - hashMap.put("eventValue01", (String) object2222222); - ApplicationEnvironment.getComponent().getApplicationContext().getSharedPreferences("PushNotification", 0).edit().remove("messageId").commit(); - ApplicationEnvironment.getComponent().getApplicationContext().getSharedPreferences("PushNotification", 0).edit().remove("PushNotification").commit(); - object2222222 = object3; - } catch (Exception exception) { - exception.printStackTrace(); - object2222222 = object3; - } - } - case "NIMBLESTANDARD::SESSION_START": { - object4 = SynergyConstants.EVT_APP_SESSION_START; - } - case "NIMBLESTANDARD::SESSION_END": { - object4 = SynergyConstants.EVT_APP_SESSION_END; - } - case "NIMBLESTANDARD::SESSION_TIME": { - object4 = SynergyConstants.EVT_APP_SESSION_TIME; - hashMap.put("eventKeyType01", String.valueOf(SynergyConstants.EVT_KEYTYPE_DURATION.value)); - hashMap.put("eventValue01", arrayList.parameters.get("NIMBLESTANDARD::KEY_DURATION")); - } - case "NIMBLESTANDARD::MTX_ITEM_BEGIN_PURCHASE": { - object4 = SynergyConstants.EVT_MTXVIEW_ITEMPURCHASE; - hashMap.put("eventKeyType01", String.valueOf(SynergyConstants.EVT_KEYTYPE_MTX_SELLID.value)); - hashMap.put("eventValue01", ((Tracking.Event) ((Object) arrayList)).parameters.get("NIMBLESTANDARD::KEY_MTX_SELLID")); - } - case "NIMBLESTANDARD::MTX_ITEM_PURCHASED": { - object4 = SynergyConstants.EVT_MTXVIEW_ITEM_PURCHASED; - hashMap.put("eventKeyType01", String.valueOf(SynergyConstants.EVT_KEYTYPE_MTX_SELLID.value)); - hashMap.put("eventValue01", ((Tracking.Event) ((Object) arrayList)).parameters.get("NIMBLESTANDARD::KEY_MTX_SELLID")); - } - case "NIMBLESTANDARD::MTX_FREEITEM_DOWNLOADED": { - object4 = SynergyConstants.EVT_MTXVIEW_FREEITEM_DOWNLOADED; - hashMap.put("eventKeyType01", String.valueOf(SynergyConstants.EVT_KEYTYPE_MTX_SELLID.value)); - hashMap.put("eventValue01", ((Tracking.Event) ((Object) arrayList)).parameters.get("NIMBLESTANDARD::KEY_MTX_SELLID")); - } - case "NIMBLESTANDARD::USER_TRACKING_OPTOUT": { - object4 = SynergyConstants.EVT_USER_TRACKING_OPTOUT; - } - case "NIMBLESTANDARD::PN_DISPLAY_OPT_IN": { - object4 = SynergyConstants.EVT_USER_SHOWN_PN_OPTIN_PROMPT; - } - case "NIMBLESTANDARD::PN_USER_OPT_IN": { - object4 = SynergyConstants.EVT_USER_SHOWN_PN_OPTIN_PROMPT; - hashMap.put("eventKeyType02", ((Tracking.Event) ((Object) arrayList)).parameters.get(SynergyConstants.EVT_KEYTYPE_ENUMERATION.value)); - hashMap.put("eventValue02", "Yes"); - } - case "NIMBLESTANDARD::PN_SHOWN_TO_USER": { - object = SynergyConstants.EVT_PN_SHOWN_TO_USER; - hashMap.put("eventKeyType01", String.valueOf(SynergyConstants.EVT_KEYTYPE_MESSAGEID.value)); - hashMap.put("eventValue01", arrayList.parameters.get("NIMBLESTANDARD::KEY_PN_MESSAGE_ID")); - if (arrayList.parameters.containsKey("NIMBLESTANDARD::KEY_PN_MESSAGE_ID")) { - hashMap.put("eventKeyType02", String.valueOf(SynergyConstants.EVT_KEYTYPE_ENUMERATION.value)); - hashMap.put("eventValue02", arrayList.parameters.get("NIMBLESTANDARD::KEY_PN_MESSAGE_TYPE")); - } - object4 = object; - if (arrayList.parameters.containsKey("NIMBLESTANDARD::KEY_PN_DEVICE_ID")) { - hashMap.put("eventKeyType03", String.valueOf(SynergyConstants.EVT_KEYTYPE_ENUMERATION.value)); - hashMap.put("eventValue03", arrayList.parameters.get("NIMBLESTANDARD::KEY_PN_DEVICE_ID")); - } - } - case "NIMBLESTANDARD::PN_RECEIVED": { - object4 = SynergyConstants.EVT_PN_RECEIVED; - this.addPushTNGTrackingParams(arrayList, hashMap); - } - case "NIMBLESTANDARD::PN_DEVICE_REGISTERED": { - object4 = SynergyConstants.EVT_PN_DEVICE_REGISTERED; - hashMap.put("eventKeyType01", String.valueOf(SynergyConstants.EVT_KEYTYPE_ENUMERATION.value)); - hashMap.put("eventValue01", ((Tracking.Event) ((Object) arrayList)).parameters.get("NIMBLESTANDARD::KEY_PN_DATE_OF_BIRTH")); - hashMap.put("eventKeyType02", String.valueOf(SynergyConstants.EVT_KEYTYPE_ENUMERATION.value)); - hashMap.put("eventValue02", ((Tracking.Event) ((Object) arrayList)).parameters.get("NIMBLESTANDARD::KEY_PN_DISABLED_FLAG")); - hashMap.put("eventKeyType03", String.valueOf(SynergyConstants.EVT_KEYTYPE_ENUMERATION.value)); - hashMap.put("eventValue03", ((Tracking.Event) ((Object) arrayList)).parameters.get("NIMBLESTANDARD::KEY_PN_DEVICE_ID")); - } - case "NIMBLESTANDARD::PN_USER_CLICKED_OK": { - object4 = SynergyConstants.EVT_PN_SHOWN_TO_USER; - hashMap.put("eventKeyType01", String.valueOf(SynergyConstants.EVT_KEYTYPE_MESSAGEID.value)); - hashMap.put("eventValue01", arrayList.parameters.get("NIMBLESTANDARD::KEY_PN_MESSAGE_ID")); - hashMap.put("eventKeyType02", arrayList.parameters.get(SynergyConstants.EVT_KEYTYPE_ENUMERATION.value)); - hashMap.put("eventValue02", "Ok"); - } - case "NIMBLESTANDARD::IDENTITY_MIGRATION": { - object4 = SynergyConstants.EVT_IDENTITY_MIGRATION; - hashMap.put("eventKeyType01", String.valueOf(SynergyConstants.EVT_KEYTYPE_ENUMERATION.value)); - hashMap.put("eventValue01", arrayList.parameters.get("NIMBLESTANDARD::KEY_MIGRATION_GAME_TRIGGERED")); - hashMap.put("eventValue02", arrayList.parameters.get("NIMBLESTANDARD::KEY_IDENTITY_SOURCE")); - hashMap.put("eventKeyType02", String.valueOf(SynergyConstants.EVT_KEYTYPE_JSON_MAP.value)); - } - case "NIMBLESTANDARD::IDENTITY_LOGIN": { - object4 = SynergyConstants.EVT_IDENTITY_LOGIN; - hashMap.put("eventKeyType01", String.valueOf(SynergyConstants.EVT_KEYTYPE_JSON_MAP.value)); - hashMap.put("eventValue01", arrayList.parameters.get("NIMBLESTANDARD::KEY_IDENTITY_PIDMAP_LOGIN")); - hashMap.put("eventKeyType02", String.valueOf(SynergyConstants.EVT_KEYTYPE_JSON_MAP.value)); - hashMap.put("eventValue02", arrayList.parameters.get("NIMBLESTANDARD::KEY_IDENTITY_TARGET")); - - HashMap hashMap1 = new HashMap<>(); - - Set> entries = - Utility - .convertJSONObjectStringToMap( - arrayList.parameters.get("NIMBLESTANDARD::KEY_IDENTITY_PIDMAP_LOGIN" - )).entrySet(); - - for (Map.Entry object5 : entries) - hashMap1.put(object5.getKey(), object5.getValue().toString()); - - Set> entries1 = Utility - .convertJSONObjectStringToMap( - arrayList.parameters.get("NIMBLESTANDARD::KEY_IDENTITY_TARGET" - )).entrySet(); - - for (Map.Entry object5 : entries1) - hashMap1.put(object5.getKey(), object5.getValue().toString()); - this.m_pidMap = hashMap1; - this.m_currentSessionObject.sessionData.put("pidMap", this.m_pidMap); - } - case "NIMBLESTANDARD::IDENTITY_LOGOUT": { - object4 = SynergyConstants.EVT_IDENTITY_LOGOUT; - hashMap.put("eventKeyType01", String.valueOf(SynergyConstants.EVT_KEYTYPE_JSON_MAP.value)); - hashMap.put("eventValue01", arrayList.parameters.get("NIMBLESTANDARD::KEY_IDENTITY_SOURCE")); - hashMap.put("eventKeyType02", String.valueOf(SynergyConstants.EVT_KEYTYPE_JSON_MAP.value)); - hashMap.put("eventValue02", arrayList.parameters.get("NIMBLESTANDARD::KEY_IDENTITY_PIDMAP_LOGOUT")); - - HashMap hashMap1 = new HashMap<>(); - - Set> entries = - Utility - .convertJSONObjectStringToMap( - arrayList.parameters.get("NIMBLESTANDARD::KEY_IDENTITY_PIDMAP_LOGOUT" - )).entrySet(); - - for (Map.Entry object5 : entries) - hashMap1.put(object5.getKey(), object5.getValue().toString()); - - this.m_currentSessionObject.sessionData.put("pidMap", this.m_pidMap); - this.m_pidMap = hashMap1; - } - case "NIMBLESTANDARD::IDENTITY_MIGRATION_STARTED": { - object4 = SynergyConstants.EVT_IDENTITY_MIGRATION_STARTED; - hashMap.put("eventKeyType01", String.valueOf(SynergyConstants.EVT_KEYTYPE_ENUMERATION.value)); - hashMap.put("eventValue01", arrayList.parameters.get("NIMBLESTANDARD::KEY_MIGRATION_GAME_TRIGGERED")); - hashMap.put("eventKeyType02", String.valueOf(SynergyConstants.EVT_KEYTYPE_JSON_MAP.value)); - hashMap.put("eventValue02", arrayList.parameters.get("NIMBLESTANDARD::KEY_IDENTITY_SOURCE")); - hashMap.put("eventKeyType03", String.valueOf(SynergyConstants.EVT_KEYTYPE_JSON_MAP.value)); - hashMap.put("eventValue03", arrayList.parameters.get("NIMBLESTANDARD::KEY_IDENTITY_TARGET")); - } - case "NIMBLESTANDARD::TUTORIAL_COMPLETE": { - object4 = SynergyConstants.EVT_GAMEPLAY_PROGRESSION_TUTORIAL_COMPLETE; - } - case "NIMBLESTANDARD::LEVEL_UP": { - object4 = SynergyConstants.EVT_GP_LEVEL_PROMOTION; - hashMap.put("eventKeyType01", String.valueOf(SynergyConstants.EVT_KEYTYPE_DURATION.value)); - hashMap.put("eventValue01", arrayList.parameters.get("NIMBLESTANDARD::KEY_DURATION")); - hashMap.put("eventKeyType02", String.valueOf(SynergyConstants.EVT_KEYTYPE_DURATION.value)); - hashMap.put("eventValue02", arrayList.parameters.get("NIMBLESTANDARD::KEY_GAMEPLAY_DURATION")); - hashMap.put("eventKeyType03", String.valueOf(SynergyConstants.EVT_KEYTYPE_ENUMERATION.value)); - hashMap.put("eventValue03", arrayList.parameters.get("NIMBLESTANDARD::KEY_USER_LEVEL")); - } - case "SYNERGYTRACKING::CUSTOM": - return null; - } - - object4 = arrayList.parameters.get("eventType"); - int n2 = Integer.parseInt((String) object4); - object4 = SynergyConstants.fromInt(n2); - this.parseCustomParameters(arrayList.parameters, hashMap); - - - Log.Helper.LOGE(this, "Error: Invalid format for eventType parameter. Expected integer value, got " + (String) object4); - Observer.onCallingMethod(Observer.Method.VERY_SUSPICIOUS_METHOD); - return null; -/* - while (object.hasNext()) { - String object5; - object5 = (String) object.next(); - object3 = hashMap.get(object5); - if (!Utility.validString((String) object3) || !((String) object3).startsWith("${") || !((String) object3).endsWith("}")) - continue; - if ((object3 = (String) this.m_trackingAttributes.get(((String) object3).substring(2, ((String) object3).length() - 1))) == null) { - object3 = ""; - } - hashMap.put((String) object5, (String) object3); - } - - object3 = Utility.getUTCDateStringFormat(arrayList.timestamp); - arrayList = new ArrayList>(); - if ((Integer) object2222222 != -1) { - hashMap.put("eventType", String.valueOf(object2222222)); - } else { - hashMap.put("eventType", String.valueOf(object4.value)); - } - hashMap.put("timestamp", (String) object3); - if (object4.isSessionStartEventType()) { - if (this.m_currentSessionObject.sessionData.size() > 0) { - this.queueCurrentEventsForPost(); - } - this.resetSession(); - for (Object object2222222 : this.m_pendingEvents) { - object2222222.put("session", this.m_sessionId); - object2222222.put("step", String.valueOf(this.m_eventNumber)); - ++this.m_eventNumber; - arrayList.add((Map) object2222222); - } - this.m_pendingEvents.clear(); - } else if (this.m_sessionId == null) { - this.m_pendingEvents.add(hashMap); - return null; - } - hashMap.put("session", this.m_sessionId); - hashMap.put("step", String.valueOf(this.m_eventNumber)); - ++this.m_eventNumber; - if (object4.isSessionStartEventType()) { - Log.Helper.LOGD(this, "Logging session start event, %s. Posting event queue now.", object4); - this.resetPostTimer(0.0); - } - if (object4 == SynergyConstants.EVT_APP_SESSION_END) { - this.m_sessionId = null; - } - arrayList.add(hashMap); - return arrayList; - */ - - } - - @Override - protected SynergyRequest createPostRequest(TrackingBaseSessionObject object) { - Observer.onCallingMethod(Observer.Method.HARD_TO_RECOVER_LOGIC); - return new SynergyRequest("lol", IHttpRequest.Method.POST, var1 -> Observer.onCallingMethod(Observer.Method.SUSPICIOUS_METHOD)); - /* - Object object2 = SynergyEnvironment.getComponent().getServerUrlWithKey("synergy.tracking"); - if (object2 == null) { - Log.Helper.LOGI(this, "Tracking server URL from NimbleEnvironment is nil. Adding observer for environment update finish."); - this.addObserverForSynergyEnvironmentUpdateFinished(); - return null; - } - Object object3 = object.sessionData; - HashMap hashMap = new HashMap<>(); - hashMap.putAll((Map) object3); - hashMap.put("now_timestamp", Utility.getUTCDateStringFormat(new Date())); - object3 = new ArrayList<>(object.events); - for (int i2 = 0; i2 < object3.size(); ++i2) { - ((Map) object3.get(i2)).put("repostCount", String.valueOf(object.repostCount)); - } - hashMap.put("events", object3); - if (hashMap.get("uid") == null) { - object = SynergyIdManager.getComponent().getSynergyId(); - if (Utility.validString((String) object)) { - Log.Helper.LOGV(this, "Creating post request. No uid in session info dictionary, inserting uid value %s now.", object); - hashMap.put("uid", object); - } else { - Log.Helper.LOGV(this, "Creating post request. No uid in session info dictionary, still no uid available now."); - } - } - object = SynergyEnvironment.getComponent(); - object3 = hashMap.get("sellId").toString(); - if (object3 == null || ((String) object3).equals("")) { - object3 = Utility.safeString(object.getSellId()); - if (object3 == null || ((String) object3).equals("")) { - Log.Helper.LOGE(this, "Creating POST request. Missing sell id."); - } else { - hashMap.put("sellId", object3); - } - } - if ((object3 = hashMap.get("hwId").toString()) == null || ((String) object3).equals("")) { - object3 = Utility.safeString(object.getEAHardwareId()); - if (object3 == null || ((String) object3).equals("")) { - Log.Helper.LOGE(this, "Creating POST request. Missing hw id."); - } else { - hashMap.put("hwId", object3); - } - } - if ((object3 = hashMap.get("deviceId").toString()) == null || ((String) object3).equals("")) { - if ((object = Utility.safeString(object.getEADeviceId())) == null || ((String) object).equals("")) { - Log.Helper.LOGE(this, "Creating POST request. Missing device id."); - } else { - hashMap.put("deviceId", object); - } - } - object = new SynergyRequest("/tracking/api/core/logEvent", IHttpRequest.Method.POST, null); - ((SynergyRequest) object).baseUrl = object2; - ((SynergyRequest) object).jsonData = hashMap; - object2 = OperationalTelemetryDispatch.getComponent(); - if (object2 != null) { - object3 = new HashMap(); - ((HashMap) object3).put("BASEURL", ((SynergyRequest) object).baseUrl); - ((HashMap) object3).put("API", ((SynergyRequest) object).api); - ((HashMap) object3).put("POSTDATA", Utility.convertObjectToJSONString(hashMap)); - object2.logEvent("com.ea.nimble.trackingimpl.synergy", (Map) object3); - } - Utility.sendBroadcast("nimble.notification.trackingimpl.synergy.postingToServer", null); - return object; - - */ - } - - @Override - public String getComponentId() { - return "com.ea.nimble.trackingimpl.synergy"; - } - - @Override - public String getLogSourceTitle() { - return "TrackingSynergy"; - } - - @Override - protected String getPersistenceIdentifier() { - return "Synergy"; - } - - @Override - protected boolean isSameSession(TrackingBaseSessionObject object, TrackingBaseSessionObject object2) { - if (((TrackingBaseSessionObject) object).events.size() == 0 || ((TrackingBaseSessionObject) object2).events.size() == 0) { - Log.Helper.LOGE(this, "Trying to compare session with no events"); - return true; - } - String session = object.events.get(0).get("session"); - String session2 = object2.events.get(0).get("session"); - if (session != null) { - if (session2 != null) return session.equals(session2); - } - Log.Helper.LOGE(this, "Trying to compare event with no session"); - return true; - } - - @Override - protected void packageCurrentSession() { - if (this.m_currentSessionObject.countOfEvents() <= 0) return; - Log.Helper.LOGV(this, "Preparing for post, generating session info dictionary."); - this.m_currentSessionObject.sessionData = new HashMap(this.generateSessionInfoDictionary(null)); - this.queueCurrentEventsForPost(); - } - - @Override - protected void restore() { - super.restore(); - Utility.registerReceiver("nimble.notification.identity.authenticator.pid.info.update", this.m_pidInfoUpdateReceiver); - Utility.registerReceiver("nimble.notification.identity.main.authenticator.change", this.m_mainAuthenticatorUpdateReceiver); - this.wakeup(); - } - - @Override - public void setEnable(boolean bl2) { - super.setEnable(bl2); - if (!bl2) { - this.m_sessionId = null; - } - if (this.m_sessionId != null) return; - if (!bl2) return; - this.resetSession(); - this.logEvent("NIMBLESTANDARD::SESSION_START", null); - } - - private class SynergyIdChangedReceiver - extends BroadcastReceiver { - private SynergyIdChangedReceiver() { - } - - public void onReceive(Context context, final Intent intent) { - NimbleTrackingSynergyImpl.this.m_threadManager.runInWorkerThread(new Runnable() { - - @Override - public void run() { - NimbleTrackingSynergyImpl.this.onSynergyIdChanged(intent); - } - }); - } - } -} - diff --git a/app/src/main/java/com/ea/nimble/tracking/NimbleTrackingThreadManager.java b/app/src/main/java/com/ea/nimble/tracking/NimbleTrackingThreadManager.java deleted file mode 100644 index fdbde32..0000000 --- a/app/src/main/java/com/ea/nimble/tracking/NimbleTrackingThreadManager.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Decompiled with CFR 0.152. - */ -package com.ea.nimble.tracking; - -import java.util.concurrent.ScheduledExecutorService; -import java.util.concurrent.ScheduledFuture; -import java.util.concurrent.ScheduledThreadPoolExecutor; -import java.util.concurrent.TimeUnit; - -class NimbleTrackingThreadManager { - private static NimbleTrackingThreadManager s_instance; - private static int s_instanceRefs; - private ScheduledExecutorService m_executor = new ScheduledThreadPoolExecutor(1){ - - @Override - protected void afterExecute(Runnable object, Throwable throwable) {} - }; - - NimbleTrackingThreadManager() { - } - - static NimbleTrackingThreadManager acquireInstance() { - if (s_instance == null) { - s_instance = new NimbleTrackingThreadManager(); - } - ++s_instanceRefs; - return s_instance; - } - - static void releaseInstance() { - if (--s_instanceRefs != 0) return; - s_instance.shutdown(); - s_instance = null; - } - - private void shutdown() { - this.m_executor.shutdown(); - } - - ScheduledFuture createTimer(double d2, Runnable runnable) { - return this.m_executor.schedule(runnable, (long)(1000.0 * d2), TimeUnit.MILLISECONDS); - } - - void runInWorkerThread(Runnable runnable) { - this.runInWorkerThread(false, runnable); - } - - void runInWorkerThread(boolean bl2, Runnable object) {} -} - diff --git a/app/src/main/java/com/ea/nimble/tracking/NimbleTrackingThreadProxy.java b/app/src/main/java/com/ea/nimble/tracking/NimbleTrackingThreadProxy.java deleted file mode 100644 index 37300dd..0000000 --- a/app/src/main/java/com/ea/nimble/tracking/NimbleTrackingThreadProxy.java +++ /dev/null @@ -1,156 +0,0 @@ -/* - * Decompiled with CFR 0.152. - */ -package com.ea.nimble.tracking; - -import com.ea.nimble.Component; -import com.ea.nimble.tracking.ITracking; -import com.ea.nimble.tracking.NimbleTrackingImplBase; -import com.ea.nimble.tracking.NimbleTrackingThreadManager; -import java.util.Map; - -public abstract class NimbleTrackingThreadProxy -extends Component -implements ITracking { - private NimbleTrackingImplBase m_impl; - private NimbleTrackingThreadManager m_threadManager; - - protected NimbleTrackingThreadProxy(NimbleTrackingImplBase nimbleTrackingImplBase) { - this.m_impl = nimbleTrackingImplBase; - } - - @Override - public void addCustomSessionData(final String string2, final String string3) { - this.m_threadManager.runInWorkerThread(new Runnable(){ - - @Override - public void run() { - NimbleTrackingThreadProxy.this.m_impl.addCustomSessionData(string2, string3); - } - }); - } - - @Override - protected void cleanup() { - this.m_threadManager.runInWorkerThread(true, new Runnable(){ - - @Override - public void run() { - NimbleTrackingThreadProxy.this.m_impl.cleanup(); - } - }); - } - - @Override - public void clearCustomSessionData() { - this.m_threadManager.runInWorkerThread(new Runnable(){ - - @Override - public void run() { - NimbleTrackingThreadProxy.this.m_impl.clearCustomSessionData(); - } - }); - } - - @Override - public String getComponentId() { - return this.m_impl.getComponentId(); - } - - @Override - public boolean getEnable() { - return this.m_impl.getEnable(); - } - - @Override - public void logEvent(final String string2, final Map map) { - this.m_threadManager.runInWorkerThread(new Runnable(){ - - @Override - public void run() { - NimbleTrackingThreadProxy.this.m_impl.logEvent(string2, map); - } - }); - } - - @Override - protected void restore() { - this.m_threadManager.runInWorkerThread(new Runnable(){ - - @Override - public void run() { - NimbleTrackingThreadProxy.this.m_impl.restore(); - } - }); - } - - @Override - protected void resume() { - this.m_threadManager.runInWorkerThread(new Runnable(){ - - @Override - public void run() { - NimbleTrackingThreadProxy.this.m_impl.resume(); - } - }); - } - - @Override - public void setEnable(final boolean bl2) { - this.m_threadManager.runInWorkerThread(true, new Runnable(){ - - @Override - public void run() { - NimbleTrackingThreadProxy.this.m_impl.setEnable(bl2); - } - }); - } - - @Override - public void setTrackingAttribute(final String string2, final String string3) { - this.m_threadManager.runInWorkerThread(new Runnable(){ - - @Override - public void run() { - NimbleTrackingThreadProxy.this.m_impl.setTrackingAttribute(string2, string3); - } - }); - } - - @Override - protected void setup() { - this.m_threadManager = NimbleTrackingThreadManager.acquireInstance(); - this.m_threadManager.runInWorkerThread(new Runnable(){ - - @Override - public void run() { - NimbleTrackingThreadProxy.this.m_impl.setup(); - } - }); - } - - @Override - protected void suspend() { - this.m_threadManager.runInWorkerThread(new Runnable(){ - - @Override - public void run() { - NimbleTrackingThreadProxy.this.m_impl.suspend(); - } - }); - } - - @Override - protected void teardown() { - this.m_threadManager.runInWorkerThread(true, new Runnable(){ - - @Override - public void run() { - NimbleTrackingThreadProxy.this.m_impl.teardown(); - } - }); - NimbleTrackingThreadManager.releaseInstance(); - this.m_threadManager = null; - } -} - diff --git a/app/src/main/java/com/ea/nimble/tracking/ReferrerReceiver.java b/app/src/main/java/com/ea/nimble/tracking/ReferrerReceiver.java deleted file mode 100644 index bfbc43e..0000000 --- a/app/src/main/java/com/ea/nimble/tracking/ReferrerReceiver.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Decompiled with CFR 0.152. - * - * Could not load the following classes: - * android.content.BroadcastReceiver - * android.content.Context - * android.content.Intent - * android.util.Log - */ -package com.ea.nimble.tracking; - -import android.content.BroadcastReceiver; -import android.content.Context; -import android.content.Intent; - -import com.ea.ironmonkey.devmenu.util.Observer; - -public class ReferrerReceiver -extends BroadcastReceiver { - public static final String TAG = "ReferrerReceiver"; - - public static void clearReferrerId(Context context) { - context.getSharedPreferences("referrer", 0).edit().putString("referrer", null).commit(); - } - - public static String getReferrerId(Context context) { - return context.getSharedPreferences("referrer", 0).getString("referrer", null); - } - - /* - * WARNING - Removed back jump from a try to a catch block - possible behaviour change. - * Unable to fully structure code - * Enabled unnecessary exception pruning - */ - public void onReceive(Context var1_1, Intent var2_3) { - Observer.onCallingMethod(Observer.Method.HARD_TO_RECOVER_LOGIC, Observer.Method.SUSPICIOUS_METHOD); - /* - if (var2_3 == null) return; - if (!Objects.equals(var2_3.getAction(), "com.android.vending.INSTALL_REFERRER")) return; - Log.i((String)"ReferrerReceiver", (String)"Received install referrer notification from the OS."); - var2_3 = var2_3 .getStringExtra("referrer"); - if (var2_3 == null) return; - var2_3 = URLDecoder.decode((String)var2_3 , "UTF-8"); - Log.i((String)"ReferrerReceiver", (String)("Referrer Id from the notification: " + (String)var2_3 )); - { - catch (Exception var1_2) { - Log.w((String)"ReferrerReceiver", (String)"Unable to log a Referrer - 106 event indicating that Nimble has received a referrer id from the OS."); - return; - } - try { - if (ApplicationEnvironment.isMainApplicationRunning() && ApplicationEnvironment.getCurrentActivity() != null && Base.getComponent("com.ea.nimble.tracking") != null) { - var3_4 = (ITracking)Base.getComponent("com.ea.nimble.tracking"); - var4_6 = new HashMap(); - var4_6.put("NIMBLESTANDARD::KEY_REFERRER_ID", (String)var2_3 ); - var3_4.logEvent("NIMBLESTANDARD::REFERRER_ID_RECEIVED", var4_6); - return; - } - Log.w((String)"ReferrerReceiver", (String)("Unable to log Referrer - 106 event because the Tracking component isn't ready. Persisting referrerId (" + (String)var2_3 + ") to try again later.")); - } - catch (Exception var3_5) {} -lbl-1000: - // 2 sources - - { - while (true) { - var1_1.getSharedPreferences("referrer", 0).edit().putString("referrer", (String)var2_3 ).commit(); - return; - } - } - { - Log.w((String)"ReferrerReceiver", (String)("Unable to log Referrer - 106 event because the Tracking component isn't ready. Persisting referrerId (" + (String)var2_3 + ") to try again later.")); - ** continue; - } - } - */ - } - -} - diff --git a/app/src/main/java/com/ea/nimble/tracking/SynergyConstants.java b/app/src/main/java/com/ea/nimble/tracking/SynergyConstants.java deleted file mode 100644 index d6e17b1..0000000 --- a/app/src/main/java/com/ea/nimble/tracking/SynergyConstants.java +++ /dev/null @@ -1,254 +0,0 @@ -/* - * Decompiled with CFR 0.152. - */ -package com.ea.nimble.tracking; - -public enum SynergyConstants { - EVT_UNDEFINED(-1), - EVT_APPSTART_NORMALLY(10000), - EVT_APPSTART_FROMPUSH(10001), - EVT_APPSTART_AFTERINSTALL(10002), - EVT_APPSTART_AFTERUPGRADE(10003), - EVT_APP_SESSION_START(10004), - EVT_APP_SESSION_TIME(10005), - EVT_APP_RESUME_FROM_PUSH(10007), - EVT_APPSTART_FROM_URL(10009), - EVT_APP_ENTER_FOREGROUND_FROM_URL(10010), - EVT_NEW_SESSION_START_SYNERGYID_CHANGE(10012), - EVT_IDENTITY_MIGRATION(12000), - EVT_IDENTITY_LOGIN(12001), - EVT_IDENTITY_LOGOUT(12002), - EVT_IDENTITY_MIGRATION_STARTED(12003), - EVT_APPEND_NORMALLY(20000), - EVT_APPEND_ABNORMALLY(20001), - EVT_APP_INTERRUPTED(20002), - EVT_APP_SESSION_END(20003), - EVT_APP_ENTER_FOREGROUND_FROM_EBISU(20004), - EVT_APP_SESSION_START_EMBED(20005), - EVT_EMBED_OTD_UPGRADE(20006), - EVT_SESSION_END_SYNERGYID_CHANGE(20007), - EVT_USER_SHOWN_PN_OPTIN_PROMPT(20008), - EVT_PN_SHOWN_TO_USER(20009), - EVT_PN_RECEIVED(20015), - EVT_PN_DEVICE_REGISTERED(20016), - EVT_OPT_FULL_PURCHASE(30000), - EVT_MOREGAMES_ENTER(30001), - EVT_MOREGAMES_CLICKTHROUGH(30002), - EVT_MOREGAMES_GAMESELECT(30004), - EVT_MOREGAMES_CATEGORYSELECT(30005), - EVT_MOREGAMES_OVERLAY_APPEARS(30006), - EVT_MOREGAMES_OVERLAY_BUYCLICK(30007), - EVT_ENTER_FULL_GAME_OVERVIEW_SCREEN(30008), - EVT_LITE_ED_GAME_DEMO_START(30009), - EVT_LITE_ED_GAME_DEMO_END(30010), - EVT_MAINMENU_BANNER_CLICK(30011), - EVT_MAINMENU_TICKER_CLICK(30012), - EVT_INSTORE_BANNER_CLICK(30013), - EVT_INSTORE_TICKER_CLICK(30014), - EVT_FEATURED_BANNER_CLICK(30015), - EVT_MOREGAMES_CLICKTHROUGH_FEATURED(30017), - EVT_MOREGAMES_CLICKTHROUGH_SIDEBANNER(30018), - EVT_IPAD_UPSELL_MESSAGE_DISPLAYED(30019), - EVT_IPAD_UPSELL_MESSAGE_NOTHANKS_CLICKED(30020), - EVT_IPAD_UPSELL_MESSAGE_OK_CLICKED(30021), - EVT_IPAD_UPSELL_MESSAGE_LATER_CLICKED(30022), - EVT_UPSELL_VIDEO_CLICKED(30023), - EVT_USER_TRACKING_OPTOUT(30024), - EVT_GAMEPLAY_PROGRESSION_SPGAME_START(30025), - EVT_GAMEPLAY_PROGRESSION_SPGAME_RESTART(30026), - EVT_GAMEPLAY_PROGRESSION_SPGAME_SAVE(30027), - EVT_GAMEPLAY_PROGRESSION_SPGAME_CONTINUE(30028), - EVT_GAMEPLAY_PROGRESSION_SPGAME_QUIT(30029), - EVT_GAMEPLAY_PROGRESSION_SPGAME_COMPLETE(30030), - EVT_GAMEPLAY_PROGRESSION_SPGAME_TIME_SPENT(30031), - EVT_GAMEPLAY_PROGRESSION_SPGAME_SCORE(30032), - EVT_GAMEPLAY_PROGRESSION_TUTORIAL_SKIP(30033), - EVT_GAMEPLAY_PROGRESSION_TUTORIAL_COMPLETE(30034), - EVT_GAMEPLAY_PROGRESSION_CUTSCENE_SKIP(30035), - EVT_GAMEPLAY_PROGRESSION_CONTROLSCHEME_USED(30036), - EVT_GAMEPLAY_PROGRESSION_CHARACTER(30037), - EVT_GAMEPLAY_PROGRESSION_MPGAME_START(30038), - EVT_GAMEPLAY_PROGRESSION_MPGAME_QUIT(30039), - EVT_GAMEPLAY_PROGRESSION_MPGAME_DISCONNECT(30040), - EVT_GAMEPLAY_PROGRESSION_MPGAME_COMPLETE(30041), - EVT_GAMEPLAY_PROGRESSION_MPGAME_TIME_SPENT(30042), - EVT_MULTITASKING_USER_APP_MINIMIZED(30043), - EVT_MULTITASKING_USER_APP_RESUMED(30044), - EVT_MULTITASKING_USER_START_TUTORIAL(30045), - EVT_MTXVIEW_ENTER(40000), - EVT_MTXVIEW_GAMECATEGORY(40001), - EVT_MTXVIEW_ITEMSELECT(40002), - EVT_MTXVIEW_ITEMPURCHASE(40003), - EVT_MTXVIEW_ENTER_FROMCTX(40004), - EVT_MTXVIEW_FREEITEM_DOWNLOADED(40005), - EVT_MTXVIEW_ITEM_PURCHASED(40006), - EVT_IAC_MTX_ITEM_USED(40007), - EVT_MTXVIEW_ITEM_PURCHASED_REFERRERDATA(40008), - EVT_MTXVIEW_ITEMPURCHASE_SLOTDATA(40009), - EVT_MTXVIEW_ITEDISPLAYED(40010), - EVT_IGE_FREE_CREDITS_EARNED(40011), - EVT_IGE_PAID_CREDITS_EARNED(40012), - EVT_IGE_GIFT_RECEIVED(40013), - EVT_IGE_GIFT_SENT(40014), - EVT_IGE_FREE_CREDITS_ITEMS_CLICK(40015), - EVT_IGE_PAID_CREDITS_ITEMS_CLICK(40016), - EVT_IGE_STORE_VISIT(40017), - EVT_IGE_PAID_CREDITS_PURCHASE_REVENUE(40018), - EVT_IGE_PAID_CREDITS_PURCHASE_LEVEL(40019), - EVT_IGE_FREE_CREDITS_PURCHASE_REVENUE(40020), - EVT_IGE_FREE_CREDITS_PURCHASE_LEVEL(40021), - EVT_IGE_GAME_START_CASH_DETAIL(40022), - EVT_OFFERWALL_ITEM_REDEEMED_STORE_EAL(40023), - EVT_OFFERWALL_ITEM_REDEEMED_USER_LEVEL_EAL(40024), - EVT_OFFERWALL_ITEM_CLICK_EAL(40025), - EVT_OFFERWALL_STORE_VISIT_EAL(40026), - EVT_INGAME_AD_CLICK(40027), - EVT_INGAME_LEVEL_FREE_CREDITS_COUNT(40028), - EVT_INGAME_LEVEL_PAID_CREDITS_COUNT(40029), - EVT_USER_LEVEL_MTX_ITEM_PURCHASED(40030), - EVT_IGE_GAME_START_FREE_CREDIT(40031), - EVT_IGE_GAME_START_PAID_CREDIT(40032), - EVT_INGAME_EMAIL_OPEN(50001), - EVT_INGAME_EMAIL_SEND(50002), - EVT_INGAME_EMAIL_RECEIEVE(50003), - EVT_MEDIAPICKER_OPEN(50004), - EVT_ACCESS_BT_MENU(50005), - EVT_BEGIN_BT_SESSION(50006), - EVT_COMPLETE_BT_SESSION(50007), - EVT_ACCESS_WIFI_MENU(50008), - EVT_BEGIN_WIFI_SESSION(50009), - EVT_COMPLETE_WIFI_SESSION(50010), - EVT_USR_ISSUE_PUSH_NOTIFICATION_CHALLENGE(50011), - EVT_LANGUAGE_SELECTED(50012), - EVT_MENU_PROGRESSION_MAINMENU_SELECTED(50013), - EVT_MENU_PROGRESSION_MAINMENU_SUBMENU_SELECTED(50014), - EVT_MENU_PROGRESSION_GAMEMENU_SELECTED(50015), - EVT_MENU_PROGRESSION_GAMEMENU_SUBMENU_SELECTED(50016), - EVT_DEVICE_ORIENTATION_CHANGED(50017), - EVT_ERROR_BLUETOOTH_WIFI_BOTH_ACTIVE(50018), - EVT_ACCESS_INGAME_SCREEN(60001), - EVT_LEAVE_INGAME_SCREEN(60002), - EVT_USER_GAMEPLAY_FUNNEL_EAL(60003), - EVT_USER_TUTORIAL_FUNNEL_EAL(60004), - EVT_USER_TRANSACTION_FUNNEL(60005), - EVT_USER_MESSAGING_FUNNEL(60006), - EVT_USER_SIGNUP_FUNNEL(60007), - EVT_USER_GAME_LOAD_FUNNEL(60008), - EVT_USER_GAME_DOWNLOAD_FUNNEL(60009), - EVT_EVENTS_PURGED(70000), - EVT_GP_LEVEL_PROMOTION(70005), - EVT_GP_LEVEL_PROMOTION_GAMEPLAY_TIME_TOTAL_EAL(70006), - EVT_GP_ACHIEVEMENTS_CHECKPOINTS_EAL(70007), - EVT_GP_XPGAIN_EVENT_EAL(70008), - EVT_GP_EVENT_USER_EAL(70009), - EVT_GP_APP_START_USER_LEVEL_EAL(70010), - EVT_EBISU_EMAIL_PROMPT(80032), - EVT_EBISU_PROMPT_INPUT(80033), - EVT_EBISU_REGISTRATION_FUNNEL(80034), - EVT_EBISU_OPTIONAL_REGISTRATION_FIELDS(80035), - EVT_EBISU_REGISTRATION_ERROR(80036), - EVT_EBISU_SIGNIN_FUNNEL(80037), - EVT_EBISU_SIGNIN_ERROR(80038), - EVT_EBISU_USER_SIGNIN(80039), - EVT_EBISU_USER_FRIENDS_COUNT(80040), - EVT_EBISU_ENTER_EBISUUI(80041), - EVT_EBISU_FRIENDS_VISIT(80042), - EVT_EBISU_FRIEND_SEARCH(80043), - EVT_EBISU_FRIEND_INVITE_SENT(80044), - EVT_EBISU_FRIEND_INVITE_ACCPTED(80045), - EVT_EBISU_NEWSFEED_VISIT(80046), - EVT_EBISU_NEWSFEED_TILE_BUTTON_CLICK(80047), - EVT_EBISU_NEWSFEED_BANNER_CLICK(80048), - EVT_EBISU_NEWSFEED_UPDATES(80049), - EVT_EBISU_PROFILE_VISIT(80050), - EVT_EBISU_LOGO_YES_CLICK(80051), - EVT_EBISU_LOGO_NO_CLICK(80052), - EVT_EBISU_RECOVER_PASSWORD_FUNNEL(80053), - EVT_EBISU_USER_SIGNOUT(80054), - EVT_EBISU_LOAD_FAIL(80055), - EVT_EBISU_FRIEND_PROFILE_BANNER_CLICK(80056), - EVT_EBISU_FRIEND_PROFILE_GAME_ICON_CLICK(80057), - EVT_EBISU_FRIEND_INVITE_REJECTED(80058), - EVT_EBISU_PROFILE_BANNER_CLICK(80059), - EVT_EBISU_PROFILE_GAME_ICON_CLICK(80060), - EVT_GAME_ERROR_CONNECTIVITY(90000), - EVT_GAME_ERROR_GAMEPLAY(90001), - EVT_KEYTYPE_NONE(0), - EVT_KEYTYPE_GAME_SELLID(1), - EVT_KEYTYPE_MTX_SELLID(2), - EVT_KEYTYPE_MTX_CATEGORY(3), - EVT_KEYTYPE_SCREEN_NAME(4), - EVT_KEYTYPE_EVENT_COUNT(5), - EVT_KEYTYPE_DURATION(7), - EVT_KEYTYPE_FREQUENCY(8), - EVT_KEYTYPE_FEATURED(10), - EVT_KEYTYPE_DMG_SECTION(11), - EVT_KEYTYPE_GAME_PRODUCTID(12), - EVT_KEYTYPE_DMG_CATEGORY(13), - EVT_KEYTYPE_SCORE(14), - EVT_KEYTYPE_ENUMERATION(15), - EVT_KEYTYPE_TICKERID(16), - EVT_KEYTYPE_BANNERID(17), - EVT_KEYTYPE_MESSAGEID(18), - EVT_KEYTYPE_BANNER_POSITION(19), - EVT_KEYTYPE_LANGUAGE(20), - EVT_KEYTYPE_USER_LEVEL_DATA(21), - EVT_KEYTYPE_FIELD_ID(22), - EVT_KEYTYPE_LOGO_MESSAGE_ID(23), - EVT_KEYTYPE_FIELD_TYPE(24), - EVT_KEYTYPE_SYNERGYID(25), - EVT_KEYTYPE_JSON_MAP(26), - EVT_KEYTYPE_LAST_ENUM(27); - - public static final int EVENT_SYNERGY_CUSTOM = 4; - public static final String NIMBLE_NOTIFICATION_TRACKING_SYNERGY_POSTING_TO_SERVER = "nimble.notification.trackingimpl.synergy.postingToServer"; - public final int value; - - private SynergyConstants(int n3) { - this.value = n3; - } - - public static SynergyConstants fromInt(int n2) { - SynergyConstants[] synergyConstantsArray = SynergyConstants.values(); - int n3 = synergyConstantsArray.length; - int n4 = 0; - while (n4 < n3) { - SynergyConstants synergyConstants = synergyConstantsArray[n4]; - if (synergyConstants.value == n2) { - return synergyConstants; - } - ++n4; - } - return EVT_UNDEFINED; - } - - public boolean isSessionEndEventType() { - switch (this.ordinal()) { - default: { - return false; - } - case 10: - case 11: - } - return true; - } - - public boolean isSessionStartEventType() { - switch (this) { - default: { - return false; - } - case EVT_APPSTART_NORMALLY: - case EVT_APPSTART_AFTERINSTALL: - case EVT_APPSTART_AFTERUPGRADE: - case EVT_APPSTART_FROM_URL: - case EVT_APPSTART_FROMPUSH: - case EVT_APP_SESSION_START: - case EVT_APP_ENTER_FOREGROUND_FROM_URL: - case EVT_NEW_SESSION_START_SYNERGYID_CHANGE: - case EVT_APP_RESUME_FROM_PUSH: - } - return true; - } -} - diff --git a/app/src/main/java/com/ea/nimble/tracking/Tracking.java b/app/src/main/java/com/ea/nimble/tracking/Tracking.java deleted file mode 100644 index ad83a48..0000000 --- a/app/src/main/java/com/ea/nimble/tracking/Tracking.java +++ /dev/null @@ -1,104 +0,0 @@ -/* - * Decompiled with CFR 0.152. - */ -package com.ea.nimble.tracking; - -import com.ea.nimble.Base; -import com.ea.nimble.tracking.ITracking; -import com.ea.nimble.tracking.TrackingWrangler; -import java.util.Date; -import java.util.Map; - -public class Tracking { - public static final String COMPONENT_ID = "com.ea.nimble.tracking"; - public static final String EVENT_APPRESUME_FROMEBISU = "NIMBLESTANDARD::APPRESUME_FROMEBISU"; - public static final String EVENT_APPRESUME_FROMPUSH = "NIMBLESTANDARD::APPRESUME_FROMPUSH"; - public static final String EVENT_APPRESUME_FROMURL = "NIMBLESTANDARD::APPRESUME_FROMURL"; - public static final String EVENT_APPRESUME_NORMAL = "NIMBLESTANDARD::APPRESUME_NORMAL"; - public static final String EVENT_APPSTART_AFTERINSTALL = "NIMBLESTANDARD::APPSTART_AFTERINSTALL"; - public static final String EVENT_APPSTART_AFTERUPGRADE = "NIMBLESTANDARD::APPSTART_AFTERUPGRADE"; - public static final String EVENT_APPSTART_FROMPUSH = "NIMBLESTANDARD::APPSTART_FROMPUSH"; - public static final String EVENT_APPSTART_FROMURL = "NIMBLESTANDARD::APPSTART_FROMURL"; - public static final String EVENT_APPSTART_NORMAL = "NIMBLESTANDARD::APPSTART_NORMAL"; - public static final String EVENT_LEVEL_UP = "NIMBLESTANDARD::LEVEL_UP"; - public static final String EVENT_MTX_FREEITEM_DOWNLOADED = "NIMBLESTANDARD::MTX_FREEITEM_DOWNLOADED"; - public static final String EVENT_MTX_ITEM_BEGIN_PURCHASE = "NIMBLESTANDARD::MTX_ITEM_BEGIN_PURCHASE"; - public static final String EVENT_MTX_ITEM_PURCHASED = "NIMBLESTANDARD::MTX_ITEM_PURCHASED"; - public static final String EVENT_PN_DEVICE_REGISTERED = "NIMBLESTANDARD::PN_DEVICE_REGISTERED"; - public static final String EVENT_PN_DISPLAY_OPT_IN = "NIMBLESTANDARD::PN_DISPLAY_OPT_IN"; - public static final String EVENT_PN_RECEIVED = "NIMBLESTANDARD::PN_RECEIVED"; - public static final String EVENT_PN_SHOWN_TO_USER = "NIMBLESTANDARD::PN_SHOWN_TO_USER"; - public static final String EVENT_PN_USER_CLICKED_OK = "NIMBLESTANDARD::PN_USER_CLICKED_OK"; - public static final String EVENT_PN_USER_OPT_IN = "NIMBLESTANDARD::PN_USER_OPT_IN"; - public static final String EVENT_REFERRERID_RECEIVED = "NIMBLESTANDARD::REFERRER_ID_RECEIVED"; - public static final String EVENT_SESSION_END = "NIMBLESTANDARD::SESSION_END"; - public static final String EVENT_SESSION_START = "NIMBLESTANDARD::SESSION_START"; - public static final String EVENT_SESSION_TIME = "NIMBLESTANDARD::SESSION_TIME"; - public static final String EVENT_TUTORIAL_COMPLETE = "NIMBLESTANDARD::TUTORIAL_COMPLETE"; - public static final String EVENT_USER_REGISTERED = "NIMBLESTANDARD::USER_REGISTERED"; - public static final String EVENT_USER_TRACKING_OPTOUT = "NIMBLESTANDARD::USER_TRACKING_OPTOUT"; - public static final String KEY_DURATION = "NIMBLESTANDARD::KEY_DURATION"; - public static final String KEY_GAMEPLAY_DURATION = "NIMBLESTANDARD::KEY_GAMEPLAY_DURATION"; - public static final String KEY_MTX_CURRENCY = "NIMBLESTANDARD::KEY_MTX_CURRENCY"; - public static final String KEY_MTX_PRICE = "NIMBLESTANDARD::KEY_MTX_PRICE"; - public static final String KEY_MTX_SELLID = "NIMBLESTANDARD::KEY_MTX_SELLID"; - public static final String KEY_PN_DATE_OF_BIRTH = "NIMBLESTANDARD::KEY_PN_DATE_OF_BIRTH"; - public static final String KEY_PN_DEVICE_ID = "NIMBLESTANDARD::KEY_PN_DEVICE_ID"; - public static final String KEY_PN_DISABLED_FLAG = "NIMBLESTANDARD::KEY_PN_DISABLED_FLAG"; - public static final String KEY_PN_MESSAGE_ID = "NIMBLESTANDARD::KEY_PN_MESSAGE_ID"; - public static final String KEY_PN_MESSAGE_TYPE = "NIMBLESTANDARD::KEY_PN_MESSAGE_TYPE"; - public static final String KEY_REFERRER_ID = "NIMBLESTANDARD::KEY_REFERRER_ID"; - public static final String KEY_USERNAME = "NIMBLESTANDARD::KEY_USERNAME"; - public static final String KEY_USER_LEVEL = "NIMBLESTANDARD::KEY_USER_LEVEL"; - public static final String NIMBLE_TRACKING_ATTRIBUTE_PROGRESSION_LEVEL = "NIMBLESTANDARD::ATTRIBUTE_PROGRESSION_LEVEL"; - public static final String NIMBLE_TRACKING_DEFAULTENABLE = "com.ea.nimble.tracking.defaultEnable"; - public static final String NIMBLE_TRACKING_EVENT_IDENTITY_LOGIN = "NIMBLESTANDARD::IDENTITY_LOGIN"; - public static final String NIMBLE_TRACKING_EVENT_IDENTITY_LOGOUT = "NIMBLESTANDARD::IDENTITY_LOGOUT"; - public static final String NIMBLE_TRACKING_EVENT_IDENTITY_MIGRATION = "NIMBLESTANDARD::IDENTITY_MIGRATION"; - public static final String NIMBLE_TRACKING_EVENT_IDENTITY_MIGRATION_STARTED = "NIMBLESTANDARD::IDENTITY_MIGRATION_STARTED"; - public static final String NIMBLE_TRACKING_KEY_IDENTITY_MAP_SOURCE = "NIMBLESTANDARD::KEY_IDENTITY_SOURCE"; - public static final String NIMBLE_TRACKING_KEY_IDENTITY_MAP_TARGET = "NIMBLESTANDARD::KEY_IDENTITY_TARGET"; - public static final String NIMBLE_TRACKING_KEY_IDENTITY_PIDMAP_LOGIN = "NIMBLESTANDARD::KEY_IDENTITY_PIDMAP_LOGIN"; - public static final String NIMBLE_TRACKING_KEY_IDENTITY_PIDMAP_LOGOUT = "NIMBLESTANDARD::KEY_IDENTITY_PIDMAP_LOGOUT"; - public static final String NIMBLE_TRACKING_KEY_MIGRATION_GAME_TRIGGERED = "NIMBLESTANDARD::KEY_MIGRATION_GAME_TRIGGERED"; - public static final String NIMBLE_TRACKING_KEY_PN_MESSAGEID = "NIMBLESTANDARD::KEY_PN_MESSAGE_ID"; - private static final String SESSION_END_EVENT_PREFIX = "SESSION_END"; - private static final String SESSION_RESUME_EVENT_PREFIX = "APPRESUME_"; - private static final String SESSION_START_EVENT_PREFIX = "APPSTART_"; - private static final String STANDARD_EVENT_PREFIX = "NIMBLESTANDARD::"; - - public static ITracking getComponent() { - return (ITracking)((Object)Base.getComponent(COMPONENT_ID)); - } - - private static void initialize() { - Base.registerComponent(new TrackingWrangler(), COMPONENT_ID); - } - - public static boolean isNimbleStandardEvent(String string2) { - if (string2 != null) return string2.startsWith(STANDARD_EVENT_PREFIX); - return false; - } - - public static boolean isSessionEndEvent(String string2) { - if (string2 != null) return string2.startsWith(SESSION_END_EVENT_PREFIX, STANDARD_EVENT_PREFIX.length()); - return false; - } - - public static boolean isSessionStartEvent(String string2) { - if (string2 == null) { - return false; - } - if (string2.startsWith(SESSION_START_EVENT_PREFIX, STANDARD_EVENT_PREFIX.length())) return true; - if (string2.equals(EVENT_SESSION_START)) return true; - if (!string2.startsWith(SESSION_RESUME_EVENT_PREFIX, STANDARD_EVENT_PREFIX.length())) return false; - return true; - } - - public static class Event { - Map parameters; - Date timestamp; - String type; - } -} - diff --git a/app/src/main/java/com/ea/nimble/tracking/TrackingBaseSessionObject.java b/app/src/main/java/com/ea/nimble/tracking/TrackingBaseSessionObject.java deleted file mode 100644 index 83b149c..0000000 --- a/app/src/main/java/com/ea/nimble/tracking/TrackingBaseSessionObject.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Decompiled with CFR 0.152. - */ -package com.ea.nimble.tracking; - -import java.io.Externalizable; -import java.io.IOException; -import java.io.ObjectInput; -import java.io.ObjectOutput; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -public class TrackingBaseSessionObject -implements Externalizable { - private static final long serialVersionUID = 1L; - public List> events = new ArrayList>(); - public int repostCount; - public Map sessionData; - - public TrackingBaseSessionObject() { - this.sessionData = new HashMap(); - this.repostCount = 0; - } - - public TrackingBaseSessionObject(Map map) { - this.sessionData = map; - this.repostCount = 0; - } - - public int countOfEvents() { - if (this.events != null) return this.events.size(); - return 0; - } - - @Override - public void readExternal(ObjectInput objectInput) throws IOException, ClassNotFoundException { - this.events = (List)objectInput.readObject(); - this.sessionData = (Map)objectInput.readObject(); - this.repostCount = objectInput.readInt(); - } - - @Override - public void writeExternal(ObjectOutput objectOutput) throws IOException { - objectOutput.writeObject(this.events); - objectOutput.writeObject(this.sessionData); - objectOutput.writeInt(this.repostCount); - } -} - diff --git a/app/src/main/java/com/ea/nimble/tracking/TrackingEventWrangler.java b/app/src/main/java/com/ea/nimble/tracking/TrackingEventWrangler.java deleted file mode 100644 index f34e291..0000000 --- a/app/src/main/java/com/ea/nimble/tracking/TrackingEventWrangler.java +++ /dev/null @@ -1,199 +0,0 @@ -/* - * Decompiled with CFR 0.152. - * - * Could not load the following classes: - * android.content.Intent - * android.os.Bundle - */ -package com.ea.nimble.tracking; - -import android.content.Intent; -import android.os.Bundle; - -import com.ea.ironmonkey.devmenu.util.Observer; -import com.ea.nimble.ApplicationEnvironment; -import com.ea.nimble.ApplicationLifecycle; -import com.ea.nimble.Base; -import com.ea.nimble.Component; -import com.ea.nimble.IApplicationLifecycle; -import com.ea.nimble.Log; -import com.ea.nimble.LogSource; -import com.ea.nimble.SynergyEnvironment; - -import java.util.HashMap; -import java.util.Locale; -import java.util.Map; - -class TrackingEventWrangler -extends Component -implements IApplicationLifecycle.ApplicationLifecycleCallbacks, -LogSource { - private static final String APP_VERSION_PERSISTENCE_ID = "applicationBundleVersion"; - public static final String COMPONENT_ID = "com.ea.nimble.tracking.eventwrangler"; - private Long m_sessionStartTimestamp; - - private TrackingEventWrangler() { - } - - private void addPushTNGTrackingParams(Bundle bundle, Map map) { - if (bundle == null) return; - if (bundle.isEmpty()) return; - if (bundle.containsKey("pushId")) { - map.put("NIMBLESTANDARD::KEY_PN_MESSAGE_ID", bundle.getString("pushId")); - } - if (bundle.containsKey("pnType")) { - map.put("NIMBLESTANDARD::KEY_PN_MESSAGE_TYPE", bundle.getString("pnType")); - } - if (map == null) return; - if (map.isEmpty()) return; - map.put("NIMBLESTANDARD::KEY_PN_DEVICE_ID", SynergyEnvironment.getComponent().getEADeviceId()); - } - - private static void initialize() { - Base.registerComponent(new TrackingEventWrangler(), COMPONENT_ID); - } - - private void logAndCheckEvent(String string2) { - this.logAndCheckEvent(string2, null); - } - - private void logAndCheckEvent(String string2, Map map) { - Object object; - if (Tracking.isSessionStartEvent(string2)) { - if (this.m_sessionStartTimestamp != null) { - Log.Helper.LOGE(this, "Pre-existing session start timestamp found while logging new session start! Overwriting previous session start timestamp."); - } else { - Log.Helper.LOGD(this, "Marking session start time."); - } - this.m_sessionStartTimestamp = System.currentTimeMillis(); - } else if (Tracking.isSessionEndEvent(string2)) { - if (this.m_sessionStartTimestamp == null) { - Log.Helper.LOGE(this, "No session start timestamp found while logging new session end! Skip logging 'session time' event."); - } else { - double d2 = (double)(System.currentTimeMillis() - this.m_sessionStartTimestamp) / 1000.0; - object = String.format(Locale.US, "%.0f", d2); - Log.Helper.LOGD(this, "Logging session time, %s seconds.", object); - HashMap hashMap = new HashMap(); - hashMap.put("NIMBLESTANDARD::KEY_DURATION", (String)object); - this.logAndCheckEvent("NIMBLESTANDARD::SESSION_TIME", hashMap); - this.m_sessionStartTimestamp = null; - } - } - ITracking component = (ITracking) Base.getComponent("com.ea.nimble.tracking"); - if (component == null) return; - component.logEvent(string2, map); - } - - @Override - public void cleanup() { - ApplicationLifecycle.getComponent().unregisterApplicationLifecycleCallbacks(this); - } - - @Override - public String getComponentId() { - return COMPONENT_ID; - } - - @Override - public String getLogSourceTitle() { - return "Tracking"; - } - - /* - * Unable to fully structure code - */ - @Override - public void onApplicationLaunch(Intent var1_1) { - Observer.onCallingMethod(Observer.Method.HARD_TO_RECOVER_LOGIC, Observer.Method.VERY_SUSPICIOUS_METHOD); - /* - EASPDataLoader.EASPDataBuffer var2_3; - Object var3_6; - block10: { - block9: { - block8: { - if (var1_1.getData() != null) { - this.logAndCheckEvent("NIMBLESTANDARD::APPSTART_FROMURL"); - return; - } - if (var1_1.getStringExtra("PushNotification") != null || ApplicationEnvironment.getComponent().getApplicationContext().getSharedPreferences("PushNotification", 0).getString("PushNotification", null) != null) { - Log.Helper.LOGI(this, "Awesome. PN launched me"); - var2_2 = new HashMap(); - this.addPushTNGTrackingParams(var1_1.getExtras(), var2_2); - if (var2_2.isEmpty()) { - this.logAndCheckEvent("NIMBLESTANDARD::APPSTART_FROMPUSH"); - return; - } - this.logAndCheckEvent("NIMBLESTANDARD::APPSTART_FROMPUSH", var2_2); - return; - } - var1_1 = PersistenceService.getPersistenceForNimbleComponent("com.ea.nimble.tracking.eventwrangler", Persistence.Storage.CACHE); - var2_3 = var1_1.getStringValue("applicationBundleVersion"); - var3_6 = ApplicationEnvironment.getComponent().getApplicationVersion(); - Log.Helper.LOGD(this, "Current app version, %s. Cached app version, %s", var3_6, var2_3); - if (var2_3 != null) break block10; - var1_1.setValue("applicationBundleVersion", (Serializable)var3_6); - var1_1 = null; - try { - var1_1 = var2_3 = EASPDataLoader.loadDatFile(EASPDataLoader.getTrackingDatFilePath()); -lbl22: - // 3 sources - - while (var1_1 != null) { - break block8; - } - break block9; - } - catch (FileNotFoundException var2_4) { - Log.Helper.LOGD(this, "No EASP tracking file."); - } - catch (Exception var2_5) { - Log.Helper.LOGE(this, "Exception loading EASP tracking file."); - ** GOTO lbl22 - } - } - Log.Helper.LOGD(this, "EASP tracking file found. Counting as app update."); - this.logAndCheckEvent("NIMBLESTANDARD::APPSTART_AFTERUPGRADE"); - return; - } - this.logAndCheckEvent("NIMBLESTANDARD::APPSTART_AFTERINSTALL"); - return; - } - if (!var2_3.equals(var3_6)) { - var1_1.setValue("applicationBundleVersion", (Serializable)var3_6); - this.logAndCheckEvent("NIMBLESTANDARD::APPSTART_AFTERUPGRADE"); - return; - } - this.logAndCheckEvent("NIMBLESTANDARD::APPSTART_NORMAL"); - - */ - } - - @Override - public void onApplicationQuit() { - this.logAndCheckEvent("NIMBLESTANDARD::SESSION_END"); - } - - @Override - public void onApplicationResume() { - if (ApplicationEnvironment.getCurrentActivity().getIntent().getData() != null) { - this.logAndCheckEvent("NIMBLESTANDARD::APPRESUME_FROMURL"); - return; - } - if (ApplicationEnvironment.getComponent().getApplicationContext().getSharedPreferences("PushNotification", 0).getString("PushNotification", null) != null) { - this.logAndCheckEvent("NIMBLESTANDARD::APPRESUME_FROMPUSH"); - return; - } - this.logAndCheckEvent("NIMBLESTANDARD::SESSION_START"); - } - - @Override - public void onApplicationSuspend() { - this.logAndCheckEvent("NIMBLESTANDARD::SESSION_END"); - } - - @Override - public void restore() { - ApplicationLifecycle.getComponent().registerApplicationLifecycleCallbacks(this); - } -} - diff --git a/app/src/main/java/com/ea/nimble/tracking/TrackingS2S.java b/app/src/main/java/com/ea/nimble/tracking/TrackingS2S.java deleted file mode 100644 index 517f831..0000000 --- a/app/src/main/java/com/ea/nimble/tracking/TrackingS2S.java +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Decompiled with CFR 0.152. - */ -package com.ea.nimble.tracking; - -import com.ea.nimble.tracking.NimbleTrackingS2SComponent; - -public class TrackingS2S { - public static final String EVENT_CUSTOM = "SYNERGYS2S::CUSTOM"; - - private static void initialize() { - NimbleTrackingS2SComponent.initialize(); - } -} - diff --git a/app/src/main/java/com/ea/nimble/tracking/TrackingSynergy.java b/app/src/main/java/com/ea/nimble/tracking/TrackingSynergy.java deleted file mode 100644 index 1ebdd90..0000000 --- a/app/src/main/java/com/ea/nimble/tracking/TrackingSynergy.java +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Decompiled with CFR 0.152. - */ -package com.ea.nimble.tracking; - -import com.ea.nimble.tracking.NimbleTrackingSynergyComponent; - -public class TrackingSynergy { - public static final String EVENT_CUSTOM = "SYNERGYTRACKING::CUSTOM"; - - private static void initialize() { - NimbleTrackingSynergyComponent.initialize(); - } -} - diff --git a/app/src/main/java/com/ea/nimble/tracking/TrackingWrangler.java b/app/src/main/java/com/ea/nimble/tracking/TrackingWrangler.java deleted file mode 100644 index 88ea339..0000000 --- a/app/src/main/java/com/ea/nimble/tracking/TrackingWrangler.java +++ /dev/null @@ -1,136 +0,0 @@ -package com.ea.nimble.tracking; - -import com.ea.nimble.ApplicationEnvironment; -import com.ea.nimble.Base; -import com.ea.nimble.Component; -import com.ea.nimble.Log; -import com.ea.nimble.LogSource; - -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; - -public class TrackingWrangler extends Component implements LogSource, ITracking { - private ITracking[] m_trackingComponents; - - public TrackingWrangler() { - m_trackingComponents = new ITracking[10]; - Arrays.fill(m_trackingComponents, new ITracking() { - @Override - public void addCustomSessionData(String var1, String var2) { - - } - - @Override - public void clearCustomSessionData() { - - } - - @Override - public boolean getEnable() { - return false; - } - - @Override - public void logEvent(String var1, Map var2) { - - } - - @Override - public void setEnable(boolean var1) { - - } - - @Override - public void setTrackingAttribute(String var1, String var2) { - - } - }); - } - - static TrackingWrangler getComponent() { - return (TrackingWrangler)Tracking.getComponent(); - } - - @Override - public void addCustomSessionData(String string2, String string3) { - ITracking[] iTrackingArray = m_trackingComponents; - for(ITracking tracking : iTrackingArray){ - tracking.addCustomSessionData(string2, string3); - } - } - - @Override - public void clearCustomSessionData() { - ITracking[] iTrackingArray = this.m_trackingComponents; - for(ITracking tracking : iTrackingArray){ - tracking.clearCustomSessionData(); - } - } - - @Override - public String getComponentId() { - return "com.ea.nimble.tracking"; - } - - @Override - public boolean getEnable() { - return false; - } - - @Override - public String getLogSourceTitle() { - return "Tracking"; - } - - @Override - public void logEvent(String string2, Map map) { - Log.Helper.LOGD(this, "Logging event, " + string2); - } - - @Override - public void restore() { - Object object = Base.getComponentList("com.ea.nimble.trackingimpl"); - this.m_trackingComponents = new ITracking[((Component[])object).length]; - int n2 = 0; - while (true) { - if (n2 >= ((Component[])object).length) { - object = ReferrerReceiver.getReferrerId(ApplicationEnvironment.getComponent().getApplicationContext()); - if (object == null) return; - if (((String)object).isEmpty()) return; - Log.Helper.LOGI(this, "Received a referrer id that was been sent while Nimble was not active; referrerId = " + (String)object); - HashMap hashMap = new HashMap(); - hashMap.put("NIMBLESTANDARD::KEY_REFERRER_ID", (String)object); - this.logEvent("NIMBLESTANDARD::REFERRER_ID_RECEIVED", hashMap); - ReferrerReceiver.clearReferrerId(ApplicationEnvironment.getComponent().getApplicationContext()); - return; - } - ++n2; - } - } - - @Override - public void setEnable(boolean bl2) { - StringBuilder stringBuilder = new StringBuilder(); - Object object = bl2 ? "ENABLE" : "DISABLE"; - Log.Helper.LOGD(this, stringBuilder.append((String)object).append(" tracking").toString()); - object = this.m_trackingComponents; - int n2 = ((ITracking[])object).length; - int n3 = 0; - while (n3 < n2) { - ++n3; - } - } - - @Override - public void setTrackingAttribute(String string2, String string3) { - ITracking[] iTrackingArray = this.m_trackingComponents; - int n2 = iTrackingArray.length; - int n3 = 0; - while (n3 < n2) { - iTrackingArray[n3].setTrackingAttribute(string2, string3); - ++n3; - } - } -} -