导航菜单

页面标题

页面副标题

OLX India v19.42.007 - CTFirebaseMessagingReceiver.java 源代码

正在查看: OLX India v19.42.007 应用的 CTFirebaseMessagingReceiver.java JAVA 源代码文件

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


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

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.b0;
import com.clevertap.android.sdk.e1;
import com.clevertap.android.sdk.pushnotification.k;
import com.clevertap.android.sdk.s;
import com.clevertap.android.sdk.u1;
import com.google.firebase.messaging.RemoteMessage;
import java.util.concurrent.TimeUnit;

public class CTFirebaseMessagingReceiver extends BroadcastReceiver implements com.clevertap.android.sdk.interfaces.d {
    private CountDownTimer a;
    private String b = "";
    private boolean c;
    private BroadcastReceiver.PendingResult d;
    private long e;

    class a extends CountDownTimer {
        a(long j, long j2) {
            super(j, j2);
        }

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

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

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

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

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

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