导航菜单

页面标题

页面副标题

Súper Préstamo v1.9.1 - MyFirebaseMessagingService.java 源代码

正在查看: Súper Préstamo v1.9.1 应用的 MyFirebaseMessagingService.java JAVA 源代码文件

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


package com.pf.prestafast.gms;

import android.app.NotificationManager;
import android.app.PendingIntent;
import android.content.Intent;
import android.media.RingtoneManager;
import android.os.Build;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.view.WindowManager;
import androidx.core.app.NotificationCompat;
import com.google.android.gms.common.internal.ImagesContract;
import com.google.firebase.messaging.FirebaseMessagingService;
import com.google.firebase.messaging.RemoteMessage;
import com.pf.prestafast.R$layout;
import com.pf.prestafast.R$mipmap;
import com.pf.prestafast.view.activity.MainActivity;
import defpackage.f30;
import defpackage.yc0;

public final class MyFirebaseMessagingService extends FirebaseMessagingService {

    public static final class a implements View.OnTouchListener {
        public int a;
        public int b;
        public float c;
        public float d;
        public final WindowManager.LayoutParams e;
        public final WindowManager f;
        public final View h;

        public a(WindowManager.LayoutParams layoutParams, WindowManager windowManager, View view) {
            this.e = layoutParams;
            this.f = windowManager;
            this.h = view;
        }

        @Override
        public boolean onTouch(View view, MotionEvent motionEvent) {
            f30.h(view, "view");
            f30.h(motionEvent, "event");
            int action = motionEvent.getAction();
            if (action == 0) {
                WindowManager.LayoutParams layoutParams = this.e;
                this.a = layoutParams.x;
                this.b = layoutParams.y;
                this.c = motionEvent.getRawX();
                this.d = motionEvent.getRawY();
                return true;
            }
            if (action == 1) {
                this.f.removeView(this.h);
                return true;
            }
            if (action != 2) {
                return false;
            }
            this.e.x = this.a + ((int) (motionEvent.getRawX() - this.c));
            this.e.y = this.b + ((int) (motionEvent.getRawY() - this.d));
            this.f.updateViewLayout(this.h, this.e);
            return true;
        }
    }

    public final void c(String str, String str2, String str3) {
        try {
            Intent intent = new Intent(this, (Class<?>) MainActivity.class);
            intent.addFlags(67108864);
            intent.putExtra(ImagesContract.URL, str3);
            NotificationCompat.Builder contentIntent = new NotificationCompat.Builder(this, "1").setTicker(str).setSmallIcon(R$mipmap.ic_launcher).setContentTitle(str).setContentText(str2).setAutoCancel(true).setDefaults(-1).setPriority(1).setSound(RingtoneManager.getDefaultUri(2)).setContentIntent(PendingIntent.getActivity(this, 0, intent, 201326592));
            f30.g(contentIntent, "Builder(this, channelId)…tentIntent(pendingIntent)");
            Object systemService = getSystemService("notification");
            f30.f(systemService, "null cannot be cast to non-null type android.app.NotificationManager");
            NotificationManager notificationManager = (NotificationManager) systemService;
            int i = Build.VERSION.SDK_INT;
            if (i >= 26) {
                yc0.a();
                yd0.a(notificationManager, be0.a("1", "notification", 3));
            }
            notificationManager.notify(1, contentIntent.build());
            View inflate = LayoutInflater.from(this).inflate(R$layout.notification_layout, (ViewGroup) null);
            Object systemService2 = getSystemService("window");
            f30.f(systemService2, "null cannot be cast to non-null type android.view.WindowManager");
            WindowManager windowManager = (WindowManager) systemService2;
            WindowManager.LayoutParams layoutParams = new WindowManager.LayoutParams(-2, -2, i >= 26 ? 2038 : 2002, 520, -3);
            layoutParams.gravity = 8388659;
            layoutParams.x = 0;
            layoutParams.y = 0;
            windowManager.addView(inflate, layoutParams);
            inflate.setOnTouchListener(new a(layoutParams, windowManager, inflate));
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    @Override
    public void onMessageReceived(RemoteMessage remoteMessage) {
        f30.h(remoteMessage, "message");
        super.onMessageReceived(remoteMessage);
        if (remoteMessage.getNotification() != null) {
            RemoteMessage.Notification notification = remoteMessage.getNotification();
            if ((notification != null ? notification.getBody() : null) != null) {
                RemoteMessage.Notification notification2 = remoteMessage.getNotification();
                String title = notification2 != null ? notification2.getTitle() : null;
                RemoteMessage.Notification notification3 = remoteMessage.getNotification();
                c(title, notification3 != null ? notification3.getBody() : null, remoteMessage.getData().get(ImagesContract.URL));
                return;
            }
        }
        c(remoteMessage.getData().get("title"), remoteMessage.getData().get("body"), remoteMessage.getData().get(ImagesContract.URL));
    }

    @Override
    public void onNewToken(String str) {
        f30.h(str, "token");
        super.onNewToken(str);
    }
}