导航菜单

页面标题

页面副标题

Kickcash v16.1 - PushTemplateReceiver.java 源代码

正在查看: Kickcash v16.1 应用的 PushTemplateReceiver.java JAVA 源代码文件

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


package com.clevertap.android.pushtemplates;

import android.app.Notification;
import android.app.NotificationChannel;
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.e;
import androidx.core.app.j;
import com.clevertap.android.sdk.CleverTapInstanceConfig;
import com.clevertap.android.sdk.h;
import com.clevertap.android.sdk.pushnotification.CTNotificationIntentService;
import com.microsoft.clarity.t6.g;
import com.microsoft.clarity.u7.f;
import com.microsoft.clarity.w6.o0;
import java.util.ArrayList;
import java.util.concurrent.Callable;

public class PushTemplateReceiver extends BroadcastReceiver {
    private String A;
    private String B;
    private String C;
    private String D;
    private String E;
    private boolean F;
    private String G;
    private String H;
    private CleverTapInstanceConfig I;
    private h g;
    private RemoteViews h;
    private RemoteViews i;
    private RemoteViews j;
    private RemoteViews k;
    private String l;
    private com.microsoft.clarity.r6.d m;
    private String n;
    private String o;
    private String p;
    private String q;
    private String w;
    private boolean y;
    private NotificationManager z;
    boolean a = true;
    boolean b = true;
    boolean c = true;
    boolean d = true;
    boolean e = true;
    boolean f = true;
    private ArrayList<String> r = new ArrayList<>();
    private ArrayList<String> s = new ArrayList<>();
    private ArrayList<String> t = new ArrayList<>();
    private ArrayList<String> u = new ArrayList<>();
    private ArrayList<String> v = new ArrayList<>();
    private int x = 0;

    class a implements Callable<Void> {
        final Context X;
        final Intent Y;
        final Bundle Z;

        a(Context context, Intent intent, Bundle bundle) {
            this.X = context;
            this.Y = intent;
            this.Z = 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.F) {
                d.f(this.X);
                d.e(this.X, this.Y);
                return null;
            }
            if (PushTemplateReceiver.this.m != null) {
                int i = b.a[PushTemplateReceiver.this.m.ordinal()];
                if (i == 1) {
                    PushTemplateReceiver.this.n(this.X, this.Z, this.Y);
                } else if (i == 2) {
                    PushTemplateReceiver.this.i(this.X, this.Z);
                } else if (i == 3) {
                    PushTemplateReceiver.this.l(this.X, this.Z);
                } else if (i == 4) {
                    PushTemplateReceiver.this.j(this.X, this.Z, this.Y);
                } else if (i == 5) {
                    PushTemplateReceiver.this.k(this.X, this.Z);
                }
            }
            return null;
        }
    }

    static class b {
        static final int[] a;

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

    private void h(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();
        }
    }

    public void i(Context context, Bundle bundle) {
        int i = bundle.getInt("notificationId");
        bundle.putString("wzrk_dl", null);
        if (this.f == bundle.getBoolean("close")) {
            bundle.putString("wzrk_c2a", "5cta_close");
            this.z.cancel(i);
        }
        d.N(context, bundle, this.I);
    }

    public void j(Context context, Bundle bundle, Intent intent) {
        Intent launchIntentForPackage;
        Bundle k = j.k(intent);
        PendingIntent c = g.c(context, bundle, new Intent(context, (Class<?>) PushTemplateReceiver.class));
        this.I = (CleverTapInstanceConfig) bundle.getParcelable("config");
        if (k != null) {
            CharSequence charSequence = k.getCharSequence("pt_input_reply");
            int i = 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());
            d.L(context, this.I, bundle, "pt_input_reply");
            e.i iVar = this.y ? new e.i(context, "pt_silent_sound_channel") : new e.i(context);
            s(context);
            int i2 = Build.VERSION.SDK_INT;
            if (i2 >= 31) {
                iVar.Y(this.H);
            }
            iVar.S(this.x).w(this.n).v(bundle.getString("pt_input_feedback")).a0(1300L).A(c).e0(System.currentTimeMillis()).l(true);
            t(this.B, bundle, context, iVar);
            this.z.notify(i, iVar.g());
            if (i2 < 31) {
                if (bundle.getString("pt_input_auto_open") != null || bundle.getBoolean("pt_input_auto_open")) {
                    try {
                        Thread.sleep(1300L);
                    } catch (InterruptedException e) {
                        e.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")));
                        d.Q(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 {
            int i = bundle.getInt("notificationId");
            Notification x = d.x(context, i);
            if (x != null) {
                this.k = x.bigContentView;
                this.i = x.contentView;
            }
            p(this.k, context);
            boolean z = bundle.getBoolean("right_swipe");
            this.r = bundle.getStringArrayList("pt_image_list");
            this.s = bundle.getStringArrayList("pt_deeplink_list");
            int i2 = bundle.getInt("pt_manual_carousel_current");
            if (z) {
                this.k.showNext(R.id.carousel_image);
                this.k.showNext(R.id.carousel_image_right);
                this.k.showNext(R.id.carousel_image_left);
                size = i2 == this.r.size() - 1 ? 0 : i2 + 1;
            } else {
                this.k.showPrevious(R.id.carousel_image);
                this.k.showPrevious(R.id.carousel_image_right);
                this.k.showPrevious(R.id.carousel_image_left);
                size = i2 == 0 ? this.r.size() - 1 : i2 - 1;
            }
            String str = "";
            ArrayList<String> arrayList = this.s;
            if (arrayList == null || arrayList.size() != this.r.size()) {
                ArrayList<String> arrayList2 = this.s;
                if (arrayList2 == null || arrayList2.size() != 1) {
                    ArrayList<String> arrayList3 = this.s;
                    if (arrayList3 == null || arrayList3.size() <= size) {
                        ArrayList<String> arrayList4 = this.s;
                        if (arrayList4 != null && arrayList4.size() < size) {
                            str = this.s.get(0);
                        }
                    } else {
                        str = this.s.get(size);
                    }
                } else {
                    str = this.s.get(0);
                }
            } else {
                str = this.s.get(size);
            }
            bundle.putInt("pt_manual_carousel_current", size);
            bundle.remove("right_swipe");
            bundle.putString("wzrk_dl", str);
            bundle.putInt("manual_carousel_from", i2);
            this.k.setOnClickPendingIntent(R.id.rightArrowPos0, g.b(context, i, bundle, false, 4, null));
            this.k.setOnClickPendingIntent(R.id.leftArrowPos0, g.b(context, i, bundle, false, 5, null));
            PendingIntent b2 = g.b(context, i, bundle, true, 3, null);
            e.i iVar = x != null ? new e.i(context, x) : o(this.y, "pt_silent_sound_channel", context);
            PendingIntent b3 = g.b(context, i, bundle, false, 6, null);
            s(context);
            r(iVar, this.i, this.k, this.n, b2, b3);
            this.z.notify(i, iVar.g());
        } catch (Throwable th) {
            com.clevertap.android.pushtemplates.a.d("Error creating manual carousel notification ", th);
        }
    }

    public void l(android.content.Context r13, android.os.Bundle r14) {
        throw new UnsupportedOperationException("Method not decompiled: com.clevertap.android.pushtemplates.PushTemplateReceiver.l(android.content.Context, android.os.Bundle):void");
    }

    private void m(Context context, Bundle bundle, int i, String str, CleverTapInstanceConfig cleverTapInstanceConfig) throws InterruptedException {
        Intent launchIntentForPackage;
        Thread.sleep(1000L);
        this.z.cancel(i);
        u(context, this.G, 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")));
            o0.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) {
        Class<CTNotificationIntentService> cls;
        try {
            int i = bundle.getInt("notificationId");
            if (bundle.getBoolean("default_dl", false)) {
                this.I = (CleverTapInstanceConfig) bundle.getParcelable("config");
                this.z.cancel(i);
                try {
                    cls = CTNotificationIntentService.class;
                    String str = CTNotificationIntentService.MAIN_ACTION;
                } catch (ClassNotFoundException unused) {
                    com.clevertap.android.pushtemplates.a.a("No Intent Service found");
                    cls = null;
                }
                if (o0.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.q);
                    context.startService(intent2);
                    return;
                }
                Intent intent3 = new Intent("android.intent.action.VIEW", Uri.parse(this.q));
                intent3.removeExtra("wzrk_acts");
                intent3.putExtra("wzrk_from", "CTPushNotificationReceiver");
                intent3.setFlags(872415232);
                d.N(context, bundle, this.I);
                intent3.putExtras(bundle);
                intent3.putExtra("wzrk_dl", this.q);
                context.startActivity(intent3);
                return;
            }
            String str2 = this.s.get(0);
            if (1 == bundle.getInt("clickedStar", 0)) {
                bundle.putString("wzrk_c2a", "rating_1");
                if (this.s.size() > 0) {
                    str2 = this.s.get(0);
                }
            }
            if (2 == bundle.getInt("clickedStar", 0)) {
                bundle.putString("wzrk_c2a", "rating_2");
                str2 = this.s.size() > 1 ? this.s.get(1) : this.s.get(0);
            }
            if (3 == bundle.getInt("clickedStar", 0)) {
                bundle.putString("wzrk_c2a", "rating_3");
                str2 = this.s.size() > 2 ? this.s.get(2) : this.s.get(0);
            }
            if (4 == bundle.getInt("clickedStar", 0)) {
                bundle.putString("wzrk_c2a", "rating_4");
                str2 = this.s.size() > 3 ? this.s.get(3) : this.s.get(0);
            }
            if (5 == bundle.getInt("clickedStar", 0)) {
                bundle.putString("wzrk_c2a", "rating_5");
                str2 = this.s.size() > 4 ? this.s.get(4) : this.s.get(0);
            }
            String str3 = str2;
            int i2 = Build.VERSION.SDK_INT;
            Notification x = d.x(context, i);
            if (x != null) {
                this.j = x.bigContentView;
                this.i = x.contentView;
            }
            if (1 == bundle.getInt("clickedStar", 0)) {
                this.j.setImageViewResource(R.id.star1, R.drawable.pt_star_filled);
                this.a = false;
            } else {
                this.j.setImageViewResource(R.id.star1, R.drawable.pt_star_outline);
            }
            if (2 == bundle.getInt("clickedStar", 0)) {
                RemoteViews remoteViews = this.j;
                int i3 = R.id.star1;
                int i4 = R.drawable.pt_star_filled;
                remoteViews.setImageViewResource(i3, i4);
                this.j.setImageViewResource(R.id.star2, i4);
                this.b = false;
            } else {
                this.j.setImageViewResource(R.id.star2, R.drawable.pt_star_outline);
            }
            if (3 == bundle.getInt("clickedStar", 0)) {
                RemoteViews remoteViews2 = this.j;
                int i5 = R.id.star1;
                int i6 = R.drawable.pt_star_filled;
                remoteViews2.setImageViewResource(i5, i6);
                this.j.setImageViewResource(R.id.star2, i6);
                this.j.setImageViewResource(R.id.star3, i6);
                this.c = false;
            } else {
                this.j.setImageViewResource(R.id.star3, R.drawable.pt_star_outline);
            }
            if (4 == bundle.getInt("clickedStar", 0)) {
                RemoteViews remoteViews3 = this.j;
                int i7 = R.id.star1;
                int i8 = R.drawable.pt_star_filled;
                remoteViews3.setImageViewResource(i7, i8);
                this.j.setImageViewResource(R.id.star2, i8);
                this.j.setImageViewResource(R.id.star3, i8);
                this.j.setImageViewResource(R.id.star4, i8);
                this.d = false;
            } else {
                this.j.setImageViewResource(R.id.star4, R.drawable.pt_star_outline);
            }
            if (5 == bundle.getInt("clickedStar", 0)) {
                RemoteViews remoteViews4 = this.j;
                int i9 = R.id.star1;
                int i10 = R.drawable.pt_star_filled;
                remoteViews4.setImageViewResource(i9, i10);
                this.j.setImageViewResource(R.id.star2, i10);
                this.j.setImageViewResource(R.id.star3, i10);
                this.j.setImageViewResource(R.id.star4, i10);
                this.j.setImageViewResource(R.id.star5, i10);
                this.e = false;
            } else {
                this.j.setImageViewResource(R.id.star5, R.drawable.pt_star_outline);
            }
            h(context, intent);
            bundle.putString("wzrk_dl", str3);
            this.j.setOnClickPendingIntent(R.id.tVRatingConfirmation, f.a(bundle, context));
            s(context);
            e.i iVar = x != null ? new e.i(context, x) : o(this.y, "pt_silent_sound_channel", context);
            PendingIntent c = g.c(context, bundle, new Intent(context, (Class<?>) PushTemplateReceiver.class));
            if (this.z != null) {
                iVar.S(this.x).y(this.i).x(this.j).w(this.n).A(c).l(true);
                this.z.notify(i, iVar.g());
            }
            d.M(context, this.I, "Rating Submitted", d.c(bundle));
            if (i2 < 31) {
                m(context, bundle, i, str3, this.I);
            }
        } catch (Throwable th) {
            com.clevertap.android.pushtemplates.a.d("Error creating rating notification ", th);
        }
    }

    private e.i o(boolean z, String str, Context context) {
        return z ? new e.i(context, str) : new e.i(context);
    }

    private void p(RemoteViews remoteViews, Context context) {
        int i = R.id.app_name;
        remoteViews.setTextViewText(i, d.l(context));
        int i2 = R.id.timestamp;
        remoteViews.setTextViewText(i2, d.B(context));
        String str = this.H;
        if (str == null || str.isEmpty()) {
            remoteViews.setViewVisibility(R.id.subtitle, 8);
            remoteViews.setViewVisibility(R.id.sep_subtitle, 8);
        } else {
            remoteViews.setTextViewText(R.id.subtitle, Html.fromHtml(this.H, 0));
        }
        String str2 = this.E;
        if (str2 == null || str2.isEmpty()) {
            return;
        }
        remoteViews.setTextColor(i, d.o(this.E, "#A6A6A6"));
        remoteViews.setTextColor(i2, d.o(this.E, "#A6A6A6"));
        remoteViews.setTextColor(R.id.subtitle, d.o(this.E, "#A6A6A6"));
    }

    private void q(Bundle bundle) {
        String str = this.n;
        if (str == null || str.isEmpty()) {
            this.n = bundle.getString("nt");
        }
        String str2 = this.o;
        if (str2 == null || str2.isEmpty()) {
            this.o = bundle.getString("nm");
        }
        String str3 = this.p;
        if (str3 == null || str3.isEmpty()) {
            this.p = bundle.getString("wzrk_nms");
        }
        String str4 = this.D;
        if (str4 == null || str4.isEmpty()) {
            this.D = bundle.getString("wzrk_bp");
        }
        String str5 = this.q;
        if (str5 == null || str5.isEmpty()) {
            this.q = bundle.getString("wzrk_dl");
        }
        String str6 = this.E;
        if (str6 == null || str6.isEmpty()) {
            this.E = bundle.getString("wzrk_clr");
        }
        String str7 = this.C;
        if (str7 == null || str7.isEmpty()) {
            this.C = bundle.getString("wzrk_clr");
        }
        String str8 = this.H;
        if (str8 == null || str8.isEmpty()) {
            this.H = bundle.getString("wzrk_st");
        }
        String str9 = this.C;
        if (str9 == null || str9.isEmpty()) {
            this.C = bundle.getString("wzrk_clr");
        }
    }

    private void r(e.i iVar, RemoteViews remoteViews, RemoteViews remoteViews2, String str, PendingIntent pendingIntent, PendingIntent pendingIntent2) {
        iVar.S(this.x).y(remoteViews).x(remoteViews2).w(Html.fromHtml(str)).A(pendingIntent2).u(pendingIntent).z(5).e0(System.currentTimeMillis()).l(true);
    }

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

    private void t(String str, Bundle bundle, Context context, e.i iVar) {
        e.f o;
        if (str == null || !str.startsWith("http")) {
            o = new e.g().o(bundle.getString("pt_input_feedback"));
        } else {
            try {
                Bitmap w = d.w(str, false, context);
                if (w == null) {
                    throw new Exception("Failed to fetch big picture!");
                }
                o = new e.f().t(bundle.getString("pt_input_feedback")).q(w);
            } catch (Throwable th) {
                e.f o2 = new e.g().o(bundle.getString("pt_input_feedback"));
                com.clevertap.android.pushtemplates.a.d("Falling back to big text notification, couldn't fetch big picture", th);
                o = o2;
            }
        }
        iVar.X(o);
    }

    private void u(Context context, String str, CleverTapInstanceConfig cleverTapInstanceConfig) {
        if (str == null || str.isEmpty()) {
            return;
        }
        d.R(context, str, cleverTapInstanceConfig);
    }

    @Override
    public void onReceive(Context context, Intent intent) {
        String str;
        NotificationChannel notificationChannel;
        d.d(context);
        if (intent.getExtras() != null) {
            Bundle extras = intent.getExtras();
            this.g = h.k0(context, extras.getString("wzrk_acct_id"));
            this.l = intent.getStringExtra("pt_id");
            this.o = extras.getString("pt_msg");
            this.p = extras.getString("pt_msg_summary");
            this.n = extras.getString("pt_title");
            this.q = extras.getString("pt_default_dl");
            this.r = d.v(extras);
            this.s = d.p(extras);
            this.t = d.m(extras);
            this.u = d.A(extras);
            this.v = d.z(extras);
            this.A = extras.getString("pt_product_display_linear");
            this.z = (NotificationManager) context.getSystemService("notification");
            this.w = extras.getString("wzrk_cid", "");
            this.B = extras.getString("pt_big_img_alt");
            this.C = extras.getString("pt_small_icon_clr");
            int i = Build.VERSION.SDK_INT;
            this.y = i >= 26;
            this.F = extras.getBoolean("pt_dismiss_intent", false);
            this.G = extras.getString("pt_rating_toast");
            this.H = extras.getString("pt_subtitle");
            q(extras);
            if (i >= 26) {
                if (this.w.isEmpty()) {
                    str = "Unable to render notification, channelId is required but not provided in the notification payload: " + extras.toString();
                } else {
                    NotificationManager notificationManager = this.z;
                    if (notificationManager != null) {
                        notificationChannel = notificationManager.getNotificationChannel(this.w);
                        if (notificationChannel == null) {
                            str = "Unable to render notification, channelId: " + this.w + " not registered by the app.";
                        }
                    }
                    str = null;
                }
                if (str != null) {
                    com.clevertap.android.pushtemplates.a.c(str);
                    return;
                }
            }
            String str2 = this.l;
            if (str2 != null) {
                this.m = com.microsoft.clarity.r6.d.i(str2);
            }
            h hVar = this.g;
            if (hVar == null) {
                com.clevertap.android.pushtemplates.a.c("clevertap instance is null, not running PushTemplateReceiver#renderNotification");
                return;
            }
            try {
                CleverTapInstanceConfig g = hVar.Z().g();
                this.I = g;
                com.microsoft.clarity.a8.a.c(g).d().g("PushTemplateReceiver#renderNotification", new a(context, intent, extras));
            } catch (Exception e) {
                com.clevertap.android.pushtemplates.a.c("Couldn't render notification: " + e.getLocalizedMessage());
            }
        }
    }
}