正在查看: Chaupal v3.2 应用的 CTFirebaseMessagingReceiver.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: Chaupal v3.2 应用的 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.CleverTapAPI;
import com.clevertap.android.sdk.pushnotification.j;
import com.clevertap.android.sdk.t;
import com.google.firebase.messaging.RemoteMessage;
import java.util.concurrent.TimeUnit;
import r3.l;
import r3.x0;
public class CTFirebaseMessagingReceiver extends BroadcastReceiver implements b4.e {
private CountDownTimer f8983a;
private String f8984c = "";
private boolean f8985d;
private BroadcastReceiver.PendingResult f8986e;
private long f8987f;
class a extends CountDownTimer {
a(long j7, long j8) {
super(j7, j8);
}
@Override
public void onFinish() {
CTFirebaseMessagingReceiver.this.d("receiver life time is expired");
}
@Override
public void onTick(long j7) {
}
}
public void d(String str) {
try {
t.r("CTRM", "got a signal to kill receiver and timer because " + str);
if (!this.f8984c.trim().isEmpty()) {
CleverTapAPI.C0(this.f8984c);
}
long nanoTime = System.nanoTime();
if (this.f8986e == null || this.f8985d) {
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.f8986e.finish();
this.f8985d = true;
CountDownTimer countDownTimer = this.f8983a;
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.f8987f) + " seconds");
} catch (Exception e7) {
e7.printStackTrace();
}
}
public void e(Context context, Bundle bundle) {
try {
try {
CleverTapAPI K = CleverTapAPI.K(context, j.b(bundle));
if (K != null) {
l.e(K, "CTRM#flushQueueSync", "PI_R", context);
}
} catch (Exception e7) {
e7.printStackTrace();
t.s("CTRM", "Failed executing CTRM flushQueueSync thread.", e7);
}
} finally {
d("flush from receiver is done!");
}
}
@Override
public void a(boolean z6) {
t.r("CTRM", "push impression sent successfully by core, i should inform OS to kill receiver. my callback key is " + this.f8984c);
d("push impression sent successfully by core");
}
@Override
public void onReceive(final Context context, Intent intent) {
RemoteMessage remoteMessage;
final Bundle a7;
this.f8987f = System.nanoTime();
t.c("CTRM", "received a message from Firebase");
if (context == null || intent == null || (a7 = 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(a7.getString("ctrmt", "4500"));
this.f8986e = goAsync();
if (!CleverTapAPI.P(a7).f8999a) {
t.r("CTRM", "Notification payload is not from CleverTap.");
d("push is not from CleverTap.");
return;
}
if (!x0.v(remoteMessage, context)) {
t.r("CTRM", "Notification payload does not have a fallback key.");
d("isRenderFallback is false");
return;
}
String a9 = j.a(j.b(a7), j.d(a7));
this.f8984c = a9;
CleverTapAPI.o(a9, this);
a aVar = new a(parseLong, 1000L);
this.f8983a = aVar;
aVar.start();
new Thread(new Runnable() {
@Override
public final void run() {
CTFirebaseMessagingReceiver.this.e(context, a7);
}
}).start();
}
}