导航菜单

页面标题

页面副标题

FanCode v7.24.0 - FCFirebaseMessagingService.java 源代码

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

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


package com.dream11sportsguru.utils;

import android.app.NotificationChannel;
import android.app.NotificationManager;
import android.graphics.Bitmap;
import android.media.RingtoneManager;
import android.os.Build;
import android.os.Bundle;
import androidx.core.app.q;
import androidx.media3.common.util.z;
import com.clevertap.android.sdk.h;
import com.clevertap.android.sdk.pushnotification.fcm.a;
import com.google.firebase.messaging.FirebaseMessagingService;
import com.google.firebase.messaging.RemoteMessage;
import com.newrelic.agent.android.instrumentation.BitmapFactoryInstrumentation;
import com.newrelic.agent.android.instrumentation.Instrumented;
import com.newrelic.agent.android.instrumentation.LogInstrumentation;
import com.newrelic.agent.android.instrumentation.URLConnectionInstrumentation;
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.Map;

@Instrumented
public class FCFirebaseMessagingService extends FirebaseMessagingService {
    private void c(RemoteMessage remoteMessage) {
        q.i iVar = new q.i(this, getResources().getString(2131886588));
        NotificationManager notificationManager = (NotificationManager) getSystemService("notification");
        if (Build.VERSION.SDK_INT >= 26) {
            NotificationChannel notificationChannel = new NotificationChannel(getResources().getString(2131886588), getResources().getString(2131886589), 3);
            notificationChannel.enableLights(true);
            notificationChannel.enableVibration(true);
            z.a(notificationManager, notificationChannel);
        }
        iVar.w(remoteMessage.g0().o()).v(remoteMessage.g0().a()).T(2131231569).W(RingtoneManager.getDefaultUri(2)).l(true);
        if (remoteMessage.g0().h() != null) {
            iVar.Y(new q.g()).G(d((String) remoteMessage.getData().get("image-url")));
        }
        notificationManager.notify(1, iVar.g());
    }

    public Bitmap d(String str) {
        try {
            HttpURLConnection httpURLConnection = (HttpURLConnection) URLConnectionInstrumentation.openConnection(new URL(str).openConnection());
            httpURLConnection.setDoInput(true);
            httpURLConnection.connect();
            return BitmapFactoryInstrumentation.decodeStream(httpURLConnection.getInputStream());
        } catch (Exception e) {
            LogInstrumentation.e("awesome", "Error in getting notification image: " + e.getLocalizedMessage());
            return null;
        }
    }

    public void onMessageReceived(RemoteMessage remoteMessage) {
        try {
            if (remoteMessage.getData().size() > 0) {
                Bundle bundle = new Bundle();
                for (Map.Entry entry : remoteMessage.getData().entrySet()) {
                    bundle.putString((String) entry.getKey(), (String) entry.getValue());
                }
                LogInstrumentation.e("TAG", "onReceived Message Called");
                if (h.I0(bundle).a) {
                    new a().a(getApplicationContext(), remoteMessage);
                } else {
                    c(remoteMessage);
                }
            }
        } catch (Throwable th) {
            LogInstrumentation.d("MYFCMLIST", "Error parsing FCM message", th);
        }
    }

    public void onNewToken(String str) {
        h.u0(this).X1(str, true);
    }
}