导航菜单

页面标题

页面副标题

Chaupal v3.2 - FirebaseNotificationMessagingService.java 源代码

正在查看: Chaupal v3.2 应用的 FirebaseNotificationMessagingService.java JAVA 源代码文件

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


package com.yupptv.ott.cloudmessaging;

import android.app.NotificationChannel;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.content.Intent;
import android.os.Build;
import android.os.Bundle;
import androidx.core.app.m;
import androidx.work.d;
import androidx.work.k;
import androidx.work.r;
import com.appsflyer.AppsFlyerLib;
import com.clevertap.android.sdk.CleverTapAPI;
import com.clevertap.android.sdk.pushnotification.a;
import com.google.firebase.messaging.FirebaseMessagingService;
import com.google.firebase.messaging.RemoteMessage;
import com.razorpay.R;
import com.yupptv.ott.OTTApplication;
import hd.e;
import hd.e0;
import hd.h;
import java.util.HashMap;
import java.util.Map;

public class FirebaseNotificationMessagingService extends FirebaseMessagingService implements a {
    private Bundle d(Map<String, String> map) {
        Bundle bundle = new Bundle(map != null ? map.size() : 0);
        if (map != null) {
            for (Map.Entry<String, String> entry : map.entrySet()) {
                bundle.putString(entry.getKey(), entry.getValue());
            }
        }
        return bundle;
    }

    private void e(String str) {
        Intent intent = new Intent(getApplicationContext(), (Class<?>) RichPushService.class);
        intent.addFlags(67108864);
        PendingIntent activity = PendingIntent.getActivity(this, 0, intent, 1140850688);
        String string = getString(R.string.app_name);
        m.i B = new m.i(this).Z(2131755008).D(getString(R.string.app_name)).C(str).s(true).B(activity);
        NotificationManager notificationManager = (NotificationManager) getSystemService("notification");
        if (Build.VERSION.SDK_INT >= 26) {
            notificationManager.createNotificationChannel(new NotificationChannel(string, "default", 3));
        }
        notificationManager.notify(0, B.g());
    }

    public void a(HashMap<String, Object> hashMap) {
    }

    @Override
    public void onMessageReceived(RemoteMessage remoteMessage) {
        h.b("FirebaseNotificationMessagingService", "message receiced  " + remoteMessage.getData().toString());
        if (e0.S(this)) {
            e.u = false;
            Bundle bundle = new Bundle();
            for (Map.Entry<String, String> entry : remoteMessage.getData().entrySet()) {
                bundle.putString(entry.getKey(), entry.getValue());
            }
            if (CleverTapAPI.H(this) != null) {
                CleverTapAPI.H(this).J0(this);
            }
            com.clevertap.android.sdk.pushnotification.h P = CleverTapAPI.P(bundle);
            if (P != null && P.a) {
                new com.clevertap.android.sdk.pushnotification.fcm.a().a(this, remoteMessage);
                h.b("FCM MSG ", " msg from ct");
                return;
            }
            if (remoteMessage.p1() != null) {
                h.b("FirebaseNotificationMessagingService", "Notification Body: " + remoteMessage.p1().a());
            }
            Map<String, String> data = remoteMessage.getData();
            if (data.size() == 0 && remoteMessage.p1() != null) {
                data = new HashMap<>();
                data.put("payload", remoteMessage.p1().c());
                data.put("message", remoteMessage.p1().a());
                data.put("launchurl", "");
            } else if (remoteMessage.p1() != null) {
                if (!data.containsKey("payload")) {
                    data.put("payload", remoteMessage.p1().c());
                }
                if (!data.containsKey("message")) {
                    data.put("message", remoteMessage.p1().a());
                }
            }
            if (data.containsKey("af-uinstall-tracking")) {
                return;
            }
            Intent intent = new Intent(getApplicationContext(), (Class<?>) RichPushService.class);
            intent.putExtras(d(data));
            int i = Build.VERSION.SDK_INT;
            if (i >= 31) {
                d.a aVar = new d.a();
                for (Map.Entry<String, String> entry2 : data.entrySet()) {
                    aVar.e(entry2.getKey(), entry2.getValue());
                }
                r.h(OTTApplication.o()).c(new k.a(RichPushWorkManager.class).f(aVar.a()).b());
            } else if (i >= 26) {
                startForegroundService(intent);
            } else {
                startService(intent);
            }
            if (remoteMessage.p1() != null) {
                h.b("FirebaseNotificationMessagingService", "Notification Body: " + remoteMessage.p1().a());
                e(remoteMessage.p1().a());
            }
        }
    }

    @Override
    public void onNewToken(String str) {
        super.onNewToken(str);
        h.a("FirebaseNotification", "onNewToken token: " + str);
        AppsFlyerLib.getInstance().updateServerUninstallToken(getApplicationContext(), str);
    }
}