导航菜单

页面标题

页面副标题

CityMall v1.42.1 - CTFirebaseMessagingReceiver.java 源代码

正在查看: CityMall v1.42.1 应用的 CTFirebaseMessagingReceiver.java JAVA 源代码文件

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


package com.clevertap.android.sdk.pushnotification.fcm;

import L0.H;
import L0.j;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.os.CountDownTimer;
import com.clevertap.android.sdk.CleverTapAPI;
import com.clevertap.android.sdk.interfaces.NotificationRenderedListener;
import com.clevertap.android.sdk.pushnotification.f;
import com.clevertap.android.sdk.t;
import com.google.firebase.messaging.RemoteMessage;
import java.util.concurrent.TimeUnit;

public class CTFirebaseMessagingReceiver extends BroadcastReceiver implements NotificationRenderedListener {

    private CountDownTimer f13671a;

    private String f13672b = "";

    private boolean f13673c;

    private BroadcastReceiver.PendingResult f13674d;

    private long f13675e;

    class a extends CountDownTimer {
        a(long j5, long j6) {
            super(j5, j6);
        }

        @Override
        public void onFinish() {
            CTFirebaseMessagingReceiver.this.d("receiver life time is expired");
        }

        @Override
        public void onTick(long j5) {
        }
    }

    public void d(String str) {
        try {
            t.s("CTRM", "got a signal to kill receiver and timer because " + str);
            if (!this.f13672b.trim().isEmpty()) {
                CleverTapAPI.s1(this.f13672b);
            }
            long nanoTime = System.nanoTime();
            if (this.f13674d == null || this.f13673c) {
                t.s("CTRM", "have already informed OS to kill receiver, can not inform again else OS will get angry :-O");
                return;
            }
            t.s("CTRM", "informing OS to kill receiver...");
            this.f13674d.finish();
            this.f13673c = true;
            CountDownTimer countDownTimer = this.f13671a;
            if (countDownTimer != null) {
                countDownTimer.cancel();
            }
            t.s("CTRM", "informed OS to kill receiver...");
            t.s("CTRM", "receiver was alive for " + TimeUnit.NANOSECONDS.toSeconds(nanoTime - this.f13675e) + " seconds");
        } catch (Exception e5) {
            e5.printStackTrace();
        }
    }

    public void e(Context context, Bundle bundle) {
        try {
            try {
                CleverTapAPI k02 = CleverTapAPI.k0(context, f.b(bundle));
                if (k02 != null) {
                    j.e(k02, "CTRM#flushQueueSync", "PI_R", context);
                }
            } catch (Exception e5) {
                e5.printStackTrace();
                t.t("CTRM", "Failed executing CTRM flushQueueSync thread.", e5);
            }
        } finally {
            d("flush from receiver is done!");
        }
    }

    @Override
    public void a(boolean z4) {
        t.s("CTRM", "push impression sent successfully by core, i should inform OS to kill receiver. my callback key is " + this.f13672b);
        d("push impression sent successfully by core");
    }

    @Override
    public void onReceive(final Context context, Intent intent) {
        RemoteMessage remoteMessage;
        final Bundle a5;
        this.f13675e = System.nanoTime();
        t.e("CTRM", "received a message from Firebase");
        if (context == null || intent == null || (a5 = new d().a((remoteMessage = new RemoteMessage(intent.getExtras())))) == null) {
            return;
        }
        if (remoteMessage.getPriority() != 2) {
            t.e("CTRM", "returning from CTRM because message priority is not normal");
            return;
        }
        long parseLong = Long.parseLong(a5.getString("ctrmt", "4500"));
        this.f13674d = goAsync();
        if (!CleverTapAPI.r0(a5).f13668a) {
            t.s("CTRM", "Notification payload is not from CleverTap.");
            d("push is not from CleverTap.");
            return;
        }
        if (!H.w(remoteMessage, context)) {
            t.s("CTRM", "Notification payload does not have a fallback key.");
            d("isRenderFallback is false");
            return;
        }
        String a6 = f.a(f.b(a5), f.d(a5));
        this.f13672b = a6;
        CleverTapAPI.k(a6, this);
        a aVar = new a(parseLong, 1000L);
        this.f13671a = aVar;
        aVar.start();
        new Thread(new Runnable() {
            @Override
            public final void run() {
                CTFirebaseMessagingReceiver.this.e(context, a5);
            }
        }).start();
    }
}