导航菜单

页面标题

页面副标题

Chaupal v3.2 - PushTemplateReceiver.java 源代码

正在查看: Chaupal v3.2 应用的 PushTemplateReceiver.java JAVA 源代码文件

本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。


package com.clevertap.android.pushtemplates;

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.m;
import androidx.core.app.u;
import b4.d;
import com.clevertap.android.sdk.CleverTapAPI;
import com.clevertap.android.sdk.CleverTapInstanceConfig;
import com.clevertap.android.sdk.pushnotification.CTNotificationIntentService;
import com.connectsdk.service.DeviceService;
import java.util.ArrayList;
import java.util.concurrent.Callable;
import o3.g;
import r3.x0;

public class PushTemplateReceiver extends BroadcastReceiver {
    private String A;
    private String B;
    private String C;
    private String D;
    private boolean E;
    private String F;
    private String G;
    private CleverTapInstanceConfig H;

    private CleverTapAPI f8013g;

    private RemoteViews f8014h;

    private RemoteViews f8015i;

    private RemoteViews f8016j;

    private RemoteViews f8017k;

    private String f8018l;

    private TemplateType f8019m;

    private String f8020n;

    private String f8021o;

    private String f8022p;

    private String f8023q;

    private boolean f8030x;

    private NotificationManager f8031y;

    private String f8032z;

    boolean f8007a = true;

    boolean f8008b = true;

    boolean f8009c = true;

    boolean f8010d = true;

    boolean f8011e = true;

    boolean f8012f = true;

    private ArrayList<String> f8024r = new ArrayList<>();

    private ArrayList<String> f8025s = new ArrayList<>();

    private ArrayList<String> f8026t = new ArrayList<>();

    private ArrayList<String> f8027u = new ArrayList<>();

    private ArrayList<String> f8028v = new ArrayList<>();

    private int f8029w = 0;

    class a implements Callable<Void> {

        final Context f8033a;

        final Intent f8034c;

        final Bundle f8035d;

        a(Context context, Intent intent, Bundle bundle) {
            this.f8033a = context;
            this.f8034c = intent;
            this.f8035d = bundle;
        }

        @Override
        public Void call() throws Exception {
            try {
            } catch (Throwable th) {
                com.clevertap.android.pushtemplates.a.c("Couldn't render notification: " + th.getLocalizedMessage());
            }
            if (PushTemplateReceiver.this.E) {
                c.f(this.f8033a);
                c.e(this.f8033a, this.f8034c);
                return null;
            }
            if (PushTemplateReceiver.this.f8019m != null) {
                int i7 = b.f8037a[PushTemplateReceiver.this.f8019m.ordinal()];
                if (i7 == 1) {
                    PushTemplateReceiver.this.n(this.f8033a, this.f8035d, this.f8034c);
                } else if (i7 == 2) {
                    PushTemplateReceiver.this.i(this.f8033a, this.f8035d);
                } else if (i7 == 3) {
                    PushTemplateReceiver.this.l(this.f8033a, this.f8035d);
                } else if (i7 == 4) {
                    PushTemplateReceiver.this.j(this.f8033a, this.f8035d, this.f8034c);
                } else if (i7 == 5) {
                    PushTemplateReceiver.this.k(this.f8033a, this.f8035d);
                }
            }
            return null;
        }
    }

    static class b {

        static final int[] f8037a;

        static {
            int[] iArr = new int[TemplateType.values().length];
            f8037a = iArr;
            try {
                iArr[TemplateType.RATING.ordinal()] = 1;
            } catch (NoSuchFieldError unused) {
            }
            try {
                f8037a[TemplateType.FIVE_ICONS.ordinal()] = 2;
            } catch (NoSuchFieldError unused2) {
            }
            try {
                f8037a[TemplateType.PRODUCT_DISPLAY.ordinal()] = 3;
            } catch (NoSuchFieldError unused3) {
            }
            try {
                f8037a[TemplateType.INPUT_BOX.ordinal()] = 4;
            } catch (NoSuchFieldError unused4) {
            }
            try {
                f8037a[TemplateType.MANUAL_CAROUSEL.ordinal()] = 5;
            } catch (NoSuchFieldError unused5) {
            }
        }
    }

    private void h(Context context, Intent intent) {
        int i7 = Build.VERSION.SDK_INT >= 23 ? 201326592 : 134217728;
        for (int i8 : intent.getIntArrayExtra("requestCodes")) {
            PendingIntent.getBroadcast(context, i8, intent, i7).cancel();
        }
    }

    public void i(Context context, Bundle bundle) {
        int i7 = bundle.getInt("notificationId");
        bundle.putString("wzrk_dl", null);
        if (this.f8012f == bundle.getBoolean("close")) {
            bundle.putString("wzrk_c2a", "5cta_close");
            this.f8031y.cancel(i7);
        }
        c.M(context, bundle, this.H);
    }

    public void j(Context context, Bundle bundle, Intent intent) {
        Intent launchIntentForPackage;
        Bundle l7 = u.l(intent);
        PendingIntent d7 = g.d(context, bundle, new Intent(context, (Class<?>) PushTemplateReceiver.class));
        this.H = (CleverTapInstanceConfig) bundle.getParcelable(DeviceService.KEY_CONFIG);
        if (l7 != null) {
            CharSequence charSequence = l7.getCharSequence("pt_input_reply");
            int i7 = bundle.getInt("notificationId");
            if (charSequence == null) {
                com.clevertap.android.pushtemplates.a.c("PushTemplateReceiver: Input is Empty");
                return;
            }
            com.clevertap.android.pushtemplates.a.c("Processing Input from Input Template");
            bundle.putString("pt_input_reply", charSequence.toString());
            c.K(context, this.H, bundle, "pt_input_reply");
            m.i iVar = this.f8030x ? new m.i(context, "pt_silent_sound_channel") : new m.i(context);
            r(context);
            int i8 = Build.VERSION.SDK_INT;
            if (i8 >= 31) {
                iVar.f0(this.G);
            }
            iVar.Z(this.f8029w).D(this.f8020n).C(bundle.getString("pt_input_feedback")).h0(1300L).H(d7).l0(System.currentTimeMillis()).s(true);
            s(this.A, bundle, context, iVar);
            this.f8031y.notify(i7, iVar.g());
            if (i8 < 31) {
                if (bundle.getString("pt_input_auto_open") != null || bundle.getBoolean("pt_input_auto_open")) {
                    try {
                        Thread.sleep(1300L);
                    } catch (InterruptedException e7) {
                        e7.printStackTrace();
                    }
                    if (!bundle.containsKey("wzrk_dl") || bundle.getString("wzrk_dl") == null) {
                        launchIntentForPackage = context.getPackageManager().getLaunchIntentForPackage(context.getPackageName());
                        if (launchIntentForPackage == null) {
                            return;
                        }
                    } else {
                        launchIntentForPackage = new Intent("android.intent.action.VIEW", Uri.parse(intent.getStringExtra("wzrk_dl")));
                        c.P(context, launchIntentForPackage);
                    }
                    launchIntentForPackage.putExtras(bundle);
                    launchIntentForPackage.putExtra("pt_reply", charSequence);
                    launchIntentForPackage.removeExtra("wzrk_acts");
                    launchIntentForPackage.setFlags(872415232);
                    context.startActivity(launchIntentForPackage);
                }
            }
        }
    }

    public void k(Context context, Bundle bundle) {
        int size;
        try {
            if (Build.VERSION.SDK_INT < 23) {
                bundle.putString("extras_from", "PTReceiver");
                d O = CleverTapAPI.O();
                if (O != null) {
                    O.b(context, bundle, "FCM");
                    return;
                }
                return;
            }
            int i7 = bundle.getInt("notificationId");
            Notification x6 = c.x(context, i7);
            if (x6 == null) {
                com.clevertap.android.pushtemplates.a.c("Manual Carousel Notification is null, returning");
                return;
            }
            RemoteViews remoteViews = x6.bigContentView;
            this.f8017k = remoteViews;
            this.f8015i = x6.contentView;
            o(remoteViews, context);
            boolean z6 = bundle.getBoolean("right_swipe");
            this.f8024r = bundle.getStringArrayList("pt_image_list");
            this.f8025s = bundle.getStringArrayList("pt_deeplink_list");
            int i8 = bundle.getInt("pt_manual_carousel_current");
            if (z6) {
                this.f8017k.showNext(m3.c.f17509c);
                this.f8017k.showNext(m3.c.f17511e);
                this.f8017k.showNext(m3.c.f17510d);
                size = i8 == this.f8024r.size() - 1 ? 0 : i8 + 1;
            } else {
                this.f8017k.showPrevious(m3.c.f17509c);
                this.f8017k.showPrevious(m3.c.f17511e);
                this.f8017k.showPrevious(m3.c.f17510d);
                size = i8 == 0 ? this.f8024r.size() - 1 : i8 - 1;
            }
            String str = "";
            ArrayList<String> arrayList = this.f8025s;
            if (arrayList == null || arrayList.size() != this.f8024r.size()) {
                ArrayList<String> arrayList2 = this.f8025s;
                if (arrayList2 == null || arrayList2.size() != 1) {
                    ArrayList<String> arrayList3 = this.f8025s;
                    if (arrayList3 == null || arrayList3.size() <= size) {
                        ArrayList<String> arrayList4 = this.f8025s;
                        if (arrayList4 != null && arrayList4.size() < size) {
                            str = this.f8025s.get(0);
                        }
                    } else {
                        str = this.f8025s.get(size);
                    }
                } else {
                    str = this.f8025s.get(0);
                }
            } else {
                str = this.f8025s.get(size);
            }
            bundle.putInt("pt_manual_carousel_current", size);
            bundle.remove("right_swipe");
            bundle.putString("wzrk_dl", str);
            bundle.putInt("manual_carousel_from", i8);
            this.f8017k.setOnClickPendingIntent(m3.c.f17529w, g.b(context, i7, bundle, false, 4, null));
            this.f8017k.setOnClickPendingIntent(m3.c.f17524r, g.b(context, i7, bundle, false, 5, null));
            PendingIntent b7 = g.b(context, i7, bundle, true, 3, null);
            m.i iVar = new m.i(context, x6);
            PendingIntent b9 = g.b(context, i7, bundle, false, 6, null);
            r(context);
            q(iVar, this.f8015i, this.f8017k, this.f8020n, b7, b9);
            this.f8031y.notify(i7, iVar.g());
        } catch (Throwable th) {
            com.clevertap.android.pushtemplates.a.d("Error creating manual carousel notification ", th);
        }
    }

    public void l(Context context, Bundle bundle) {
        try {
            if (Build.VERSION.SDK_INT < 23) {
                bundle.putString("extras_from", "PTReceiver");
                d O = CleverTapAPI.O();
                if (O != null) {
                    O.b(context, bundle, "FCM");
                    return;
                }
                return;
            }
            int i7 = bundle.getInt("notificationId");
            Notification x6 = c.x(context, i7);
            if (x6 == null) {
                com.clevertap.android.pushtemplates.a.c("Product Display Notification is null, returning");
                return;
            }
            this.f8014h = x6.bigContentView;
            this.f8015i = x6.contentView;
            boolean z6 = false;
            String str = this.f8032z;
            if (str != null && !str.isEmpty()) {
                z6 = true;
            }
            o(this.f8014h, context);
            if (!z6) {
                o(this.f8015i, context);
            }
            int i8 = bundle.getInt("pt_current_position");
            this.f8014h.setDisplayedChild(m3.c.f17509c, i8);
            this.f8024r = bundle.getStringArrayList("pt_image_list");
            this.f8025s = bundle.getStringArrayList("pt_deeplink_list");
            this.f8026t = bundle.getStringArrayList("pt_big_text_list");
            this.f8027u = bundle.getStringArrayList("pt_small_text_list");
            this.f8028v = bundle.getStringArrayList("pt_price_list");
            String str2 = this.f8025s.get(i8);
            if (z6) {
                this.f8014h.setTextViewText(m3.c.f17527u, this.f8026t.get(i8));
            } else {
                this.f8014h.setTextViewText(m3.c.K, this.f8026t.get(i8));
            }
            this.f8014h.setTextViewText(m3.c.f17525s, this.f8027u.get(i8));
            this.f8014h.setTextViewText(m3.c.f17528v, this.f8028v.get(i8));
            bundle.remove("pt_current_position");
            Bundle bundle2 = (Bundle) bundle.clone();
            bundle2.putBoolean("img1", true);
            bundle2.putInt("notificationId", i7);
            bundle2.putString("pt_buy_now_dl", str2);
            bundle2.putBoolean("buynow", true);
            this.f8014h.setOnClickPendingIntent(m3.c.f17526t, g.a(context, bundle2, str2, i7));
            m.i iVar = new m.i(context, x6);
            Bundle bundle3 = (Bundle) bundle.clone();
            bundle3.putString("wzrk_dl", str2);
            PendingIntent b7 = g.b(context, i7, bundle3, true, 20, null);
            if (this.f8031y != null) {
                PendingIntent d7 = g.d(context, bundle, new Intent(context, (Class<?>) PushTemplateReceiver.class));
                r(context);
                q(iVar, this.f8015i, this.f8014h, this.f8020n, b7, d7);
                this.f8031y.notify(i7, iVar.g());
            }
        } catch (Throwable th) {
            com.clevertap.android.pushtemplates.a.d("Error creating product display notification ", th);
        }
    }

    private void m(Context context, Bundle bundle, int i7, String str, CleverTapInstanceConfig cleverTapInstanceConfig) throws InterruptedException {
        Intent launchIntentForPackage;
        Thread.sleep(1000L);
        this.f8031y.cancel(i7);
        t(context, this.F, cleverTapInstanceConfig);
        context.sendBroadcast(new Intent("android.intent.action.CLOSE_SYSTEM_DIALOGS"));
        if (bundle.containsKey("wzrk_dl")) {
            launchIntentForPackage = new Intent("android.intent.action.VIEW", Uri.parse(bundle.getString("wzrk_dl")));
            x0.A(context, launchIntentForPackage);
        } else {
            launchIntentForPackage = context.getPackageManager().getLaunchIntentForPackage(context.getPackageName());
            if (launchIntentForPackage == null) {
                return;
            }
        }
        launchIntentForPackage.putExtras(bundle);
        launchIntentForPackage.putExtra("wzrk_dl", str);
        launchIntentForPackage.removeExtra("wzrk_acts");
        launchIntentForPackage.putExtra("wzrk_from", "CTPushNotificationReceiver");
        launchIntentForPackage.setFlags(872415232);
        context.startActivity(launchIntentForPackage);
    }

    public void n(Context context, Bundle bundle, Intent intent) {
        try {
            int i7 = bundle.getInt("notificationId");
            if (bundle.getBoolean("default_dl", false)) {
                this.H = (CleverTapInstanceConfig) bundle.getParcelable(DeviceService.KEY_CONFIG);
                this.f8031y.cancel(i7);
                Class<?> cls = null;
                try {
                    cls = Class.forName("com.clevertap.android.sdk.pushnotification.CTNotificationIntentService");
                } catch (ClassNotFoundException unused) {
                    com.clevertap.android.pushtemplates.a.a("No Intent Service found");
                }
                if (x0.w(context, cls)) {
                    Intent intent2 = new Intent(CTNotificationIntentService.MAIN_ACTION);
                    intent2.setPackage(context.getPackageName());
                    intent2.putExtra("ct_type", CTNotificationIntentService.TYPE_BUTTON_CLICK);
                    intent2.putExtras(bundle);
                    intent2.putExtra("dl", this.f8023q);
                    context.startService(intent2);
                    return;
                }
                Intent intent3 = new Intent("android.intent.action.VIEW", Uri.parse(this.f8023q));
                intent3.removeExtra("wzrk_acts");
                intent3.putExtra("wzrk_from", "CTPushNotificationReceiver");
                intent3.setFlags(872415232);
                c.M(context, bundle, this.H);
                intent3.putExtras(bundle);
                intent3.putExtra("wzrk_dl", this.f8023q);
                context.startActivity(intent3);
                return;
            }
            String str = this.f8025s.get(0);
            if (1 == bundle.getInt("clickedStar", 0)) {
                bundle.putString("wzrk_c2a", "rating_1");
                if (this.f8025s.size() > 0) {
                    str = this.f8025s.get(0);
                }
            }
            if (2 == bundle.getInt("clickedStar", 0)) {
                bundle.putString("wzrk_c2a", "rating_2");
                str = this.f8025s.size() > 1 ? this.f8025s.get(1) : this.f8025s.get(0);
            }
            if (3 == bundle.getInt("clickedStar", 0)) {
                bundle.putString("wzrk_c2a", "rating_3");
                str = this.f8025s.size() > 2 ? this.f8025s.get(2) : this.f8025s.get(0);
            }
            if (4 == bundle.getInt("clickedStar", 0)) {
                bundle.putString("wzrk_c2a", "rating_4");
                str = this.f8025s.size() > 3 ? this.f8025s.get(3) : this.f8025s.get(0);
            }
            if (5 == bundle.getInt("clickedStar", 0)) {
                bundle.putString("wzrk_c2a", "rating_5");
                str = this.f8025s.size() > 4 ? this.f8025s.get(4) : this.f8025s.get(0);
            }
            String str2 = str;
            int i8 = Build.VERSION.SDK_INT;
            if (i8 < 23) {
                bundle.putString("extras_from", "PTReceiver");
                Bundle bundle2 = (Bundle) bundle.clone();
                d O = CleverTapAPI.O();
                if (O != null) {
                    O.b(context, bundle, "FCM");
                    bundle2.putString("wzrk_dl", str2);
                    c.L(context, this.H, "Rating Submitted", c.c(bundle));
                    m(context, bundle2, i7, str2, this.H);
                    return;
                }
                return;
            }
            Notification x6 = c.x(context, i7);
            if (x6 == null) {
                com.clevertap.android.pushtemplates.a.c("Rating Notification is null, returning");
                return;
            }
            this.f8016j = x6.bigContentView;
            this.f8015i = x6.contentView;
            if (1 == bundle.getInt("clickedStar", 0)) {
                this.f8016j.setImageViewResource(m3.c.C, m3.b.f17505b);
                this.f8007a = false;
            } else {
                this.f8016j.setImageViewResource(m3.c.C, m3.b.f17506c);
            }
            if (2 == bundle.getInt("clickedStar", 0)) {
                RemoteViews remoteViews = this.f8016j;
                int i9 = m3.c.C;
                int i10 = m3.b.f17505b;
                remoteViews.setImageViewResource(i9, i10);
                this.f8016j.setImageViewResource(m3.c.D, i10);
                this.f8008b = false;
            } else {
                this.f8016j.setImageViewResource(m3.c.D, m3.b.f17506c);
            }
            if (3 == bundle.getInt("clickedStar", 0)) {
                RemoteViews remoteViews2 = this.f8016j;
                int i11 = m3.c.C;
                int i12 = m3.b.f17505b;
                remoteViews2.setImageViewResource(i11, i12);
                this.f8016j.setImageViewResource(m3.c.D, i12);
                this.f8016j.setImageViewResource(m3.c.E, i12);
                this.f8009c = false;
            } else {
                this.f8016j.setImageViewResource(m3.c.E, m3.b.f17506c);
            }
            if (4 == bundle.getInt("clickedStar", 0)) {
                RemoteViews remoteViews3 = this.f8016j;
                int i13 = m3.c.C;
                int i14 = m3.b.f17505b;
                remoteViews3.setImageViewResource(i13, i14);
                this.f8016j.setImageViewResource(m3.c.D, i14);
                this.f8016j.setImageViewResource(m3.c.E, i14);
                this.f8016j.setImageViewResource(m3.c.F, i14);
                this.f8010d = false;
            } else {
                this.f8016j.setImageViewResource(m3.c.F, m3.b.f17506c);
            }
            if (5 == bundle.getInt("clickedStar", 0)) {
                RemoteViews remoteViews4 = this.f8016j;
                int i15 = m3.c.C;
                int i16 = m3.b.f17505b;
                remoteViews4.setImageViewResource(i15, i16);
                this.f8016j.setImageViewResource(m3.c.D, i16);
                this.f8016j.setImageViewResource(m3.c.E, i16);
                this.f8016j.setImageViewResource(m3.c.F, i16);
                this.f8016j.setImageViewResource(m3.c.G, i16);
                this.f8011e = false;
            } else {
                this.f8016j.setImageViewResource(m3.c.G, m3.b.f17506c);
            }
            h(context, intent);
            bundle.putString("wzrk_dl", str2);
            this.f8016j.setOnClickPendingIntent(m3.c.I, com.clevertap.android.sdk.pushnotification.g.a(bundle, context));
            r(context);
            m.i iVar = new m.i(context, x6);
            PendingIntent d7 = g.d(context, bundle, new Intent(context, (Class<?>) PushTemplateReceiver.class));
            if (this.f8031y != null) {
                iVar.Z(this.f8029w).F(this.f8015i).E(this.f8016j).D(this.f8020n).H(d7).s(true);
                this.f8031y.notify(i7, iVar.g());
            }
            c.L(context, this.H, "Rating Submitted", c.c(bundle));
            if (i8 < 31) {
                m(context, bundle, i7, str2, this.H);
            }
        } catch (Throwable th) {
            com.clevertap.android.pushtemplates.a.d("Error creating rating notification ", th);
        }
    }

    private void o(RemoteViews remoteViews, Context context) {
        int i7 = m3.c.f17507a;
        remoteViews.setTextViewText(i7, c.l(context));
        int i8 = m3.c.J;
        remoteViews.setTextViewText(i8, c.B(context));
        String str = this.G;
        if (str == null || str.isEmpty()) {
            remoteViews.setViewVisibility(m3.c.H, 8);
            remoteViews.setViewVisibility(m3.c.f17530x, 8);
        } else if (Build.VERSION.SDK_INT >= 24) {
            remoteViews.setTextViewText(m3.c.H, Html.fromHtml(this.G, 0));
        } else {
            remoteViews.setTextViewText(m3.c.H, Html.fromHtml(this.G));
        }
        String str2 = this.D;
        if (str2 == null || str2.isEmpty()) {
            return;
        }
        remoteViews.setTextColor(i7, c.o(this.D, "#A6A6A6"));
        remoteViews.setTextColor(i8, c.o(this.D, "#A6A6A6"));
        remoteViews.setTextColor(m3.c.H, c.o(this.D, "#A6A6A6"));
    }

    private void p(Bundle bundle) {
        String str = this.f8020n;
        if (str == null || str.isEmpty()) {
            this.f8020n = bundle.getString("nt");
        }
        String str2 = this.f8021o;
        if (str2 == null || str2.isEmpty()) {
            this.f8021o = bundle.getString("nm");
        }
        String str3 = this.f8022p;
        if (str3 == null || str3.isEmpty()) {
            this.f8022p = bundle.getString("wzrk_nms");
        }
        String str4 = this.C;
        if (str4 == null || str4.isEmpty()) {
            this.C = bundle.getString("wzrk_bp");
        }
        String str5 = this.f8023q;
        if (str5 == null || str5.isEmpty()) {
            this.f8023q = bundle.getString("wzrk_dl");
        }
        String str6 = this.D;
        if (str6 == null || str6.isEmpty()) {
            this.D = bundle.getString("wzrk_clr");
        }
        String str7 = this.B;
        if (str7 == null || str7.isEmpty()) {
            this.B = bundle.getString("wzrk_clr");
        }
        String str8 = this.G;
        if (str8 == null || str8.isEmpty()) {
            this.G = bundle.getString("wzrk_st");
        }
        String str9 = this.B;
        if (str9 == null || str9.isEmpty()) {
            this.B = bundle.getString("wzrk_clr");
        }
    }

    private void q(m.i iVar, RemoteViews remoteViews, RemoteViews remoteViews2, String str, PendingIntent pendingIntent, PendingIntent pendingIntent2) {
        iVar.Z(this.f8029w).F(remoteViews).E(remoteViews2).D(Html.fromHtml(str)).H(pendingIntent2).B(pendingIntent).G(5).l0(System.currentTimeMillis()).s(true);
    }

    private void r(Context context) {
        try {
            String a7 = c.a(context.getPackageManager().getApplicationInfo(context.getPackageName(), 128).metaData, "CLEVERTAP_NOTIFICATION_ICON");
            if (a7 == null) {
                throw new IllegalArgumentException();
            }
            int identifier = context.getResources().getIdentifier(a7, "drawable", context.getPackageName());
            this.f8029w = identifier;
            if (identifier == 0) {
                throw new IllegalArgumentException();
            }
        } catch (Throwable unused) {
            this.f8029w = c.k(context);
        }
    }

    private void s(String str, Bundle bundle, Context context, m.i iVar) {
        m.n y6;
        if (str == null || !str.startsWith("http")) {
            y6 = new m.g().y(bundle.getString("pt_input_feedback"));
        } else {
            try {
                Bitmap w6 = c.w(str, false, context);
                if (w6 == null) {
                    throw new Exception("Failed to fetch big picture!");
                }
                y6 = new m.f().C(bundle.getString("pt_input_feedback")).A(w6);
            } catch (Throwable th) {
                m.g y7 = new m.g().y(bundle.getString("pt_input_feedback"));
                com.clevertap.android.pushtemplates.a.d("Falling back to big text notification, couldn't fetch big picture", th);
                y6 = y7;
            }
        }
        iVar.e0(y6);
    }

    private void t(Context context, String str, CleverTapInstanceConfig cleverTapInstanceConfig) {
        if (str == null || str.isEmpty()) {
            return;
        }
        c.Q(context, str, cleverTapInstanceConfig);
    }

    @Override
    public void onReceive(Context context, Intent intent) {
        c.d(context);
        if (intent.getExtras() != null) {
            Bundle extras = intent.getExtras();
            this.f8013g = CleverTapAPI.K(context, extras.getString("wzrk_acct_id"));
            this.f8018l = intent.getStringExtra("pt_id");
            this.f8021o = extras.getString("pt_msg");
            this.f8022p = extras.getString("pt_msg_summary");
            this.f8020n = extras.getString("pt_title");
            this.f8023q = extras.getString("pt_default_dl");
            this.f8024r = c.v(extras);
            this.f8025s = c.p(extras);
            this.f8026t = c.m(extras);
            this.f8027u = c.A(extras);
            this.f8028v = c.z(extras);
            this.f8032z = extras.getString("pt_product_display_linear");
            this.f8031y = (NotificationManager) context.getSystemService("notification");
            this.A = extras.getString("pt_big_img_alt");
            this.B = extras.getString("pt_small_icon_clr");
            this.f8030x = Build.VERSION.SDK_INT >= 26;
            this.E = extras.getBoolean("pt_dismiss_intent", false);
            this.F = extras.getString("pt_rating_toast");
            this.G = extras.getString("pt_subtitle");
            p(extras);
            String str = this.f8018l;
            if (str != null) {
                this.f8019m = TemplateType.fromString(str);
            }
            CleverTapAPI cleverTapAPI = this.f8013g;
            if (cleverTapAPI == null) {
                com.clevertap.android.pushtemplates.a.c("clevertap instance is null, not running PushTemplateReceiver#renderNotification");
                return;
            }
            try {
                CleverTapInstanceConfig f2 = cleverTapAPI.E().f();
                this.H = f2;
                com.clevertap.android.sdk.task.a.a(f2).c().g("PushTemplateReceiver#renderNotification", new a(context, intent, extras));
            } catch (Exception e7) {
                com.clevertap.android.pushtemplates.a.c("Couldn't render notification: " + e7.getLocalizedMessage());
            }
        }
    }
}