- Added realracing3-community.apk (71.57 MB) - Removed 32-bit support (armeabi-v7a) - Only includes arm64-v8a libraries - Decompiled source code included - Added README-community.md with analysis
86 lines
4.1 KiB
Java
86 lines
4.1 KiB
Java
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();
|
|
}
|
|
}
|