Add decompiled APK source code (JADX)

- 28,932 files
- Full Java source code
- Smali files
- Resources

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
2026-02-18 14:52:23 -08:00
parent cc210a65ea
commit f9d20bb3fc
26991 changed files with 2541449 additions and 0 deletions

View File

@@ -0,0 +1,19 @@
package com.ea.nimble.pushtng;
import com.ea.eadp.pushnotification.listeners.IPushListener;
import java.util.Date;
/* loaded from: classes2.dex */
public interface IPushNotification {
String getDisableStatus();
boolean getRegistrationStatus();
void sendPendingTrackingRequests();
void startAsDisabled(String str, Date date, String str2, IPushListener iPushListener);
void startWithDefaults(String str, Date date, IPushListener iPushListener);
void updateToken(String str);
}

View File

@@ -0,0 +1,162 @@
package com.ea.nimble.pushtng;
import com.ea.eadp.http.models.HttpRequest;
import com.ea.eadp.http.models.HttpRequestListener;
import com.ea.eadp.http.models.HttpResponse;
import com.ea.nimble.INetwork;
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 com.ironsource.nb;
import java.io.IOException;
import java.net.URL;
import java.nio.charset.StandardCharsets;
import java.util.HashMap;
/* loaded from: classes2.dex */
public class NimbleAndroidHttpRequest implements HttpRequest {
private static final String LOG_TAG = "NimbleAndroidHttpRequest";
private String body;
private final HashMap<String, String> headers;
private final INetwork nimbleNetwork;
private URL resource;
public NimbleAndroidHttpRequest() throws IOException {
try {
this.nimbleNetwork = Network.getComponent();
this.headers = new HashMap<>();
} catch (Exception e) {
Log.Helper.LOGES(LOG_TAG, e.toString(), new Object[0]);
throw new IOException("NimbleNetwork unavailble at this time.");
}
}
@Override // com.ea.eadp.http.models.HttpRequest
public HttpRequest setResource(URL url) {
Log.Helper.LOGPUBLICFUNC(this);
this.resource = url;
return this;
}
@Override // com.ea.eadp.http.models.HttpRequest
public URL getResource() {
Log.Helper.LOGPUBLICFUNC(this);
return this.resource;
}
@Override // com.ea.eadp.http.models.HttpRequest
public HttpRequest setHeader(String str, String str2) {
Log.Helper.LOGPUBLICFUNC(this);
this.headers.put(str, str2);
return this;
}
@Override // com.ea.eadp.http.models.HttpRequest
public String getValueForHeader(String str) {
Log.Helper.LOGPUBLICFUNC(this);
return this.headers.get(str);
}
@Override // com.ea.eadp.http.models.HttpRequest
public HttpRequest setBody(String str) {
Log.Helper.LOGPUBLICFUNC(this);
this.body = str;
setHeader("Content-Type", "application/x-www-form-urlencoded");
return this;
}
@Override // com.ea.eadp.http.models.HttpRequest
public HttpRequest setBody(String str, String str2) {
Log.Helper.LOGPUBLICFUNC(this);
return setBody(str);
}
@Override // com.ea.eadp.http.models.HttpRequest
public HttpRequest setJsonBody(String str) {
Log.Helper.LOGPUBLICFUNC(this);
this.body = str;
setHeader("Content-Type", nb.L);
return this;
}
@Override // com.ea.eadp.http.models.HttpRequest
public HttpRequest setJsonBody(String str, String str2) {
Log.Helper.LOGPUBLICFUNC(this);
return setJsonBody(str);
}
@Override // com.ea.eadp.http.models.HttpRequest
public HttpResponse get() {
Log.Helper.LOGPUBLICFUNC(this);
throw new UnsupportedOperationException("Synchronous communication not supported.");
}
@Override // com.ea.eadp.http.models.HttpRequest
public void getAsync(final HttpRequestListener httpRequestListener) {
Log.Helper.LOGPUBLICFUNC(this);
this.nimbleNetwork.sendGetRequest(this.resource, this.headers, new NetworkConnectionCallback() { // from class: com.ea.nimble.pushtng.NimbleAndroidHttpRequest.1
@Override // com.ea.nimble.NetworkConnectionCallback
public void callback(NetworkConnectionHandle networkConnectionHandle) {
NimbleAndroidHttpRequest.this.sendResponseCallback(networkConnectionHandle, httpRequestListener);
}
});
}
@Override // com.ea.eadp.http.models.HttpRequest
public HttpResponse post() {
Log.Helper.LOGPUBLICFUNC(this);
throw new UnsupportedOperationException("Synchronous communication not supported.");
}
@Override // com.ea.eadp.http.models.HttpRequest
public void postAsync(final HttpRequestListener httpRequestListener) {
Log.Helper.LOGPUBLICFUNC(this);
this.nimbleNetwork.sendPostRequest(this.resource, this.headers, this.body.getBytes(StandardCharsets.UTF_8), new NetworkConnectionCallback() { // from class: com.ea.nimble.pushtng.NimbleAndroidHttpRequest.2
@Override // com.ea.nimble.NetworkConnectionCallback
public void callback(NetworkConnectionHandle networkConnectionHandle) {
NimbleAndroidHttpRequest.this.sendResponseCallback(networkConnectionHandle, httpRequestListener);
}
});
}
@Override // com.ea.eadp.http.models.HttpRequest
public HttpResponse put() {
Log.Helper.LOGPUBLICFUNC(this);
throw new UnsupportedOperationException("Synchronous communication not supported.");
}
@Override // com.ea.eadp.http.models.HttpRequest
public void putAsync(HttpRequestListener httpRequestListener) {
Log.Helper.LOGPUBLICFUNC(this);
throw new UnsupportedOperationException("Put requests not supported.");
}
@Override // com.ea.eadp.http.models.HttpRequest
public HttpResponse delete() {
Log.Helper.LOGPUBLICFUNC(this);
throw new UnsupportedOperationException("Synchronous communication not supported.");
}
@Override // com.ea.eadp.http.models.HttpRequest
public void deleteAsync(HttpRequestListener httpRequestListener) {
Log.Helper.LOGPUBLICFUNC(this);
throw new UnsupportedOperationException("Delete requests not supported.");
}
/* JADX INFO: Access modifiers changed from: private */
public void sendResponseCallback(NetworkConnectionHandle networkConnectionHandle, HttpRequestListener httpRequestListener) {
NimbleAndroidHttpResponse nimbleAndroidHttpResponse = new NimbleAndroidHttpResponse();
nimbleAndroidHttpResponse.setCode(networkConnectionHandle.getResponse().getStatusCode());
URL url = networkConnectionHandle.getResponse().getUrl();
nimbleAndroidHttpResponse.setUrl(url == null ? null : url.toString());
try {
nimbleAndroidHttpResponse.setBody(Utility.readStringFromStream(networkConnectionHandle.getResponse().getDataStream()));
} catch (IOException e) {
Log.Helper.LOGES(LOG_TAG, "IOException reading response body: " + e.toString(), new Object[0]);
}
nimbleAndroidHttpResponse.setHeaders(networkConnectionHandle.getResponse().getHeaders());
httpRequestListener.onComplete(nimbleAndroidHttpResponse);
}
}

View File

@@ -0,0 +1,74 @@
package com.ea.nimble.pushtng;
import com.ea.eadp.http.models.HttpResponse;
import com.ea.nimble.Log;
import java.util.Map;
/* loaded from: classes2.dex */
public class NimbleAndroidHttpResponse implements HttpResponse {
private String body;
private int code;
private Map<String, String> headers;
private String message;
private String url;
@Override // com.ea.eadp.http.models.HttpResponse
public String getUrl() {
Log.Helper.LOGPUBLICFUNC(this);
return this.url;
}
@Override // com.ea.eadp.http.models.HttpResponse
public void setUrl(String str) {
Log.Helper.LOGPUBLICFUNC(this);
this.url = str;
}
@Override // com.ea.eadp.http.models.HttpResponse
public int getCode() {
Log.Helper.LOGPUBLICFUNC(this);
return this.code;
}
@Override // com.ea.eadp.http.models.HttpResponse
public void setCode(int i) {
Log.Helper.LOGPUBLICFUNC(this);
this.code = i;
}
@Override // com.ea.eadp.http.models.HttpResponse
public String getMessage() {
Log.Helper.LOGPUBLICFUNC(this);
return this.message;
}
@Override // com.ea.eadp.http.models.HttpResponse
public void setMessage(String str) {
Log.Helper.LOGPUBLICFUNC(this);
this.message = str;
}
@Override // com.ea.eadp.http.models.HttpResponse
public String getBody() {
Log.Helper.LOGPUBLICFUNC(this);
return this.body;
}
@Override // com.ea.eadp.http.models.HttpResponse
public void setBody(String str) {
Log.Helper.LOGPUBLICFUNC(this);
this.body = str;
}
@Override // com.ea.eadp.http.models.HttpResponse
public Map<String, String> getHeaders() {
Log.Helper.LOGPUBLICFUNC(this);
return this.headers;
}
@Override // com.ea.eadp.http.models.HttpResponse
public void setHeaders(Map<String, String> map) {
Log.Helper.LOGPUBLICFUNC(this);
this.headers = map;
}
}

View File

@@ -0,0 +1,18 @@
package com.ea.nimble.pushtng;
import com.ea.eadp.http.models.HttpRequest;
import com.ea.eadp.http.services.HttpService;
import com.ea.nimble.Log;
import java.io.IOException;
import java.net.URL;
/* loaded from: classes2.dex */
public class NimbleAndroidHttpService implements HttpService {
@Override // com.ea.eadp.http.services.HttpService
public HttpRequest getResource(String str) throws IOException {
Log.Helper.LOGFUNC(this);
NimbleAndroidHttpRequest nimbleAndroidHttpRequest = new NimbleAndroidHttpRequest();
nimbleAndroidHttpRequest.setResource(new URL(str));
return nimbleAndroidHttpRequest;
}
}

View File

@@ -0,0 +1,19 @@
package com.ea.nimble.pushtng;
import com.ea.eadp.deviceid.DeviceIdService;
import com.ea.nimble.ISynergyEnvironment;
import com.ea.nimble.Log;
import com.ea.nimble.SynergyEnvironment;
/* loaded from: classes2.dex */
class NimbleDeviceIdService implements DeviceIdService {
@Override // com.ea.eadp.deviceid.DeviceIdService
public String getDeviceId() {
Log.Helper.LOGFUNC(this);
ISynergyEnvironment component = SynergyEnvironment.getComponent();
if (component != null) {
return component.getEADeviceId();
}
return null;
}
}

View File

@@ -0,0 +1,85 @@
package com.ea.nimble.pushtng;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.os.Bundle;
import com.ea.eadp.http.services.HttpService;
import com.ea.eadp.pushnotification.forwarding.FCMMessageService;
import com.ea.eadp.pushnotification.forwarding.PushBroadcastForwarder;
import com.ea.nimble.ApplicationEnvironment;
import com.ea.nimble.Log;
import com.ea.nimble.NimbleApplicationConfiguration;
import com.ea.nimble.tracking.Tracking;
import java.io.File;
import java.util.HashMap;
/* loaded from: classes2.dex */
public class NimblePushTNGBroadcastForwarder extends PushBroadcastForwarder {
@Override // com.ea.eadp.pushnotification.forwarding.PushBroadcastForwarder
public void handleNewPushNotification(Context context, Bundle bundle) {
Log.Helper.LOGFUNC(this);
String string = bundle.getString(FCMMessageService.PushIntentExtraKeys.COLLAPSE_KEY);
if (string != null) {
String replace = string.replace(File.pathSeparator, "-").replace(File.separator, "_");
context.getApplicationContext().getSharedPreferences("PushTNGStacking_" + replace, 0).edit().clear().apply();
}
if (bundle.getBoolean(NimblePushTNGIntentService.EXTRA_IS_DELETE_INTENT)) {
return;
}
String string2 = bundle.getString(FCMMessageService.PushIntentExtraKeys.PUSH_ID);
String string3 = bundle.getString(FCMMessageService.PushIntentExtraKeys.PN_TYPE);
if (string2 != null && string3 != null) {
HashMap hashMap = new HashMap();
hashMap.put(PushNotification.KEY_TRACKING_TYPE, Tracking.EVENT_PN_SHOWN_TO_USER);
hashMap.put("NIMBLESTANDARD::KEY_PN_MESSAGE_ID", string2);
hashMap.put(Tracking.KEY_PN_MESSAGE_TYPE, string3);
PushNotificationImpl.persistTrackingData(context, hashMap, string2 + "_" + Tracking.EVENT_PN_SHOWN_TO_USER);
}
if (ApplicationEnvironment.isMainApplicationActive()) {
try {
showMessage(bundle);
IPushNotification component = PushNotification.getComponent();
if (component != null) {
component.sendPendingTrackingRequests();
} else {
Log.Helper.LOGE(this, "Couldn't find Push Notification component with Base, unable to send pending tracking requests", new Object[0]);
}
return;
} catch (AssertionError unused) {
return;
}
}
super.handleNewPushNotification(context, bundle);
}
public void showMessage(Bundle bundle) {
Log.Helper.LOGFUNC(this);
}
@Override // com.ea.eadp.pushnotification.forwarding.PushBroadcastForwarder
public String getPushTargetActivity(Context context) {
Intent launchIntentForPackage;
ComponentName resolveActivity;
Log.Helper.LOGFUNC(this);
int configValueAsInt = NimbleApplicationConfiguration.getConfigValueAsInt("com.ea.nimble.pushtng.notification.activity.name");
if (configValueAsInt != 0) {
return context.getResources().getString(configValueAsInt);
}
Log.Helper.LOGIS("PushTNG", "Could not locate target activity. PN delivered to launch activity", new Object[0]);
Context applicationContext = context.getApplicationContext();
PackageManager packageManager = applicationContext.getPackageManager();
if (packageManager != null && (launchIntentForPackage = packageManager.getLaunchIntentForPackage(applicationContext.getPackageName())) != null && (resolveActivity = launchIntentForPackage.resolveActivity(packageManager)) != null) {
return resolveActivity.getClassName();
}
Log.Helper.LOGE(this, "Null Pointer found in pushActivityName generation, unable to get class name for push activity", new Object[0]);
return "";
}
@Override // com.ea.eadp.pushnotification.forwarding.PushBroadcastForwarder
public HttpService getHttpService() {
Log.Helper.LOGFUNC(this);
return new NimbleAndroidHttpService();
}
}

View File

@@ -0,0 +1,15 @@
package com.ea.nimble.pushtng;
import android.annotation.SuppressLint;
import com.ea.eadp.pushnotification.forwarding.FCMMessageReceiver;
import com.ea.nimble.Log;
@SuppressLint({"MissingFirebaseInstanceTokenRefresh"})
/* loaded from: classes2.dex */
public class NimblePushTNGBroadcastReceiver extends FCMMessageReceiver {
@Override // com.ea.eadp.pushnotification.forwarding.FCMMessageReceiver
public String getIntentServiceName() {
Log.Helper.LOGFUNC(this);
return NimblePushTNGIntentService.class.getName();
}
}

View File

@@ -0,0 +1,111 @@
package com.ea.nimble.pushtng;
import android.app.PendingIntent;
import android.content.ComponentName;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.res.Resources;
import android.os.Bundle;
import androidx.core.app.NotificationCompat;
import com.ea.eadp.http.services.HttpService;
import com.ea.eadp.pushnotification.forwarding.FCMMessageService;
import com.ea.nimble.ApplicationEnvironment;
import com.ea.nimble.Log;
import com.ea.nimble.tracking.Tracking;
import com.facebook.internal.NativeProtocol;
import java.io.File;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Vector;
/* loaded from: classes2.dex */
public class NimblePushTNGIntentService extends FCMMessageService {
private static final String DO_NOT_COLLAPSE = "do_not_collapse";
public static final String EXTRA_IS_DELETE_INTENT = "IsDeleteIntent";
private static final String KEY_PUSH_COUNT = "push_count";
private static final String KEY_PUSH_TEXT_LIST = "push_text_list";
@Override // com.ea.eadp.pushnotification.forwarding.FCMMessageService
public void onHandleMessage(Intent intent) {
Log.Helper.LOGFUNC(this);
Bundle extras = intent.getExtras();
if (extras == null) {
Log.Helper.LOGE(this, "NimblePushTNGIntentService onHandleMessage failed! Extras from intent were null, unable to process message.", new Object[0]);
return;
}
String string = extras.getString(FCMMessageService.PushIntentExtraKeys.PUSH_ID);
String string2 = extras.getString(FCMMessageService.PushIntentExtraKeys.PN_TYPE);
if (string != null && string2 != null) {
HashMap hashMap = new HashMap();
hashMap.put(PushNotification.KEY_TRACKING_TYPE, Tracking.EVENT_PN_RECEIVED);
hashMap.put("NIMBLESTANDARD::KEY_PN_MESSAGE_ID", string);
hashMap.put(Tracking.KEY_PN_MESSAGE_TYPE, string2);
PushNotificationImpl.persistTrackingData(getApplicationContext(), hashMap, string + "_" + Tracking.EVENT_PN_RECEIVED);
}
intent.putExtra("PushNotification", "true");
super.onHandleMessage(intent);
}
@Override // com.ea.eadp.pushnotification.forwarding.FCMMessageService
public void customizeNotification(NotificationCompat.Builder builder, Bundle bundle) {
Log.Helper.LOGFUNC(this);
super.customizeNotification(builder, bundle);
String string = bundle.getString(FCMMessageService.PushIntentExtraKeys.COLLAPSE_KEY);
if (string == null || string.equalsIgnoreCase(DO_NOT_COLLAPSE)) {
return;
}
String replace = string.replace(File.pathSeparator, "-").replace(File.separator, "_");
SharedPreferences sharedPreferences = getApplicationContext().getSharedPreferences("PushTNGStacking_" + replace, 0);
int i = sharedPreferences.getInt(KEY_PUSH_COUNT, 0);
Vector vector = new Vector();
for (int i2 = 0; i2 < i; i2++) {
String string2 = sharedPreferences.getString(KEY_PUSH_TEXT_LIST + i2, null);
if (string2 != null) {
vector.add(string2);
}
}
int i3 = i + 1;
vector.add(bundle.getString(FCMMessageService.PushIntentExtraKeys.ALERT));
if (i3 > 1) {
Resources resources = getApplicationContext().getResources();
String packageName = getApplicationContext().getPackageName();
NotificationCompat.InboxStyle inboxStyle = new NotificationCompat.InboxStyle();
Iterator it = vector.iterator();
while (it.hasNext()) {
inboxStyle.addLine((CharSequence) it.next());
}
CharSequence charSequence = getApplicationContext().getResources().getString(resources.getIdentifier(NativeProtocol.BRIDGE_ARG_APP_NAME_STRING, "string", packageName)) + "(" + i3 + ")";
inboxStyle.setBigContentTitle(charSequence);
builder.setContentTitle(charSequence);
builder.setStyle(inboxStyle);
}
ComponentName broadcastForwarderComponent = getBroadcastForwarderComponent();
if (broadcastForwarderComponent != null) {
Intent intent = new Intent();
intent.setComponent(broadcastForwarderComponent);
intent.putExtra(EXTRA_IS_DELETE_INTENT, true);
intent.putExtra(FCMMessageService.PushIntentExtraKeys.COLLAPSE_KEY, replace);
builder.setDeleteIntent(PendingIntent.getBroadcast(getApplicationContext(), 0, intent, 335544320));
} else {
Log.Helper.LOGW(this, "Broadcast listener for action 'com.ea.eadp.pushnotification.FORWARD_AS_ORDERED_BROADCAST' was not found. Skipping setting DeleteIntent in Notification.", new Object[0]);
}
SharedPreferences.Editor edit = sharedPreferences.edit();
for (int i4 = 0; i4 < vector.size(); i4++) {
edit.putString(KEY_PUSH_TEXT_LIST + i4, (String) vector.elementAt(i4));
}
edit.putInt(KEY_PUSH_COUNT, i3);
edit.apply();
}
@Override // com.ea.eadp.pushnotification.forwarding.FCMMessageService
public boolean isInForeground() {
Log.Helper.LOGFUNC(this);
return ApplicationEnvironment.isMainApplicationActive();
}
@Override // com.ea.eadp.pushnotification.forwarding.FCMMessageService
public HttpService getHttpService() {
Log.Helper.LOGFUNC(this);
return new NimbleAndroidHttpService();
}
}

View File

@@ -0,0 +1,23 @@
package com.ea.nimble.pushtng;
import com.ea.nimble.Base;
import com.ea.nimble.Log;
/* loaded from: classes2.dex */
public class PushNotification {
public static final String COMPONENT_ID = "com.ea.nimble.pushtng";
public static final String DISABLED_REASON_GAME_SERVER = "game_server";
public static final String DISABLED_REASON_OPT_OUT = "opt_out";
public static final String DISABLED_REASON_REGISTER_FAILURE = "client_register_failure";
public static final String KEY_TRACKING_TYPE = "trackingType";
public static final String NOTIFICATION_PUSHTNG_COMPONENT_SETUP_COMPLETE = "nimble.pushtng.componentSetupComplete";
private static void initialize() {
Log.Helper.LOGFUNCS("PushNotification");
Base.registerComponent(new PushNotificationImpl(), COMPONENT_ID);
}
public static IPushNotification getComponent() {
return (IPushNotification) Base.getComponent(COMPONENT_ID);
}
}

View File

@@ -0,0 +1,401 @@
package com.ea.nimble.pushtng;
import android.annotation.TargetApi;
import android.app.Activity;
import android.app.NotificationChannel;
import android.app.NotificationManager;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import androidx.core.app.NotificationCompat;
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
import com.ea.eadp.pushnotification.listeners.IPushListener;
import com.ea.eadp.pushnotification.models.PushNotificationConfig;
import com.ea.eadp.pushnotification.services.AndroidPushService;
import com.ea.eadp.pushnotification.services.IPushService;
import com.ea.nimble.ApplicationEnvironment;
import com.ea.nimble.ApplicationLifecycle;
import com.ea.nimble.Base;
import com.ea.nimble.Component;
import com.ea.nimble.Global;
import com.ea.nimble.IApplicationLifecycle;
import com.ea.nimble.ISynergyEnvironment;
import com.ea.nimble.Log;
import com.ea.nimble.LogSource;
import com.ea.nimble.NimbleApplicationConfiguration;
import com.ea.nimble.Persistence;
import com.ea.nimble.PersistenceService;
import com.ea.nimble.SynergyEnvironment;
import com.ea.nimble.Utility;
import com.ea.nimble.tracking.ITracking;
import com.ea.nimble.tracking.Tracking;
import com.google.firebase.FirebaseApp;
import com.google.gson.Gson;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.TimeZone;
/* loaded from: classes2.dex */
public class PushNotificationImpl extends Component implements IPushNotification, LogSource, IApplicationLifecycle.ActivityLifecycleCallbacks {
private static final String NOTIFICATION_TRACKING2_LOG_EVENT = "nimble.notification.tracking2.logEvent";
private static final String PERSISTENCE_DISABLED_KEY = "disabled";
private String disableCheck;
private Boolean disabled;
private long dobFromAgeCompliance = -2147483648L;
private BroadcastReceiver m_ageListener;
private IPushService pushService;
private boolean statusCheck;
@Override // com.ea.nimble.Component
public String getComponentId() {
return PushNotification.COMPONENT_ID;
}
@Override // com.ea.nimble.LogSource
public String getLogSourceTitle() {
return "PushTNG";
}
@Override // com.ea.nimble.IApplicationLifecycle.ActivityLifecycleCallbacks
public void onActivityCreated(Activity activity, Bundle bundle) {
}
@Override // com.ea.nimble.IApplicationLifecycle.ActivityLifecycleCallbacks
public void onActivityDestroyed(Activity activity) {
}
@Override // com.ea.nimble.IApplicationLifecycle.ActivityLifecycleCallbacks
public void onActivityPaused(Activity activity) {
}
@Override // com.ea.nimble.IApplicationLifecycle.ActivityLifecycleCallbacks
public void 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.Component
public void setup() {
Log.Helper.LOGPUBLICFUNC(this);
if (FirebaseApp.initializeApp(ApplicationEnvironment.getCurrentActivity().getApplicationContext()) == null) {
Log.Helper.LOGE(this, "PushTNG failed to initialize FireBaseApp. Probably configuration is missing.", new Object[0]);
} else {
Log.Helper.LOGV(this, "PushTNG initialized FireBase app.", new Object[0]);
}
if (this.m_ageListener == null) {
BroadcastReceiver broadcastReceiver = new BroadcastReceiver() { // from class: com.ea.nimble.pushtng.PushNotificationImpl.1
@Override // android.content.BroadcastReceiver
public void onReceive(Context context, Intent intent) {
if (intent != null) {
Bundle extras = intent.getExtras();
PushNotificationImpl.this.dobFromAgeCompliance = extras.getLong("dob", -2147483648L);
if (PushNotificationImpl.this.dobFromAgeCompliance != -2147483648L) {
Log.Helper.LOGV(this, "PushTNG received AgeCompliance birthday update", new Object[0]);
}
}
}
};
this.m_ageListener = broadcastReceiver;
Utility.registerReceiver(Global.NIMBLE_NOTIFICATION_AGE_COMPLIANCE_DOB_UPDATE, broadcastReceiver);
}
}
@Override // com.ea.nimble.Component
public void restore() {
Log.Helper.LOGPUBLICFUNC(this);
sendPendingTrackingRequests();
Persistence persistenceForNimbleComponent = PersistenceService.getPersistenceForNimbleComponent(getComponentId(), Persistence.Storage.CACHE);
if (persistenceForNimbleComponent != null) {
this.disabled = (Boolean) persistenceForNimbleComponent.getValue("disabled");
}
ISynergyEnvironment component = SynergyEnvironment.getComponent();
if (component.getProductId() != null && component.getSellId() != null && component.getServerUrlWithKey(SynergyEnvironment.SERVER_URL_KEY_ENS) != null) {
onComponentSetupCompleted();
} else {
Utility.registerReceiver(SynergyEnvironment.NOTIFICATION_STARTUP_REQUESTS_FINISHED, new BroadcastReceiver() { // from class: com.ea.nimble.pushtng.PushNotificationImpl.2
@Override // android.content.BroadcastReceiver
public void onReceive(Context context, Intent intent) {
Bundle extras = intent.getExtras();
if (extras == null || !extras.getString("result").equals("1")) {
return;
}
PushNotificationImpl.this.onComponentSetupCompleted();
}
});
}
ApplicationLifecycle.getComponent().registerActivityLifecycleCallbacks(this);
}
@Override // com.ea.nimble.Component
public void cleanup() {
Log.Helper.LOGFUNC(this);
Utility.unregisterReceiver(this.m_ageListener);
this.m_ageListener = null;
ApplicationLifecycle.getComponent().unregisterActivityLifecycleCallbacks(this);
}
@Override // com.ea.nimble.IApplicationLifecycle.ActivityLifecycleCallbacks
public void onActivityResumed(Activity activity) {
sendPendingTrackingRequests();
}
/* JADX INFO: Access modifiers changed from: private */
@TargetApi(26)
public void onComponentSetupCompleted() {
String str;
Log.Helper.LOGFUNC(this);
ISynergyEnvironment component = SynergyEnvironment.getComponent();
if (component == null) {
Log.Helper.LOGE(this, "Synergy environment is null! Unable to complete component setup for PushTNG.", new Object[0]);
return;
}
String serverUrlWithKey = component.getServerUrlWithKey(SynergyEnvironment.SERVER_URL_KEY_ENS);
String productId = component.getProductId();
String sellId = component.getSellId();
if (serverUrlWithKey == null || productId == null || sellId == null) {
Log.Helper.LOGW(this, "Synergy environment startup requests finished, but data is not available", new Object[0]);
return;
}
Context applicationContext = ApplicationEnvironment.getComponent().getApplicationContext();
NimbleAndroidHttpService nimbleAndroidHttpService = new NimbleAndroidHttpService();
NimbleDeviceIdService nimbleDeviceIdService = new NimbleDeviceIdService();
NotificationManager notificationManager = (NotificationManager) applicationContext.getSystemService("notification");
if (!NimbleApplicationConfiguration.configValueExists(Global.NOTIFICATION_CHANNEL_PUSHTNG_ID_KEY)) {
if (NimbleApplicationConfiguration.configValueExists(Global.NOTIFICATION_CHANNEL_DEFAULT_NAME_KEY)) {
str = applicationContext.getResources().getString(NimbleApplicationConfiguration.getConfigValueAsInt(Global.NOTIFICATION_CHANNEL_DEFAULT_NAME_KEY));
} else {
str = "Default";
}
NotificationChannel notificationChannel = new NotificationChannel(Global.NOTIFICATION_CHANNEL_DEFAULT_ID, str, 3);
if (NimbleApplicationConfiguration.configValueExists(Global.NOTIFICATION_CHANNEL_DEFAULT_DESCRIPTION_KEY)) {
notificationChannel.setDescription(applicationContext.getResources().getString(NimbleApplicationConfiguration.getConfigValueAsInt(Global.NOTIFICATION_CHANNEL_DEFAULT_DESCRIPTION_KEY)));
}
notificationManager.createNotificationChannel(notificationChannel);
}
int configValueAsInt = NimbleApplicationConfiguration.getConfigValueAsInt("com.ea.nimble.pushtng.auth.api.key");
int configValueAsInt2 = NimbleApplicationConfiguration.getConfigValueAsInt("com.ea.nimble.pushtng.auth.api.secret");
if (configValueAsInt != 0 && configValueAsInt2 != 0) {
this.pushService = new AndroidPushService(nimbleAndroidHttpService, nimbleDeviceIdService, applicationContext, null, serverUrlWithKey, productId, sellId, applicationContext.getResources().getString(configValueAsInt), applicationContext.getResources().getString(configValueAsInt2), 0);
Utility.sendBroadcast(PushNotification.NOTIFICATION_PUSHTNG_COMPONENT_SETUP_COMPLETE);
this.pushService.sendPendingTrackingRequests();
return;
}
Log.Helper.LOGW(this, "Configuration data not loaded. Push component not initialized.", new Object[0]);
}
@Override // com.ea.nimble.pushtng.IPushNotification
public void startWithDefaults(String str, Date date, IPushListener iPushListener) {
Log.Helper.LOGPUBLICFUNC(this);
if (this.pushService == null) {
Log.Helper.LOGW(this, "Nimble Component has not yet been initialized.", new Object[0]);
if (iPushListener != null) {
iPushListener.onConnectionError(0, "Nimble Component has not yet been initialized.");
return;
}
return;
}
PushNotificationConfig pushNotificationConfig = new PushNotificationConfig();
pushNotificationConfig.setUserAlias(str);
pushNotificationConfig.setDateOfBirth(new SimpleDateFormat("yyyy-MM").format(getValidDOB(date)));
startWithConfig(pushNotificationConfig, iPushListener);
}
@Override // com.ea.nimble.pushtng.IPushNotification
public void startAsDisabled(String str, Date date, String str2, IPushListener iPushListener) {
Log.Helper.LOGPUBLICFUNC(this);
if (this.pushService == null) {
if (iPushListener != null) {
iPushListener.onConnectionError(0, "Nimble Component has not yet been initialized.");
}
} else {
PushNotificationConfig pushNotificationConfig = new PushNotificationConfig();
pushNotificationConfig.setUserAlias(str);
pushNotificationConfig.setDateOfBirth(new SimpleDateFormat("yyyy-MM").format(getValidDOB(date)));
pushNotificationConfig.setDisabled(true);
pushNotificationConfig.setDisabledReason(str2);
startWithConfig(pushNotificationConfig, iPushListener);
}
}
private void startWithConfig(final PushNotificationConfig pushNotificationConfig, final IPushListener iPushListener) {
Log.Helper.LOGFUNC(this);
final Context applicationContext = ApplicationEnvironment.getComponent().getApplicationContext();
this.pushService.setPushListener(new IPushListener() { // from class: com.ea.nimble.pushtng.PushNotificationImpl.3
@Override // com.ea.eadp.pushnotification.listeners.IPushListener
public void onTrackingSuccess(int i, String str) {
IPushListener iPushListener2 = iPushListener;
if (iPushListener2 != null) {
iPushListener2.onTrackingSuccess(i, str);
}
}
@Override // com.ea.eadp.pushnotification.listeners.IPushListener
public void onRegistrationSuccess(int i, String str) {
boolean z = false;
Log.Helper.LOGD(this, "onRegistrationSuccess: " + str, new Object[0]);
HashMap hashMap = new HashMap();
hashMap.put(Tracking.KEY_PN_DATE_OF_BIRTH, pushNotificationConfig.getDateOfBirth());
hashMap.put(Tracking.KEY_PN_DISABLED_FLAG, pushNotificationConfig.isDisabled() ? "true" : "false");
hashMap.put(PushNotification.KEY_TRACKING_TYPE, Tracking.EVENT_PN_DEVICE_REGISTERED);
PushNotificationImpl.this.disableCheck = pushNotificationConfig.isDisabled() ? pushNotificationConfig.getDisabledReason() : null;
PushNotificationImpl pushNotificationImpl = PushNotificationImpl.this;
if (i >= 200 && i < 300) {
z = true;
}
pushNotificationImpl.statusCheck = z;
PushNotificationImpl.persistTrackingData(applicationContext, hashMap, str);
if (ApplicationEnvironment.isMainApplicationRunning()) {
PushNotificationImpl.this.sendPendingTrackingRequests();
}
IPushListener iPushListener2 = iPushListener;
if (iPushListener2 != null) {
iPushListener2.onRegistrationSuccess(i, str);
}
}
@Override // com.ea.eadp.pushnotification.listeners.IPushListener
public void onGetInAppSuccess(int i, String str) {
IPushListener iPushListener2 = iPushListener;
if (iPushListener2 != null) {
iPushListener2.onGetInAppSuccess(i, str);
}
}
@Override // com.ea.eadp.pushnotification.listeners.IPushListener
public void onConnectionError(int i, String str) {
Log.Helper.LOGW(this, "onConnectionError: " + str, new Object[0]);
IPushListener iPushListener2 = iPushListener;
if (iPushListener2 != null) {
iPushListener2.onConnectionError(i, str);
}
PushNotificationImpl.this.statusCheck = false;
}
});
this.pushService.startWithConfig(pushNotificationConfig, null);
boolean isDisabled = pushNotificationConfig.isDisabled();
if ((!isDisabled || pushNotificationConfig.getDisabledReason().equals(PushNotification.DISABLED_REASON_OPT_OUT)) && !Boolean.valueOf(isDisabled).equals(this.disabled)) {
this.disabled = Boolean.valueOf(isDisabled);
HashMap hashMap = new HashMap();
hashMap.put("en", "settings");
Bundle bundle = new Bundle();
bundle.putSerializable("core", hashMap);
bundle.putString("type", "opt_in_pn");
bundle.putString("status", isDisabled ? "declined" : "accepted");
Intent intent = new Intent();
intent.setAction(NOTIFICATION_TRACKING2_LOG_EVENT);
intent.putExtras(bundle);
LocalBroadcastManager.getInstance(ApplicationEnvironment.getComponent().getApplicationContext()).sendBroadcast(intent);
Persistence persistenceForNimbleComponent = PersistenceService.getPersistenceForNimbleComponent(getComponentId(), Persistence.Storage.CACHE);
if (persistenceForNimbleComponent != null) {
persistenceForNimbleComponent.setValue("disabled", this.disabled);
}
}
}
@Override // com.ea.nimble.pushtng.IPushNotification
public void updateToken(String str) {
Log.Helper.LOGPUBLICFUNC(this);
IPushService iPushService = this.pushService;
if (iPushService != null) {
iPushService.updateToken(str);
}
}
@Override // com.ea.nimble.pushtng.IPushNotification
public boolean getRegistrationStatus() {
Log.Helper.LOGPUBLICFUNC(this);
return this.statusCheck;
}
@Override // com.ea.nimble.pushtng.IPushNotification
public String getDisableStatus() {
Log.Helper.LOGPUBLICFUNC(this);
return this.disableCheck;
}
@Override // com.ea.nimble.pushtng.IPushNotification
public void sendPendingTrackingRequests() {
Map map;
Log.Helper.LOGPUBLICFUNC(this);
SharedPreferences sharedPreferences = ApplicationEnvironment.getComponent().getApplicationContext().getSharedPreferences("PushTNGTracking", 0);
Gson gson = new Gson();
ArrayList<Map> arrayList = new ArrayList();
Iterator<String> it = sharedPreferences.getAll().keySet().iterator();
while (it.hasNext()) {
String string = sharedPreferences.getString(it.next(), null);
if (string != null && (map = (Map) gson.fromJson(string, HashMap.class)) != null && !map.isEmpty()) {
arrayList.add(map);
}
}
Object component = Base.getComponent(Tracking.COMPONENT_ID);
if (component != null) {
ITracking iTracking = (ITracking) component;
Iterator it2 = arrayList.iterator();
while (it2.hasNext()) {
HashMap hashMap = new HashMap((Map) it2.next());
String remove = hashMap.remove(PushNotification.KEY_TRACKING_TYPE);
hashMap.put(Tracking.KEY_PN_DEVICE_ID, SynergyEnvironment.getComponent().getEADeviceId());
iTracking.logEvent(remove, hashMap);
}
}
for (Map map2 : arrayList) {
String str = (String) map2.get(PushNotification.KEY_TRACKING_TYPE);
if (str.equals(Tracking.EVENT_PN_RECEIVED) || str.equals(Tracking.EVENT_PN_SHOWN_TO_USER)) {
String str2 = str.equals(Tracking.EVENT_PN_RECEIVED) ? "received" : "impression";
HashMap hashMap2 = new HashMap();
hashMap2.put("en", "message");
Bundle bundle = new Bundle();
bundle.putSerializable("core", hashMap2);
bundle.putString("type", "pn");
bundle.putString(NotificationCompat.CATEGORY_SERVICE, "aruba");
bundle.putString("status", str2);
bundle.putString("format", "pn");
bundle.putString("msg_id", (String) map2.get("NIMBLESTANDARD::KEY_PN_MESSAGE_ID"));
bundle.putString("media", (String) map2.get(Tracking.KEY_PN_MESSAGE_TYPE));
Intent intent = new Intent();
intent.setAction(NOTIFICATION_TRACKING2_LOG_EVENT);
intent.putExtras(bundle);
LocalBroadcastManager.getInstance(ApplicationEnvironment.getComponent().getApplicationContext()).sendBroadcast(intent);
}
}
SharedPreferences.Editor edit = sharedPreferences.edit();
edit.clear();
edit.apply();
}
public static void persistTrackingData(Context context, Map<String, String> map, String str) {
Log.Helper.LOGPUBLICFUNCS("PushNotificationImpl");
SharedPreferences.Editor edit = context.getApplicationContext().getSharedPreferences("PushTNGTracking", 0).edit();
edit.putString(str, new Gson().toJson(map));
edit.apply();
}
private Date getValidDOB(Date date) {
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM");
simpleDateFormat.setTimeZone(TimeZone.getTimeZone("GMT"));
if (date != null && date.getTime() != 0) {
Log.Helper.LOGV(this, "getValidDOB(): Using valid DOB from PushTNG: " + simpleDateFormat.format(date), new Object[0]);
return date;
}
if (this.dobFromAgeCompliance != -2147483648L) {
Date date2 = new Date(this.dobFromAgeCompliance * 1000);
Log.Helper.LOGV(this, "getValidDOB(): Got DOB from AgeCompliance: " + simpleDateFormat.format(date2), new Object[0]);
return date2;
}
Date date3 = new Date(0L);
Log.Helper.LOGV(this, "getValidDOB(): Default DOB to 1/1/1970: " + simpleDateFormat.format(date3), new Object[0]);
return date3;
}
}

View File

@@ -0,0 +1,7 @@
package com.ea.nimble.pushtng;
/* loaded from: classes2.dex */
public final class R {
private R() {
}
}