正在查看: Brevistay v5.8.2 应用的 PushTemplateReceiver.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: Brevistay v5.8.2 应用的 PushTemplateReceiver.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package com.clevertap.android.pushtemplates;
import a.a.a.o.f$;
import android.app.Notification;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.graphics.Bitmap;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.text.Html;
import android.widget.RemoteViews;
import androidx.core.app.NotificationCompat;
import androidx.core.app.RemoteInput;
import com.clevertap.android.pushtemplates.content.PendingIntentFactory;
import com.clevertap.android.sdk.CleverTapAPI;
import com.clevertap.android.sdk.CleverTapInstanceConfig;
import com.clevertap.android.sdk.Constants;
import com.clevertap.android.sdk.pushnotification.CTNotificationIntentService;
import com.clevertap.android.sdk.pushnotification.LaunchPendingIntentFactory;
import com.clevertap.android.sdk.task.CTExecutorFactory;
import com.google.android.gms.fido.fido2.api.common.UserVerificationMethods;
import java.util.ArrayList;
import java.util.concurrent.Callable;
public class PushTemplateReceiver extends BroadcastReceiver {
private String channelId;
private CleverTapAPI cleverTapAPI;
private CleverTapInstanceConfig config;
private RemoteViews contentViewBig;
private RemoteViews contentViewManualCarousel;
private RemoteViews contentViewRating;
private RemoteViews contentViewSmall;
private NotificationManager notificationManager;
private String pt_big_img;
private String pt_big_img_alt;
private boolean pt_dismiss_intent;
private String pt_id;
private String pt_meta_clr;
private String pt_msg;
private String pt_msg_summary;
private String pt_product_display_linear;
private String pt_rating_default_dl;
private String pt_rating_toast;
private String pt_small_icon_clr;
private String pt_subtitle;
private String pt_title;
private boolean requiresChannelId;
private TemplateType templateType;
boolean clicked1 = true;
boolean clicked2 = true;
boolean clicked3 = true;
boolean clicked4 = true;
boolean clicked5 = true;
boolean close = true;
private ArrayList<String> imageList = new ArrayList<>();
private ArrayList<String> deepLinkList = new ArrayList<>();
private ArrayList<String> bigTextList = new ArrayList<>();
private ArrayList<String> smallTextList = new ArrayList<>();
private ArrayList<String> priceList = new ArrayList<>();
private int smallIcon = 0;
@Override
public void onReceive(final Context context, final Intent intent) {
String str;
Utils.createSilentNotificationChannel(context);
if (intent.getExtras() != null) {
final Bundle extras = intent.getExtras();
this.cleverTapAPI = CleverTapAPI.getGlobalInstance(context, extras.getString(Constants.WZRK_ACCT_ID_KEY));
this.pt_id = intent.getStringExtra(PTConstants.PT_ID);
this.pt_msg = extras.getString(PTConstants.PT_MSG);
this.pt_msg_summary = extras.getString(PTConstants.PT_MSG_SUMMARY);
this.pt_title = extras.getString(PTConstants.PT_TITLE);
this.pt_rating_default_dl = extras.getString(PTConstants.PT_DEFAULT_DL);
this.imageList = Utils.getImageListFromExtras(extras);
this.deepLinkList = Utils.getDeepLinkListFromExtras(extras);
this.bigTextList = Utils.getBigTextFromExtras(extras);
this.smallTextList = Utils.getSmallTextFromExtras(extras);
this.priceList = Utils.getPriceFromExtras(extras);
this.pt_product_display_linear = extras.getString(PTConstants.PT_PRODUCT_DISPLAY_LINEAR);
this.notificationManager = (NotificationManager) context.getSystemService("notification");
this.channelId = extras.getString(Constants.WZRK_CHANNEL_ID, "");
this.pt_big_img_alt = extras.getString(PTConstants.PT_BIG_IMG_ALT);
this.pt_small_icon_clr = extras.getString(PTConstants.PT_SMALL_ICON_COLOUR);
this.requiresChannelId = Build.VERSION.SDK_INT >= 26;
this.pt_dismiss_intent = extras.getBoolean(PTConstants.PT_DISMISS_INTENT, false);
this.pt_rating_toast = extras.getString(PTConstants.PT_RATING_TOAST);
this.pt_subtitle = extras.getString(PTConstants.PT_SUBTITLE);
setKeysFromDashboard(extras);
if (Build.VERSION.SDK_INT >= 26) {
if (this.channelId.isEmpty()) {
str = "Unable to render notification, channelId is required but not provided in the notification payload: " + extras.toString();
} else {
NotificationManager notificationManager = this.notificationManager;
if (notificationManager == null || f$.ExternalSyntheticApiModelOutline0.m(notificationManager, this.channelId) != null) {
str = null;
} else {
str = "Unable to render notification, channelId: " + this.channelId + " not registered by the app.";
}
}
if (str != null) {
PTLog.verbose(str);
return;
}
}
String str2 = this.pt_id;
if (str2 != null) {
this.templateType = TemplateType.fromString(str2);
}
CleverTapAPI cleverTapAPI = this.cleverTapAPI;
if (cleverTapAPI != null) {
try {
CleverTapInstanceConfig config = cleverTapAPI.getCoreState().getConfig();
this.config = config;
CTExecutorFactory.executors(config).postAsyncSafelyTask().execute("PushTemplateReceiver#renderNotification", new Callable<Void>() {
@Override
public Void call() throws Exception {
try {
} catch (Throwable th) {
PTLog.verbose("Couldn't render notification: " + th.getLocalizedMessage());
}
if (!PushTemplateReceiver.this.pt_dismiss_intent) {
if (PushTemplateReceiver.this.templateType != null) {
int i = AnonymousClass2.$SwitchMap$com$clevertap$android$pushtemplates$TemplateType[PushTemplateReceiver.this.templateType.ordinal()];
if (i == 1) {
PushTemplateReceiver.this.handleRatingNotification(context, extras, intent);
} else if (i == 2) {
PushTemplateReceiver.this.handleFiveCTANotification(context, extras);
} else if (i == 3) {
PushTemplateReceiver.this.handleProductDisplayNotification(context, extras);
} else if (i == 4) {
PushTemplateReceiver.this.handleInputBoxNotification(context, extras, intent);
} else if (i == 5) {
PushTemplateReceiver.this.handleManualCarouselNotification(context, extras);
}
}
return null;
}
Utils.deleteSilentNotificationChannel(context);
Utils.deleteImageFromStorage(context, intent);
return null;
}
});
return;
} catch (Exception e) {
PTLog.verbose("Couldn't render notification: " + e.getLocalizedMessage());
return;
}
}
PTLog.verbose("clevertap instance is null, not running PushTemplateReceiver#renderNotification");
}
}
static class AnonymousClass2 {
static final int[] $SwitchMap$com$clevertap$android$pushtemplates$TemplateType;
static {
int[] iArr = new int[TemplateType.values().length];
$SwitchMap$com$clevertap$android$pushtemplates$TemplateType = iArr;
try {
iArr[TemplateType.RATING.ordinal()] = 1;
} catch (NoSuchFieldError unused) {
}
try {
$SwitchMap$com$clevertap$android$pushtemplates$TemplateType[TemplateType.FIVE_ICONS.ordinal()] = 2;
} catch (NoSuchFieldError unused2) {
}
try {
$SwitchMap$com$clevertap$android$pushtemplates$TemplateType[TemplateType.PRODUCT_DISPLAY.ordinal()] = 3;
} catch (NoSuchFieldError unused3) {
}
try {
$SwitchMap$com$clevertap$android$pushtemplates$TemplateType[TemplateType.INPUT_BOX.ordinal()] = 4;
} catch (NoSuchFieldError unused4) {
}
try {
$SwitchMap$com$clevertap$android$pushtemplates$TemplateType[TemplateType.MANUAL_CAROUSEL.ordinal()] = 5;
} catch (NoSuchFieldError unused5) {
}
}
}
public void handleManualCarouselNotification(Context context, Bundle bundle) {
int size;
NotificationCompat.Builder builderWithChannelIDCheck;
try {
int i = bundle.getInt("notificationId");
Notification notificationById = Utils.getNotificationById(context, i);
if (notificationById != null) {
this.contentViewManualCarousel = notificationById.bigContentView;
this.contentViewSmall = notificationById.contentView;
}
setCustomContentViewBasicKeys(this.contentViewManualCarousel, context);
boolean z = bundle.getBoolean(PTConstants.PT_RIGHT_SWIPE);
this.imageList = bundle.getStringArrayList(PTConstants.PT_IMAGE_LIST);
this.deepLinkList = bundle.getStringArrayList(PTConstants.PT_DEEPLINK_LIST);
int i2 = bundle.getInt(PTConstants.PT_MANUAL_CAROUSEL_CURRENT);
if (z) {
this.contentViewManualCarousel.showNext(R.id.carousel_image);
this.contentViewManualCarousel.showNext(R.id.carousel_image_right);
this.contentViewManualCarousel.showNext(R.id.carousel_image_left);
size = i2 == this.imageList.size() - 1 ? 0 : i2 + 1;
} else {
this.contentViewManualCarousel.showPrevious(R.id.carousel_image);
this.contentViewManualCarousel.showPrevious(R.id.carousel_image_right);
this.contentViewManualCarousel.showPrevious(R.id.carousel_image_left);
size = i2 == 0 ? this.imageList.size() - 1 : i2 - 1;
}
String str = "";
ArrayList<String> arrayList = this.deepLinkList;
if (arrayList != null && arrayList.size() == this.imageList.size()) {
str = this.deepLinkList.get(size);
} else {
ArrayList<String> arrayList2 = this.deepLinkList;
if (arrayList2 != null && arrayList2.size() == 1) {
str = this.deepLinkList.get(0);
} else {
ArrayList<String> arrayList3 = this.deepLinkList;
if (arrayList3 != null && arrayList3.size() > size) {
str = this.deepLinkList.get(size);
} else {
ArrayList<String> arrayList4 = this.deepLinkList;
if (arrayList4 != null && arrayList4.size() < size) {
str = this.deepLinkList.get(0);
}
}
}
}
bundle.putInt(PTConstants.PT_MANUAL_CAROUSEL_CURRENT, size);
bundle.remove(PTConstants.PT_RIGHT_SWIPE);
bundle.putString(Constants.DEEP_LINK_KEY, str);
bundle.putInt(PTConstants.PT_MANUAL_CAROUSEL_FROM, i2);
this.contentViewManualCarousel.setOnClickPendingIntent(R.id.rightArrowPos0, PendingIntentFactory.getPendingIntent(context, i, bundle, false, 4, null));
this.contentViewManualCarousel.setOnClickPendingIntent(R.id.leftArrowPos0, PendingIntentFactory.getPendingIntent(context, i, bundle, false, 5, null));
PendingIntent pendingIntent = PendingIntentFactory.getPendingIntent(context, i, bundle, true, 3, null);
if (notificationById != null) {
builderWithChannelIDCheck = new NotificationCompat.Builder(context, notificationById);
} else {
builderWithChannelIDCheck = setBuilderWithChannelIDCheck(this.requiresChannelId, PTConstants.PT_SILENT_CHANNEL_ID, context);
}
NotificationCompat.Builder builder = builderWithChannelIDCheck;
PendingIntent pendingIntent2 = PendingIntentFactory.getPendingIntent(context, i, bundle, false, 6, null);
setSmallIcon(context);
setNotificationBuilderBasics(builder, this.contentViewSmall, this.contentViewManualCarousel, this.pt_title, pendingIntent, pendingIntent2);
this.notificationManager.notify(i, builder.build());
} catch (Throwable th) {
PTLog.verbose("Error creating manual carousel notification ", th);
}
}
public void handleInputBoxNotification(Context context, Bundle bundle, Intent intent) {
NotificationCompat.Builder builder;
Intent launchIntentForPackage;
Bundle resultsFromIntent = RemoteInput.getResultsFromIntent(intent);
PendingIntent dismissIntent = PendingIntentFactory.setDismissIntent(context, bundle, new Intent(context, (Class<?>) PushTemplateReceiver.class));
this.config = (CleverTapInstanceConfig) bundle.getParcelable(Constants.KEY_CONFIG);
if (resultsFromIntent != null) {
CharSequence charSequence = resultsFromIntent.getCharSequence("pt_input_reply");
int i = bundle.getInt("notificationId");
if (charSequence != null) {
PTLog.verbose("Processing Input from Input Template");
bundle.putString("pt_input_reply", charSequence.toString());
Utils.raiseCleverTapEvent(context, this.config, bundle, "pt_input_reply");
if (this.requiresChannelId) {
builder = new NotificationCompat.Builder(context, PTConstants.PT_SILENT_CHANNEL_ID);
} else {
builder = new NotificationCompat.Builder(context);
}
setSmallIcon(context);
if (Build.VERSION.SDK_INT >= 31) {
builder.setSubText(this.pt_subtitle);
}
builder.setSmallIcon(this.smallIcon).setContentTitle(this.pt_title).setContentText(bundle.getString(PTConstants.PT_INPUT_FEEDBACK)).setTimeoutAfter(1300L).setDeleteIntent(dismissIntent).setWhen(System.currentTimeMillis()).setAutoCancel(true);
setStandardViewBigImageStyle(this.pt_big_img_alt, bundle, context, builder);
this.notificationManager.notify(i, builder.build());
if (Build.VERSION.SDK_INT < 31) {
if (bundle.getString(PTConstants.PT_INPUT_AUTO_OPEN) != null || bundle.getBoolean(PTConstants.PT_INPUT_AUTO_OPEN)) {
try {
Thread.sleep(1300L);
} catch (InterruptedException e) {
e.printStackTrace();
}
if (bundle.containsKey(Constants.DEEP_LINK_KEY) && bundle.getString(Constants.DEEP_LINK_KEY) != null) {
launchIntentForPackage = new Intent("android.intent.action.VIEW", Uri.parse(intent.getStringExtra(Constants.DEEP_LINK_KEY)));
Utils.setPackageNameFromResolveInfoList(context, launchIntentForPackage);
} else {
launchIntentForPackage = context.getPackageManager().getLaunchIntentForPackage(context.getPackageName());
if (launchIntentForPackage == null) {
return;
}
}
launchIntentForPackage.putExtras(bundle);
launchIntentForPackage.putExtra("pt_reply", charSequence);
launchIntentForPackage.removeExtra(Constants.WZRK_ACTIONS);
launchIntentForPackage.setFlags(872415232);
context.startActivity(launchIntentForPackage);
return;
}
return;
}
return;
}
PTLog.verbose("PushTemplateReceiver: Input is Empty");
}
}
public void handleRatingNotification(Context context, Bundle bundle, Intent intent) {
NotificationCompat.Builder builderWithChannelIDCheck;
Class<?> cls;
try {
int i = bundle.getInt("notificationId");
if (bundle.getBoolean(PTConstants.DEFAULT_DL, false)) {
this.config = (CleverTapInstanceConfig) bundle.getParcelable(Constants.KEY_CONFIG);
this.notificationManager.cancel(i);
try {
cls = Class.forName("com.clevertap.android.sdk.pushnotification.CTNotificationIntentService");
} catch (ClassNotFoundException unused) {
PTLog.debug("No Intent Service found");
cls = null;
}
if (com.clevertap.android.sdk.Utils.isServiceAvailable(context, cls)) {
Intent intent2 = new Intent(CTNotificationIntentService.MAIN_ACTION);
intent2.setPackage(context.getPackageName());
intent2.putExtra(Constants.KEY_CT_TYPE, CTNotificationIntentService.TYPE_BUTTON_CLICK);
intent2.putExtras(bundle);
intent2.putExtra("dl", this.pt_rating_default_dl);
context.startService(intent2);
return;
}
Intent intent3 = new Intent("android.intent.action.VIEW", Uri.parse(this.pt_rating_default_dl));
intent3.removeExtra(Constants.WZRK_ACTIONS);
intent3.putExtra(Constants.WZRK_FROM_KEY, Constants.WZRK_FROM);
intent3.setFlags(872415232);
Utils.raiseNotificationClicked(context, bundle, this.config);
intent3.putExtras(bundle);
intent3.putExtra(Constants.DEEP_LINK_KEY, this.pt_rating_default_dl);
context.startActivity(intent3);
return;
}
String str = this.deepLinkList.get(0);
if (1 == bundle.getInt(PTConstants.KEY_CLICKED_STAR, 0)) {
bundle.putString(Constants.KEY_C2A, "rating_1");
if (this.deepLinkList.size() > 0) {
str = this.deepLinkList.get(0);
}
}
if (2 == bundle.getInt(PTConstants.KEY_CLICKED_STAR, 0)) {
bundle.putString(Constants.KEY_C2A, "rating_2");
if (this.deepLinkList.size() > 1) {
str = this.deepLinkList.get(1);
} else {
str = this.deepLinkList.get(0);
}
}
if (3 == bundle.getInt(PTConstants.KEY_CLICKED_STAR, 0)) {
bundle.putString(Constants.KEY_C2A, "rating_3");
if (this.deepLinkList.size() > 2) {
str = this.deepLinkList.get(2);
} else {
str = this.deepLinkList.get(0);
}
}
if (4 == bundle.getInt(PTConstants.KEY_CLICKED_STAR, 0)) {
bundle.putString(Constants.KEY_C2A, "rating_4");
if (this.deepLinkList.size() > 3) {
str = this.deepLinkList.get(3);
} else {
str = this.deepLinkList.get(0);
}
}
if (5 == bundle.getInt(PTConstants.KEY_CLICKED_STAR, 0)) {
bundle.putString(Constants.KEY_C2A, "rating_5");
if (this.deepLinkList.size() > 4) {
str = this.deepLinkList.get(4);
} else {
str = this.deepLinkList.get(0);
}
}
Notification notificationById = Utils.getNotificationById(context, i);
if (notificationById != null) {
this.contentViewRating = notificationById.bigContentView;
this.contentViewSmall = notificationById.contentView;
}
if (1 == bundle.getInt(PTConstants.KEY_CLICKED_STAR, 0)) {
this.contentViewRating.setImageViewResource(R.id.star1, R.drawable.pt_star_filled);
this.clicked1 = false;
} else {
this.contentViewRating.setImageViewResource(R.id.star1, R.drawable.pt_star_outline);
}
if (2 == bundle.getInt(PTConstants.KEY_CLICKED_STAR, 0)) {
this.contentViewRating.setImageViewResource(R.id.star1, R.drawable.pt_star_filled);
this.contentViewRating.setImageViewResource(R.id.star2, R.drawable.pt_star_filled);
this.clicked2 = false;
} else {
this.contentViewRating.setImageViewResource(R.id.star2, R.drawable.pt_star_outline);
}
if (3 == bundle.getInt(PTConstants.KEY_CLICKED_STAR, 0)) {
this.contentViewRating.setImageViewResource(R.id.star1, R.drawable.pt_star_filled);
this.contentViewRating.setImageViewResource(R.id.star2, R.drawable.pt_star_filled);
this.contentViewRating.setImageViewResource(R.id.star3, R.drawable.pt_star_filled);
this.clicked3 = false;
} else {
this.contentViewRating.setImageViewResource(R.id.star3, R.drawable.pt_star_outline);
}
if (4 == bundle.getInt(PTConstants.KEY_CLICKED_STAR, 0)) {
this.contentViewRating.setImageViewResource(R.id.star1, R.drawable.pt_star_filled);
this.contentViewRating.setImageViewResource(R.id.star2, R.drawable.pt_star_filled);
this.contentViewRating.setImageViewResource(R.id.star3, R.drawable.pt_star_filled);
this.contentViewRating.setImageViewResource(R.id.star4, R.drawable.pt_star_filled);
this.clicked4 = false;
} else {
this.contentViewRating.setImageViewResource(R.id.star4, R.drawable.pt_star_outline);
}
if (5 == bundle.getInt(PTConstants.KEY_CLICKED_STAR, 0)) {
this.contentViewRating.setImageViewResource(R.id.star1, R.drawable.pt_star_filled);
this.contentViewRating.setImageViewResource(R.id.star2, R.drawable.pt_star_filled);
this.contentViewRating.setImageViewResource(R.id.star3, R.drawable.pt_star_filled);
this.contentViewRating.setImageViewResource(R.id.star4, R.drawable.pt_star_filled);
this.contentViewRating.setImageViewResource(R.id.star5, R.drawable.pt_star_filled);
this.clicked5 = false;
} else {
this.contentViewRating.setImageViewResource(R.id.star5, R.drawable.pt_star_outline);
}
cancelRatingClickIntents(context, intent);
bundle.putString(Constants.DEEP_LINK_KEY, str);
this.contentViewRating.setOnClickPendingIntent(R.id.tVRatingConfirmation, LaunchPendingIntentFactory.getActivityIntent(bundle, context));
setSmallIcon(context);
if (notificationById != null) {
builderWithChannelIDCheck = new NotificationCompat.Builder(context, notificationById);
} else {
builderWithChannelIDCheck = setBuilderWithChannelIDCheck(this.requiresChannelId, PTConstants.PT_SILENT_CHANNEL_ID, context);
}
PendingIntent dismissIntent = PendingIntentFactory.setDismissIntent(context, bundle, new Intent(context, (Class<?>) PushTemplateReceiver.class));
if (this.notificationManager != null) {
builderWithChannelIDCheck.setSmallIcon(this.smallIcon).setCustomContentView(this.contentViewSmall).setCustomBigContentView(this.contentViewRating).setContentTitle(this.pt_title).setDeleteIntent(dismissIntent).setAutoCancel(true);
this.notificationManager.notify(i, builderWithChannelIDCheck.build());
}
Utils.raiseCleverTapEvent(context, this.config, "Rating Submitted", Utils.convertRatingBundleObjectToHashMap(bundle));
if (Build.VERSION.SDK_INT < 31) {
handleRatingDeepLink(context, bundle, i, str, this.config);
}
} catch (Throwable th) {
PTLog.verbose("Error creating rating notification ", th);
}
}
private void cancelRatingClickIntents(Context context, Intent intent) {
if (Build.VERSION.SDK_INT > 31) {
PendingIntent.getBroadcast(context, 12, intent, 201326592).cancel();
PendingIntent.getBroadcast(context, 11, intent, 201326592).cancel();
PendingIntent.getBroadcast(context, 10, intent, 201326592).cancel();
PendingIntent.getBroadcast(context, 9, intent, 201326592).cancel();
PendingIntent.getBroadcast(context, 8, intent, 201326592).cancel();
}
}
private void handleRatingDeepLink(Context context, Bundle bundle, int i, String str, CleverTapInstanceConfig cleverTapInstanceConfig) throws InterruptedException {
Intent launchIntentForPackage;
Thread.sleep(1000L);
this.notificationManager.cancel(i);
setToast(context, this.pt_rating_toast, cleverTapInstanceConfig);
context.sendBroadcast(new Intent("android.intent.action.CLOSE_SYSTEM_DIALOGS"));
if (bundle.containsKey(Constants.DEEP_LINK_KEY)) {
launchIntentForPackage = new Intent("android.intent.action.VIEW", Uri.parse(bundle.getString(Constants.DEEP_LINK_KEY)));
com.clevertap.android.sdk.Utils.setPackageNameFromResolveInfoList(context, launchIntentForPackage);
} else {
launchIntentForPackage = context.getPackageManager().getLaunchIntentForPackage(context.getPackageName());
if (launchIntentForPackage == null) {
return;
}
}
launchIntentForPackage.putExtras(bundle);
launchIntentForPackage.putExtra(Constants.DEEP_LINK_KEY, str);
launchIntentForPackage.removeExtra(Constants.WZRK_ACTIONS);
launchIntentForPackage.putExtra(Constants.WZRK_FROM_KEY, Constants.WZRK_FROM);
launchIntentForPackage.setFlags(872415232);
context.startActivity(launchIntentForPackage);
}
public void handleProductDisplayNotification(android.content.Context r14, android.os.Bundle r15) {
throw new UnsupportedOperationException("Method not decompiled: com.clevertap.android.pushtemplates.PushTemplateReceiver.handleProductDisplayNotification(android.content.Context, android.os.Bundle):void");
}
public void handleFiveCTANotification(Context context, Bundle bundle) {
int i = bundle.getInt("notificationId");
bundle.putString(Constants.DEEP_LINK_KEY, null);
if (this.close == bundle.getBoolean(Constants.KEY_HIDE_CLOSE)) {
bundle.putString(Constants.KEY_C2A, "5cta_close");
this.notificationManager.cancel(i);
}
Utils.raiseNotificationClicked(context, bundle, this.config);
}
private void setNotificationBuilderBasics(NotificationCompat.Builder builder, RemoteViews remoteViews, RemoteViews remoteViews2, String str, PendingIntent pendingIntent, PendingIntent pendingIntent2) {
builder.setSmallIcon(this.smallIcon).setCustomContentView(remoteViews).setCustomBigContentView(remoteViews2).setContentTitle(Html.fromHtml(str)).setDeleteIntent(pendingIntent2).setContentIntent(pendingIntent).setDefaults(5).setWhen(System.currentTimeMillis()).setAutoCancel(true);
}
private NotificationCompat.Builder setBuilderWithChannelIDCheck(boolean z, String str, Context context) {
if (z) {
return new NotificationCompat.Builder(context, str);
}
return new NotificationCompat.Builder(context);
}
private void setCustomContentViewBasicKeys(RemoteViews remoteViews, Context context) {
remoteViews.setTextViewText(R.id.app_name, Utils.getApplicationName(context));
remoteViews.setTextViewText(R.id.timestamp, Utils.getTimeStamp(context));
String str = this.pt_subtitle;
if (str != null && !str.isEmpty()) {
remoteViews.setTextViewText(R.id.subtitle, Html.fromHtml(this.pt_subtitle, 0));
} else {
remoteViews.setViewVisibility(R.id.subtitle, 8);
remoteViews.setViewVisibility(R.id.sep_subtitle, 8);
}
String str2 = this.pt_meta_clr;
if (str2 == null || str2.isEmpty()) {
return;
}
remoteViews.setTextColor(R.id.app_name, Utils.getColour(this.pt_meta_clr, "#A6A6A6"));
remoteViews.setTextColor(R.id.timestamp, Utils.getColour(this.pt_meta_clr, "#A6A6A6"));
remoteViews.setTextColor(R.id.subtitle, Utils.getColour(this.pt_meta_clr, "#A6A6A6"));
}
private void setStandardViewBigImageStyle(String str, Bundle bundle, Context context, NotificationCompat.Builder builder) {
NotificationCompat.BigPictureStyle bigText;
if (str != null && str.startsWith("http")) {
try {
Bitmap notificationBitmap = Utils.getNotificationBitmap(str, false, context);
if (notificationBitmap == null) {
throw new Exception("Failed to fetch big picture!");
}
bigText = new NotificationCompat.BigPictureStyle().setSummaryText(bundle.getString(PTConstants.PT_INPUT_FEEDBACK)).bigPicture(notificationBitmap);
} catch (Throwable th) {
NotificationCompat.BigPictureStyle bigText2 = new NotificationCompat.BigTextStyle().bigText(bundle.getString(PTConstants.PT_INPUT_FEEDBACK));
PTLog.verbose("Falling back to big text notification, couldn't fetch big picture", th);
bigText = bigText2;
}
} else {
bigText = new NotificationCompat.BigTextStyle().bigText(bundle.getString(PTConstants.PT_INPUT_FEEDBACK));
}
builder.setStyle(bigText);
}
private void setSmallIcon(Context context) {
try {
String _getManifestStringValueForKey = Utils._getManifestStringValueForKey(context.getPackageManager().getApplicationInfo(context.getPackageName(), UserVerificationMethods.USER_VERIFY_PATTERN).metaData, Constants.LABEL_NOTIFICATION_ICON);
if (_getManifestStringValueForKey == null) {
throw new IllegalArgumentException();
}
int identifier = context.getResources().getIdentifier(_getManifestStringValueForKey, "drawable", context.getPackageName());
this.smallIcon = identifier;
if (identifier == 0) {
throw new IllegalArgumentException();
}
} catch (Throwable unused) {
this.smallIcon = Utils.getAppIconAsIntId(context);
}
}
private void setKeysFromDashboard(Bundle bundle) {
String str = this.pt_title;
if (str == null || str.isEmpty()) {
this.pt_title = bundle.getString(Constants.NOTIF_TITLE);
}
String str2 = this.pt_msg;
if (str2 == null || str2.isEmpty()) {
this.pt_msg = bundle.getString(Constants.NOTIF_MSG);
}
String str3 = this.pt_msg_summary;
if (str3 == null || str3.isEmpty()) {
this.pt_msg_summary = bundle.getString(Constants.WZRK_MSG_SUMMARY);
}
String str4 = this.pt_big_img;
if (str4 == null || str4.isEmpty()) {
this.pt_big_img = bundle.getString(Constants.WZRK_BIG_PICTURE);
}
String str5 = this.pt_rating_default_dl;
if (str5 == null || str5.isEmpty()) {
this.pt_rating_default_dl = bundle.getString(Constants.DEEP_LINK_KEY);
}
String str6 = this.pt_meta_clr;
if (str6 == null || str6.isEmpty()) {
this.pt_meta_clr = bundle.getString(Constants.WZRK_COLOR);
}
String str7 = this.pt_small_icon_clr;
if (str7 == null || str7.isEmpty()) {
this.pt_small_icon_clr = bundle.getString(Constants.WZRK_COLOR);
}
String str8 = this.pt_subtitle;
if (str8 == null || str8.isEmpty()) {
this.pt_subtitle = bundle.getString(Constants.WZRK_SUBTITLE);
}
String str9 = this.pt_small_icon_clr;
if (str9 == null || str9.isEmpty()) {
this.pt_small_icon_clr = bundle.getString(Constants.WZRK_COLOR);
}
}
private void setToast(Context context, String str, CleverTapInstanceConfig cleverTapInstanceConfig) {
if (str == null || str.isEmpty()) {
return;
}
Utils.showToast(context, str, cleverTapInstanceConfig);
}
}