导航菜单

页面标题

页面副标题

FanCode v7.24.0 - CTFirebaseMessagingReceiver.java 源代码

正在查看: FanCode v7.24.0 应用的 CTFirebaseMessagingReceiver.java JAVA 源代码文件

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


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

import android.annotation.SuppressLint;
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.h;
import com.clevertap.android.sdk.pushnotification.j;
import com.clevertap.android.sdk.t;
import com.connectsdk.service.webos.lgcast.common.utils.StringUtil;
import com.google.firebase.messaging.RemoteMessage;
import d6.m;
import d6.t1;
import java.util.concurrent.TimeUnit;

public class CTFirebaseMessagingReceiver extends BroadcastReceiver implements x6.e {

    private CountDownTimer f9938a;

    private String f9939b = StringUtil.EMPTY;

    private boolean f9940c;

    private BroadcastReceiver.PendingResult f9941d;

    private long f9942e;

    class a extends CountDownTimer {
        a(long j9, long j10) {
            super(j9, j10);
        }

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

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

    public void d(String str) {
        try {
            t.r("CTRM", "got a signal to kill receiver and timer because " + str);
            if (!this.f9939b.trim().isEmpty()) {
                h.i2(this.f9939b);
            }
            long nanoTime = System.nanoTime();
            if (this.f9941d == null || this.f9940c) {
                t.r("CTRM", "have already informed OS to kill receiver, can not inform again else OS will get angry :-O");
                return;
            }
            t.r("CTRM", "informing OS to kill receiver...");
            this.f9941d.finish();
            this.f9940c = true;
            CountDownTimer countDownTimer = this.f9938a;
            if (countDownTimer != null) {
                countDownTimer.cancel();
            }
            t.r("CTRM", "informed OS to kill receiver...");
            t.r("CTRM", "receiver was alive for " + TimeUnit.NANOSECONDS.toSeconds(nanoTime - this.f9942e) + " seconds");
        } catch (Exception e9) {
            e9.printStackTrace();
        }
    }

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

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

    @Override
    @SuppressLint({"RestrictedApi"})
    public void onReceive(final Context context, Intent intent) {
        RemoteMessage remoteMessage;
        final Bundle a9;
        this.f9942e = System.nanoTime();
        t.c("CTRM", "received a message from Firebase");
        if (context == null || intent == null || (a9 = new d().a((remoteMessage = new RemoteMessage(intent.getExtras())))) == null) {
            return;
        }
        if (remoteMessage.getPriority() != 2) {
            t.c("CTRM", "returning from CTRM because message priority is not normal");
            return;
        }
        long parseLong = Long.parseLong(a9.getString("ctrmt", "4500"));
        this.f9941d = goAsync();
        if (!h.I0(a9).f9954a) {
            t.r("CTRM", "Notification payload is not from CleverTap.");
            d("push is not from CleverTap.");
            return;
        }
        if (!t1.w(remoteMessage, context)) {
            t.r("CTRM", "Notification payload does not have a fallback key.");
            d("isRenderFallback is false");
            return;
        }
        String a10 = j.a(j.b(a9), j.d(a9));
        this.f9939b = a10;
        h.z(a10, this);
        a aVar = new a(parseLong, 1000L);
        this.f9938a = aVar;
        aVar.start();
        new Thread(new Runnable() {
            @Override
            public final void run() {
                CTFirebaseMessagingReceiver.this.e(context, a9);
            }
        }).start();
    }
}