Initial import of ADIF API reverse-engineering toolkit
This commit is contained in:
@@ -0,0 +1,98 @@
|
||||
package com.google.firebase.messaging;
|
||||
|
||||
import C.w;
|
||||
import com.google.firebase.encoders.FieldDescriptor;
|
||||
import com.google.firebase.encoders.ObjectEncoder;
|
||||
import com.google.firebase.encoders.ObjectEncoderContext;
|
||||
import com.google.firebase.encoders.config.Configurator;
|
||||
import com.google.firebase.encoders.config.EncoderConfig;
|
||||
import com.google.firebase.messaging.reporting.MessagingClientEvent;
|
||||
import com.google.firebase.messaging.reporting.MessagingClientEventExtension;
|
||||
import com.google.firebase.remoteconfig.RemoteConfigConstants;
|
||||
import java.io.IOException;
|
||||
|
||||
/* loaded from: classes3.dex */
|
||||
public final class AutoProtoEncoderDoNotUseEncoder implements Configurator {
|
||||
public static final int CODEGEN_VERSION = 2;
|
||||
public static final Configurator CONFIG = new AutoProtoEncoderDoNotUseEncoder();
|
||||
|
||||
/* loaded from: classes3.dex */
|
||||
public static final class MessagingClientEventEncoder implements ObjectEncoder<MessagingClientEvent> {
|
||||
static final MessagingClientEventEncoder INSTANCE = new MessagingClientEventEncoder();
|
||||
private static final FieldDescriptor PROJECTNUMBER_DESCRIPTOR = w.e(1, FieldDescriptor.builder("projectNumber"));
|
||||
private static final FieldDescriptor MESSAGEID_DESCRIPTOR = w.e(2, FieldDescriptor.builder("messageId"));
|
||||
private static final FieldDescriptor INSTANCEID_DESCRIPTOR = w.e(3, FieldDescriptor.builder("instanceId"));
|
||||
private static final FieldDescriptor MESSAGETYPE_DESCRIPTOR = w.e(4, FieldDescriptor.builder("messageType"));
|
||||
private static final FieldDescriptor SDKPLATFORM_DESCRIPTOR = w.e(5, FieldDescriptor.builder("sdkPlatform"));
|
||||
private static final FieldDescriptor PACKAGENAME_DESCRIPTOR = w.e(6, FieldDescriptor.builder(RemoteConfigConstants.RequestFieldKey.PACKAGE_NAME));
|
||||
private static final FieldDescriptor COLLAPSEKEY_DESCRIPTOR = w.e(7, FieldDescriptor.builder("collapseKey"));
|
||||
private static final FieldDescriptor PRIORITY_DESCRIPTOR = w.e(8, FieldDescriptor.builder("priority"));
|
||||
private static final FieldDescriptor TTL_DESCRIPTOR = w.e(9, FieldDescriptor.builder("ttl"));
|
||||
private static final FieldDescriptor TOPIC_DESCRIPTOR = w.e(10, FieldDescriptor.builder("topic"));
|
||||
private static final FieldDescriptor BULKID_DESCRIPTOR = w.e(11, FieldDescriptor.builder("bulkId"));
|
||||
private static final FieldDescriptor EVENT_DESCRIPTOR = w.e(12, FieldDescriptor.builder("event"));
|
||||
private static final FieldDescriptor ANALYTICSLABEL_DESCRIPTOR = w.e(13, FieldDescriptor.builder("analyticsLabel"));
|
||||
private static final FieldDescriptor CAMPAIGNID_DESCRIPTOR = w.e(14, FieldDescriptor.builder("campaignId"));
|
||||
private static final FieldDescriptor COMPOSERLABEL_DESCRIPTOR = w.e(15, FieldDescriptor.builder("composerLabel"));
|
||||
|
||||
private MessagingClientEventEncoder() {
|
||||
}
|
||||
|
||||
@Override // com.google.firebase.encoders.Encoder
|
||||
public void encode(MessagingClientEvent messagingClientEvent, ObjectEncoderContext objectEncoderContext) throws IOException {
|
||||
objectEncoderContext.add(PROJECTNUMBER_DESCRIPTOR, messagingClientEvent.getProjectNumber());
|
||||
objectEncoderContext.add(MESSAGEID_DESCRIPTOR, messagingClientEvent.getMessageId());
|
||||
objectEncoderContext.add(INSTANCEID_DESCRIPTOR, messagingClientEvent.getInstanceId());
|
||||
objectEncoderContext.add(MESSAGETYPE_DESCRIPTOR, messagingClientEvent.getMessageType());
|
||||
objectEncoderContext.add(SDKPLATFORM_DESCRIPTOR, messagingClientEvent.getSdkPlatform());
|
||||
objectEncoderContext.add(PACKAGENAME_DESCRIPTOR, messagingClientEvent.getPackageName());
|
||||
objectEncoderContext.add(COLLAPSEKEY_DESCRIPTOR, messagingClientEvent.getCollapseKey());
|
||||
objectEncoderContext.add(PRIORITY_DESCRIPTOR, messagingClientEvent.getPriority());
|
||||
objectEncoderContext.add(TTL_DESCRIPTOR, messagingClientEvent.getTtl());
|
||||
objectEncoderContext.add(TOPIC_DESCRIPTOR, messagingClientEvent.getTopic());
|
||||
objectEncoderContext.add(BULKID_DESCRIPTOR, messagingClientEvent.getBulkId());
|
||||
objectEncoderContext.add(EVENT_DESCRIPTOR, messagingClientEvent.getEvent());
|
||||
objectEncoderContext.add(ANALYTICSLABEL_DESCRIPTOR, messagingClientEvent.getAnalyticsLabel());
|
||||
objectEncoderContext.add(CAMPAIGNID_DESCRIPTOR, messagingClientEvent.getCampaignId());
|
||||
objectEncoderContext.add(COMPOSERLABEL_DESCRIPTOR, messagingClientEvent.getComposerLabel());
|
||||
}
|
||||
}
|
||||
|
||||
/* loaded from: classes3.dex */
|
||||
public static final class MessagingClientEventExtensionEncoder implements ObjectEncoder<MessagingClientEventExtension> {
|
||||
static final MessagingClientEventExtensionEncoder INSTANCE = new MessagingClientEventExtensionEncoder();
|
||||
private static final FieldDescriptor MESSAGINGCLIENTEVENT_DESCRIPTOR = w.e(1, FieldDescriptor.builder("messagingClientEvent"));
|
||||
|
||||
private MessagingClientEventExtensionEncoder() {
|
||||
}
|
||||
|
||||
@Override // com.google.firebase.encoders.Encoder
|
||||
public void encode(MessagingClientEventExtension messagingClientEventExtension, ObjectEncoderContext objectEncoderContext) throws IOException {
|
||||
objectEncoderContext.add(MESSAGINGCLIENTEVENT_DESCRIPTOR, messagingClientEventExtension.getMessagingClientEventInternal());
|
||||
}
|
||||
}
|
||||
|
||||
/* loaded from: classes3.dex */
|
||||
public static final class ProtoEncoderDoNotUseEncoder implements ObjectEncoder<ProtoEncoderDoNotUse> {
|
||||
static final ProtoEncoderDoNotUseEncoder INSTANCE = new ProtoEncoderDoNotUseEncoder();
|
||||
private static final FieldDescriptor MESSAGINGCLIENTEVENTEXTENSION_DESCRIPTOR = FieldDescriptor.of("messagingClientEventExtension");
|
||||
|
||||
private ProtoEncoderDoNotUseEncoder() {
|
||||
}
|
||||
|
||||
@Override // com.google.firebase.encoders.Encoder
|
||||
public void encode(ProtoEncoderDoNotUse protoEncoderDoNotUse, ObjectEncoderContext objectEncoderContext) throws IOException {
|
||||
objectEncoderContext.add(MESSAGINGCLIENTEVENTEXTENSION_DESCRIPTOR, protoEncoderDoNotUse.getMessagingClientEventExtension());
|
||||
}
|
||||
}
|
||||
|
||||
private AutoProtoEncoderDoNotUseEncoder() {
|
||||
}
|
||||
|
||||
@Override // com.google.firebase.encoders.config.Configurator
|
||||
public void configure(EncoderConfig<?> encoderConfig) {
|
||||
encoderConfig.registerEncoder(ProtoEncoderDoNotUse.class, ProtoEncoderDoNotUseEncoder.INSTANCE);
|
||||
encoderConfig.registerEncoder(MessagingClientEventExtension.class, MessagingClientEventExtensionEncoder.INSTANCE);
|
||||
encoderConfig.registerEncoder(MessagingClientEvent.class, MessagingClientEventEncoder.INSTANCE);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package com.google.firebase.messaging;
|
||||
|
||||
/* loaded from: classes3.dex */
|
||||
public final class BuildConfig {
|
||||
public static final String BUILD_TYPE = "release";
|
||||
public static final boolean DEBUG = false;
|
||||
public static final String LIBRARY_PACKAGE_NAME = "com.google.firebase.messaging";
|
||||
public static final String VERSION_NAME = "23.4.0";
|
||||
}
|
||||
@@ -0,0 +1,147 @@
|
||||
package com.google.firebase.messaging;
|
||||
|
||||
import java.io.FilterInputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.util.ArrayDeque;
|
||||
import java.util.Arrays;
|
||||
import java.util.Queue;
|
||||
import kotlin.jvm.internal.IntCompanionObject;
|
||||
|
||||
/* loaded from: classes3.dex */
|
||||
final class ByteStreams {
|
||||
private static final int BUFFER_SIZE = 8192;
|
||||
private static final int MAX_ARRAY_LEN = 2147483639;
|
||||
private static final int TO_BYTE_ARRAY_DEQUE_SIZE = 20;
|
||||
|
||||
private ByteStreams() {
|
||||
}
|
||||
|
||||
private static byte[] combineBuffers(Queue<byte[]> queue, int i) {
|
||||
if (queue.isEmpty()) {
|
||||
return new byte[0];
|
||||
}
|
||||
byte[] remove = queue.remove();
|
||||
if (remove.length == i) {
|
||||
return remove;
|
||||
}
|
||||
int length = i - remove.length;
|
||||
byte[] copyOf = Arrays.copyOf(remove, i);
|
||||
while (length > 0) {
|
||||
byte[] remove2 = queue.remove();
|
||||
int min = Math.min(length, remove2.length);
|
||||
System.arraycopy(remove2, 0, copyOf, i - length, min);
|
||||
length -= min;
|
||||
}
|
||||
return copyOf;
|
||||
}
|
||||
|
||||
public static byte[] createBuffer() {
|
||||
return new byte[8192];
|
||||
}
|
||||
|
||||
public static InputStream limit(InputStream inputStream, long j4) {
|
||||
return new LimitedInputStream(inputStream, j4);
|
||||
}
|
||||
|
||||
private static int saturatedCast(long j4) {
|
||||
if (j4 > 2147483647L) {
|
||||
return Integer.MAX_VALUE;
|
||||
}
|
||||
return j4 < -2147483648L ? IntCompanionObject.MIN_VALUE : (int) j4;
|
||||
}
|
||||
|
||||
public static byte[] toByteArray(InputStream inputStream) throws IOException {
|
||||
return toByteArrayInternal(inputStream, new ArrayDeque(20), 0);
|
||||
}
|
||||
|
||||
private static byte[] toByteArrayInternal(InputStream inputStream, Queue<byte[]> queue, int i) throws IOException {
|
||||
int min = Math.min(8192, Math.max(128, Integer.highestOneBit(i) * 2));
|
||||
while (i < MAX_ARRAY_LEN) {
|
||||
int min2 = Math.min(min, MAX_ARRAY_LEN - i);
|
||||
byte[] bArr = new byte[min2];
|
||||
queue.add(bArr);
|
||||
int i4 = 0;
|
||||
while (i4 < min2) {
|
||||
int read = inputStream.read(bArr, i4, min2 - i4);
|
||||
if (read == -1) {
|
||||
return combineBuffers(queue, i);
|
||||
}
|
||||
i4 += read;
|
||||
i += read;
|
||||
}
|
||||
min = saturatedCast(min * (min < 4096 ? 4 : 2));
|
||||
}
|
||||
if (inputStream.read() == -1) {
|
||||
return combineBuffers(queue, MAX_ARRAY_LEN);
|
||||
}
|
||||
throw new OutOfMemoryError("input is too large to fit in a byte array");
|
||||
}
|
||||
|
||||
/* loaded from: classes3.dex */
|
||||
public static final class LimitedInputStream extends FilterInputStream {
|
||||
private long left;
|
||||
private long mark;
|
||||
|
||||
public LimitedInputStream(InputStream inputStream, long j4) {
|
||||
super(inputStream);
|
||||
this.mark = -1L;
|
||||
this.left = j4;
|
||||
}
|
||||
|
||||
@Override // java.io.FilterInputStream, java.io.InputStream
|
||||
public int available() throws IOException {
|
||||
return (int) Math.min(((FilterInputStream) this).in.available(), this.left);
|
||||
}
|
||||
|
||||
@Override // java.io.FilterInputStream, java.io.InputStream
|
||||
public synchronized void mark(int i) {
|
||||
((FilterInputStream) this).in.mark(i);
|
||||
this.mark = this.left;
|
||||
}
|
||||
|
||||
@Override // java.io.FilterInputStream, java.io.InputStream
|
||||
public int read() throws IOException {
|
||||
if (this.left == 0) {
|
||||
return -1;
|
||||
}
|
||||
int read = ((FilterInputStream) this).in.read();
|
||||
if (read != -1) {
|
||||
this.left--;
|
||||
}
|
||||
return read;
|
||||
}
|
||||
|
||||
@Override // java.io.FilterInputStream, java.io.InputStream
|
||||
public synchronized void reset() throws IOException {
|
||||
if (!((FilterInputStream) this).in.markSupported()) {
|
||||
throw new IOException("Mark not supported");
|
||||
}
|
||||
if (this.mark == -1) {
|
||||
throw new IOException("Mark not set");
|
||||
}
|
||||
((FilterInputStream) this).in.reset();
|
||||
this.left = this.mark;
|
||||
}
|
||||
|
||||
@Override // java.io.FilterInputStream, java.io.InputStream
|
||||
public long skip(long j4) throws IOException {
|
||||
long skip = ((FilterInputStream) this).in.skip(Math.min(j4, this.left));
|
||||
this.left -= skip;
|
||||
return skip;
|
||||
}
|
||||
|
||||
@Override // java.io.FilterInputStream, java.io.InputStream
|
||||
public int read(byte[] bArr, int i, int i4) throws IOException {
|
||||
long j4 = this.left;
|
||||
if (j4 == 0) {
|
||||
return -1;
|
||||
}
|
||||
int read = ((FilterInputStream) this).in.read(bArr, i, (int) Math.min(i4, j4));
|
||||
if (read != -1) {
|
||||
this.left -= read;
|
||||
}
|
||||
return read;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,327 @@
|
||||
package com.google.firebase.messaging;
|
||||
|
||||
import C.t;
|
||||
import C.u;
|
||||
import android.annotation.TargetApi;
|
||||
import android.app.Notification;
|
||||
import android.app.NotificationChannel;
|
||||
import android.app.NotificationManager;
|
||||
import android.app.PendingIntent;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.ApplicationInfo;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.content.res.Resources;
|
||||
import android.graphics.Color;
|
||||
import android.media.RingtoneManager;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.os.SystemClock;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import com.google.android.gms.cloudmessaging.CloudMessagingReceiver;
|
||||
import com.google.firebase.messaging.Constants;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
/* loaded from: classes3.dex */
|
||||
public final class CommonNotificationBuilder {
|
||||
private static final String ACTION_RECEIVER = "com.google.android.c2dm.intent.RECEIVE";
|
||||
public static final String FCM_FALLBACK_NOTIFICATION_CHANNEL = "fcm_fallback_notification_channel";
|
||||
public static final String FCM_FALLBACK_NOTIFICATION_CHANNEL_LABEL = "fcm_fallback_notification_channel_label";
|
||||
private static final String FCM_FALLBACK_NOTIFICATION_CHANNEL_NAME_NO_RESOURCE = "Misc";
|
||||
private static final int ILLEGAL_RESOURCE_ID = 0;
|
||||
public static final String METADATA_DEFAULT_CHANNEL_ID = "com.google.firebase.messaging.default_notification_channel_id";
|
||||
public static final String METADATA_DEFAULT_COLOR = "com.google.firebase.messaging.default_notification_color";
|
||||
public static final String METADATA_DEFAULT_ICON = "com.google.firebase.messaging.default_notification_icon";
|
||||
private static final AtomicInteger requestCodeProvider = new AtomicInteger((int) SystemClock.elapsedRealtime());
|
||||
|
||||
/* loaded from: classes3.dex */
|
||||
public static class DisplayNotificationInfo {
|
||||
public final int id;
|
||||
public final u notificationBuilder;
|
||||
public final String tag;
|
||||
|
||||
public DisplayNotificationInfo(u uVar, String str, int i) {
|
||||
this.notificationBuilder = uVar;
|
||||
this.tag = str;
|
||||
this.id = i;
|
||||
}
|
||||
}
|
||||
|
||||
private CommonNotificationBuilder() {
|
||||
}
|
||||
|
||||
private static PendingIntent createContentIntent(Context context, NotificationParams notificationParams, String str, PackageManager packageManager) {
|
||||
Intent createTargetIntent = createTargetIntent(str, notificationParams, packageManager);
|
||||
if (createTargetIntent == null) {
|
||||
return null;
|
||||
}
|
||||
createTargetIntent.addFlags(67108864);
|
||||
createTargetIntent.putExtras(notificationParams.paramsWithReservedKeysRemoved());
|
||||
if (shouldUploadMetrics(notificationParams)) {
|
||||
createTargetIntent.putExtra(Constants.MessageNotificationKeys.ANALYTICS_DATA, notificationParams.paramsForAnalyticsIntent());
|
||||
}
|
||||
return PendingIntent.getActivity(context, generatePendingIntentRequestCode(), createTargetIntent, getPendingIntentFlags(1073741824));
|
||||
}
|
||||
|
||||
private static PendingIntent createDeleteIntent(Context context, Context context2, NotificationParams notificationParams) {
|
||||
if (shouldUploadMetrics(notificationParams)) {
|
||||
return createMessagingPendingIntent(context, context2, new Intent(CloudMessagingReceiver.IntentActionKeys.NOTIFICATION_DISMISS).putExtras(notificationParams.paramsForAnalyticsIntent()));
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private static PendingIntent createMessagingPendingIntent(Context context, Context context2, Intent intent) {
|
||||
return PendingIntent.getBroadcast(context, generatePendingIntentRequestCode(), new Intent(ACTION_RECEIVER).setPackage(context2.getPackageName()).putExtra(CloudMessagingReceiver.IntentKeys.WRAPPED_INTENT, intent), getPendingIntentFlags(1073741824));
|
||||
}
|
||||
|
||||
public static DisplayNotificationInfo createNotificationInfo(Context context, NotificationParams notificationParams) {
|
||||
Bundle manifestMetadata = getManifestMetadata(context.getPackageManager(), context.getPackageName());
|
||||
return createNotificationInfo(context, context, notificationParams, getOrCreateChannel(context, notificationParams.getNotificationChannelId(), manifestMetadata), manifestMetadata);
|
||||
}
|
||||
|
||||
private static Intent createTargetIntent(String str, NotificationParams notificationParams, PackageManager packageManager) {
|
||||
String string = notificationParams.getString(Constants.MessageNotificationKeys.CLICK_ACTION);
|
||||
if (!TextUtils.isEmpty(string)) {
|
||||
Intent intent = new Intent(string);
|
||||
intent.setPackage(str);
|
||||
intent.setFlags(268435456);
|
||||
return intent;
|
||||
}
|
||||
Uri link = notificationParams.getLink();
|
||||
if (link != null) {
|
||||
Intent intent2 = new Intent("android.intent.action.VIEW");
|
||||
intent2.setPackage(str);
|
||||
intent2.setData(link);
|
||||
return intent2;
|
||||
}
|
||||
Intent launchIntentForPackage = packageManager.getLaunchIntentForPackage(str);
|
||||
if (launchIntentForPackage == null) {
|
||||
Log.w(Constants.TAG, "No activity found to launch app");
|
||||
}
|
||||
return launchIntentForPackage;
|
||||
}
|
||||
|
||||
private static int generatePendingIntentRequestCode() {
|
||||
return requestCodeProvider.incrementAndGet();
|
||||
}
|
||||
|
||||
private static Integer getColor(Context context, String str, Bundle bundle) {
|
||||
if (!TextUtils.isEmpty(str)) {
|
||||
try {
|
||||
return Integer.valueOf(Color.parseColor(str));
|
||||
} catch (IllegalArgumentException unused) {
|
||||
Log.w(Constants.TAG, "Color is invalid: " + str + ". Notification will use default color.");
|
||||
}
|
||||
}
|
||||
int i = bundle.getInt(METADATA_DEFAULT_COLOR, 0);
|
||||
if (i == 0) {
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
return Integer.valueOf(D.h.getColor(context, i));
|
||||
} catch (Resources.NotFoundException unused2) {
|
||||
Log.w(Constants.TAG, "Cannot find the color resource referenced in AndroidManifest.");
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
/* JADX WARN: Type inference failed for: r0v2, types: [int] */
|
||||
/* JADX WARN: Type inference failed for: r0v5 */
|
||||
/* JADX WARN: Type inference failed for: r0v6 */
|
||||
private static int getConsolidatedDefaults(NotificationParams notificationParams) {
|
||||
boolean z3 = notificationParams.getBoolean(Constants.MessageNotificationKeys.DEFAULT_SOUND);
|
||||
?? r02 = z3;
|
||||
if (notificationParams.getBoolean(Constants.MessageNotificationKeys.DEFAULT_VIBRATE_TIMINGS)) {
|
||||
r02 = (z3 ? 1 : 0) | 2;
|
||||
}
|
||||
return notificationParams.getBoolean(Constants.MessageNotificationKeys.DEFAULT_LIGHT_SETTINGS) ? r02 | 4 : r02;
|
||||
}
|
||||
|
||||
private static Bundle getManifestMetadata(PackageManager packageManager, String str) {
|
||||
try {
|
||||
ApplicationInfo applicationInfo = packageManager.getApplicationInfo(str, 128);
|
||||
if (applicationInfo != null) {
|
||||
Bundle bundle = applicationInfo.metaData;
|
||||
if (bundle != null) {
|
||||
return bundle;
|
||||
}
|
||||
}
|
||||
} catch (PackageManager.NameNotFoundException e4) {
|
||||
Log.w(Constants.TAG, "Couldn't get own application info: " + e4);
|
||||
}
|
||||
return Bundle.EMPTY;
|
||||
}
|
||||
|
||||
@TargetApi(26)
|
||||
public static String getOrCreateChannel(Context context, String str, Bundle bundle) {
|
||||
String string;
|
||||
try {
|
||||
if (context.getPackageManager().getApplicationInfo(context.getPackageName(), 0).targetSdkVersion < 26) {
|
||||
return null;
|
||||
}
|
||||
NotificationManager notificationManager = (NotificationManager) context.getSystemService(NotificationManager.class);
|
||||
if (!TextUtils.isEmpty(str)) {
|
||||
if (notificationManager.getNotificationChannel(str) != null) {
|
||||
return str;
|
||||
}
|
||||
Log.w(Constants.TAG, "Notification Channel requested (" + str + ") has not been created by the app. Manifest configuration, or default, value will be used.");
|
||||
}
|
||||
String string2 = bundle.getString(METADATA_DEFAULT_CHANNEL_ID);
|
||||
if (TextUtils.isEmpty(string2)) {
|
||||
Log.w(Constants.TAG, "Missing Default Notification Channel metadata in AndroidManifest. Default value will be used.");
|
||||
} else {
|
||||
if (notificationManager.getNotificationChannel(string2) != null) {
|
||||
return string2;
|
||||
}
|
||||
Log.w(Constants.TAG, "Notification Channel set in AndroidManifest.xml has not been created by the app. Default value will be used.");
|
||||
}
|
||||
if (notificationManager.getNotificationChannel(FCM_FALLBACK_NOTIFICATION_CHANNEL) == null) {
|
||||
int identifier = context.getResources().getIdentifier(FCM_FALLBACK_NOTIFICATION_CHANNEL_LABEL, "string", context.getPackageName());
|
||||
if (identifier == 0) {
|
||||
Log.e(Constants.TAG, "String resource \"fcm_fallback_notification_channel_label\" is not found. Using default string channel name.");
|
||||
string = FCM_FALLBACK_NOTIFICATION_CHANNEL_NAME_NO_RESOURCE;
|
||||
} else {
|
||||
string = context.getString(identifier);
|
||||
}
|
||||
notificationManager.createNotificationChannel(new NotificationChannel(FCM_FALLBACK_NOTIFICATION_CHANNEL, string, 3));
|
||||
}
|
||||
return FCM_FALLBACK_NOTIFICATION_CHANNEL;
|
||||
} catch (PackageManager.NameNotFoundException unused) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private static int getPendingIntentFlags(int i) {
|
||||
return i | 67108864;
|
||||
}
|
||||
|
||||
private static int getSmallIcon(PackageManager packageManager, Resources resources, String str, String str2, Bundle bundle) {
|
||||
if (!TextUtils.isEmpty(str2)) {
|
||||
int identifier = resources.getIdentifier(str2, "drawable", str);
|
||||
if (identifier != 0 && isValidIcon(resources, identifier)) {
|
||||
return identifier;
|
||||
}
|
||||
int identifier2 = resources.getIdentifier(str2, "mipmap", str);
|
||||
if (identifier2 != 0 && isValidIcon(resources, identifier2)) {
|
||||
return identifier2;
|
||||
}
|
||||
Log.w(Constants.TAG, "Icon resource " + str2 + " not found. Notification will use default icon.");
|
||||
}
|
||||
int i = bundle.getInt(METADATA_DEFAULT_ICON, 0);
|
||||
if (i == 0 || !isValidIcon(resources, i)) {
|
||||
try {
|
||||
i = packageManager.getApplicationInfo(str, 0).icon;
|
||||
} catch (PackageManager.NameNotFoundException e4) {
|
||||
Log.w(Constants.TAG, "Couldn't get own application info: " + e4);
|
||||
}
|
||||
}
|
||||
return (i == 0 || !isValidIcon(resources, i)) ? android.R.drawable.sym_def_app_icon : i;
|
||||
}
|
||||
|
||||
private static Uri getSound(String str, NotificationParams notificationParams, Resources resources) {
|
||||
String soundResourceName = notificationParams.getSoundResourceName();
|
||||
if (TextUtils.isEmpty(soundResourceName)) {
|
||||
return null;
|
||||
}
|
||||
if ("default".equals(soundResourceName) || resources.getIdentifier(soundResourceName, "raw", str) == 0) {
|
||||
return RingtoneManager.getDefaultUri(2);
|
||||
}
|
||||
return Uri.parse("android.resource://" + str + "/raw/" + soundResourceName);
|
||||
}
|
||||
|
||||
private static String getTag(NotificationParams notificationParams) {
|
||||
String string = notificationParams.getString(Constants.MessageNotificationKeys.TAG);
|
||||
if (!TextUtils.isEmpty(string)) {
|
||||
return string;
|
||||
}
|
||||
return "FCM-Notification:" + SystemClock.uptimeMillis();
|
||||
}
|
||||
|
||||
@TargetApi(26)
|
||||
private static boolean isValidIcon(Resources resources, int i) {
|
||||
return true;
|
||||
}
|
||||
|
||||
public static boolean shouldUploadMetrics(NotificationParams notificationParams) {
|
||||
return notificationParams.getBoolean(Constants.AnalyticsKeys.ENABLED);
|
||||
}
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
/* JADX WARN: Type inference failed for: r4v6, types: [C.s, java.lang.Object, C.v] */
|
||||
public static DisplayNotificationInfo createNotificationInfo(Context context, Context context2, NotificationParams notificationParams, String str, Bundle bundle) {
|
||||
String packageName = context2.getPackageName();
|
||||
Resources resources = context2.getResources();
|
||||
PackageManager packageManager = context2.getPackageManager();
|
||||
u uVar = new u(context2, str);
|
||||
String possiblyLocalizedString = notificationParams.getPossiblyLocalizedString(resources, packageName, Constants.MessageNotificationKeys.TITLE);
|
||||
if (!TextUtils.isEmpty(possiblyLocalizedString)) {
|
||||
uVar.f252e = u.b(possiblyLocalizedString);
|
||||
}
|
||||
String possiblyLocalizedString2 = notificationParams.getPossiblyLocalizedString(resources, packageName, Constants.MessageNotificationKeys.BODY);
|
||||
if (!TextUtils.isEmpty(possiblyLocalizedString2)) {
|
||||
uVar.f253f = u.b(possiblyLocalizedString2);
|
||||
?? obj = new Object();
|
||||
obj.f247b = u.b(possiblyLocalizedString2);
|
||||
uVar.e(obj);
|
||||
}
|
||||
uVar.f265u.icon = getSmallIcon(packageManager, resources, packageName, notificationParams.getString(Constants.MessageNotificationKeys.ICON), bundle);
|
||||
Uri sound = getSound(packageName, notificationParams, resources);
|
||||
if (sound != null) {
|
||||
Notification notification = uVar.f265u;
|
||||
notification.sound = sound;
|
||||
notification.audioStreamType = -1;
|
||||
notification.audioAttributes = t.a(t.e(t.c(t.b(), 4), 5));
|
||||
}
|
||||
uVar.f254g = createContentIntent(context, notificationParams, packageName, packageManager);
|
||||
PendingIntent createDeleteIntent = createDeleteIntent(context, context2, notificationParams);
|
||||
if (createDeleteIntent != null) {
|
||||
uVar.f265u.deleteIntent = createDeleteIntent;
|
||||
}
|
||||
Integer color = getColor(context2, notificationParams.getString(Constants.MessageNotificationKeys.COLOR), bundle);
|
||||
if (color != null) {
|
||||
uVar.f261q = color.intValue();
|
||||
}
|
||||
uVar.c(!notificationParams.getBoolean(Constants.MessageNotificationKeys.STICKY));
|
||||
uVar.f260o = notificationParams.getBoolean(Constants.MessageNotificationKeys.LOCAL_ONLY);
|
||||
String string = notificationParams.getString(Constants.MessageNotificationKeys.TICKER);
|
||||
if (string != null) {
|
||||
uVar.f265u.tickerText = u.b(string);
|
||||
}
|
||||
Integer notificationPriority = notificationParams.getNotificationPriority();
|
||||
if (notificationPriority != null) {
|
||||
uVar.f255j = notificationPriority.intValue();
|
||||
}
|
||||
Integer visibility = notificationParams.getVisibility();
|
||||
if (visibility != null) {
|
||||
uVar.f262r = visibility.intValue();
|
||||
}
|
||||
Integer notificationCount = notificationParams.getNotificationCount();
|
||||
if (notificationCount != null) {
|
||||
uVar.i = notificationCount.intValue();
|
||||
}
|
||||
Long l4 = notificationParams.getLong(Constants.MessageNotificationKeys.EVENT_TIME);
|
||||
if (l4 != null) {
|
||||
uVar.f256k = true;
|
||||
uVar.f265u.when = l4.longValue();
|
||||
}
|
||||
long[] vibrateTimings = notificationParams.getVibrateTimings();
|
||||
if (vibrateTimings != null) {
|
||||
uVar.f265u.vibrate = vibrateTimings;
|
||||
}
|
||||
int[] lightSettings = notificationParams.getLightSettings();
|
||||
if (lightSettings != null) {
|
||||
int i = lightSettings[0];
|
||||
int i4 = lightSettings[1];
|
||||
int i5 = lightSettings[2];
|
||||
Notification notification2 = uVar.f265u;
|
||||
notification2.ledARGB = i;
|
||||
notification2.ledOnMS = i4;
|
||||
notification2.ledOffMS = i5;
|
||||
notification2.flags = (notification2.flags & (-2)) | ((i4 == 0 || i5 == 0) ? 0 : 1);
|
||||
}
|
||||
uVar.d(getConsolidatedDefaults(notificationParams));
|
||||
return new DisplayNotificationInfo(uVar, getTag(notificationParams), 0);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,161 @@
|
||||
package com.google.firebase.messaging;
|
||||
|
||||
import android.os.Bundle;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
/* loaded from: classes3.dex */
|
||||
public final class Constants {
|
||||
public static final String FCM_WAKE_LOCK = "wake:com.google.firebase.messaging";
|
||||
public static final String IPC_BUNDLE_KEY_SEND_ERROR = "error";
|
||||
public static final String TAG = "FirebaseMessaging";
|
||||
public static final long WAKE_LOCK_ACQUIRE_TIMEOUT_MILLIS = TimeUnit.MINUTES.toMillis(3);
|
||||
|
||||
/* loaded from: classes3.dex */
|
||||
public static final class AnalyticsKeys {
|
||||
public static final String ABT_EXPERIMENT = "google.c.a.abt";
|
||||
public static final String COMPOSER_ID = "google.c.a.c_id";
|
||||
public static final String COMPOSER_LABEL = "google.c.a.c_l";
|
||||
public static final String ENABLED = "google.c.a.e";
|
||||
public static final String MESSAGE_CHANNEL = "google.c.a.m_c";
|
||||
public static final String MESSAGE_LABEL = "google.c.a.m_l";
|
||||
public static final String MESSAGE_TIMESTAMP = "google.c.a.ts";
|
||||
public static final String MESSAGE_USE_DEVICE_TIME = "google.c.a.udt";
|
||||
public static final String PREFIX = "google.c.a.";
|
||||
public static final String TRACK_CONVERSIONS = "google.c.a.tc";
|
||||
|
||||
private AnalyticsKeys() {
|
||||
}
|
||||
}
|
||||
|
||||
/* loaded from: classes3.dex */
|
||||
public static final class FirelogAnalytics {
|
||||
public static final String FCM_LOG_SOURCE = "FCM_CLIENT_EVENT_LOGGING";
|
||||
|
||||
private FirelogAnalytics() {
|
||||
}
|
||||
}
|
||||
|
||||
/* loaded from: classes3.dex */
|
||||
public static final class MessageNotificationKeys {
|
||||
public static final String ANALYTICS_DATA = "gcm.n.analytics_data";
|
||||
public static final String BODY = "gcm.n.body";
|
||||
public static final String CHANNEL = "gcm.n.android_channel_id";
|
||||
public static final String CLICK_ACTION = "gcm.n.click_action";
|
||||
public static final String COLOR = "gcm.n.color";
|
||||
public static final String DEFAULT_LIGHT_SETTINGS = "gcm.n.default_light_settings";
|
||||
public static final String DEFAULT_SOUND = "gcm.n.default_sound";
|
||||
public static final String DEFAULT_VIBRATE_TIMINGS = "gcm.n.default_vibrate_timings";
|
||||
public static final String DO_NOT_PROXY = "gcm.n.dnp";
|
||||
public static final String ENABLE_NOTIFICATION = "gcm.n.e";
|
||||
public static final String EVENT_TIME = "gcm.n.event_time";
|
||||
public static final String ICON = "gcm.n.icon";
|
||||
public static final String IMAGE_URL = "gcm.n.image";
|
||||
public static final String LIGHT_SETTINGS = "gcm.n.light_settings";
|
||||
public static final String LINK = "gcm.n.link";
|
||||
public static final String LINK_ANDROID = "gcm.n.link_android";
|
||||
public static final String LOCAL_ONLY = "gcm.n.local_only";
|
||||
public static final String NOTIFICATION_COUNT = "gcm.n.notification_count";
|
||||
public static final String NOTIFICATION_PREFIX = "gcm.n.";
|
||||
public static final String NOTIFICATION_PREFIX_OLD = "gcm.notification.";
|
||||
public static final String NOTIFICATION_PRIORITY = "gcm.n.notification_priority";
|
||||
public static final String NO_UI = "gcm.n.noui";
|
||||
public static final String RESERVED_PREFIX = "gcm.";
|
||||
public static final String SOUND = "gcm.n.sound";
|
||||
public static final String SOUND_2 = "gcm.n.sound2";
|
||||
public static final String STICKY = "gcm.n.sticky";
|
||||
public static final String TAG = "gcm.n.tag";
|
||||
public static final String TEXT_ARGS_SUFFIX = "_loc_args";
|
||||
public static final String TEXT_RESOURCE_SUFFIX = "_loc_key";
|
||||
public static final String TICKER = "gcm.n.ticker";
|
||||
public static final String TITLE = "gcm.n.title";
|
||||
public static final String VIBRATE_TIMINGS = "gcm.n.vibrate_timings";
|
||||
public static final String VISIBILITY = "gcm.n.visibility";
|
||||
|
||||
private MessageNotificationKeys() {
|
||||
}
|
||||
}
|
||||
|
||||
/* loaded from: classes3.dex */
|
||||
public static final class MessagePayloadKeys {
|
||||
public static final String COLLAPSE_KEY = "collapse_key";
|
||||
public static final String DELIVERED_PRIORITY = "google.delivered_priority";
|
||||
public static final String FROM = "from";
|
||||
public static final String MESSAGE_TYPE = "message_type";
|
||||
public static final String MSGID = "google.message_id";
|
||||
public static final String MSGID_SERVER = "message_id";
|
||||
public static final String ORIGINAL_PRIORITY = "google.original_priority";
|
||||
public static final String PRIORITY_REDUCED_V19 = "google.priority_reduced";
|
||||
public static final String PRIORITY_V19 = "google.priority";
|
||||
public static final String PRODUCT_ID = "google.product_id";
|
||||
public static final String RAW_DATA = "rawData";
|
||||
public static final String RESERVED_CLIENT_LIB_PREFIX = "google.c.";
|
||||
public static final String RESERVED_PREFIX = "google.";
|
||||
public static final String SENDER_ID = "google.c.sender.id";
|
||||
public static final String SENT_TIME = "google.sent_time";
|
||||
public static final String TO = "google.to";
|
||||
public static final String TTL = "google.ttl";
|
||||
|
||||
private MessagePayloadKeys() {
|
||||
}
|
||||
|
||||
/* JADX WARN: Type inference failed for: r0v0, types: [s.e, s.j] */
|
||||
public static s.e extractDeveloperDefinedPayload(Bundle bundle) {
|
||||
?? jVar = new s.j(0);
|
||||
for (String str : bundle.keySet()) {
|
||||
Object obj = bundle.get(str);
|
||||
if (obj instanceof String) {
|
||||
String str2 = (String) obj;
|
||||
if (!str.startsWith(RESERVED_PREFIX) && !str.startsWith(MessageNotificationKeys.RESERVED_PREFIX) && !str.equals(FROM) && !str.equals(MESSAGE_TYPE) && !str.equals(COLLAPSE_KEY)) {
|
||||
jVar.put(str, str2);
|
||||
}
|
||||
}
|
||||
}
|
||||
return jVar;
|
||||
}
|
||||
}
|
||||
|
||||
/* loaded from: classes3.dex */
|
||||
public static final class MessageTypes {
|
||||
public static final String DELETED = "deleted_messages";
|
||||
public static final String MESSAGE = "gcm";
|
||||
public static final String SEND_ERROR = "send_error";
|
||||
public static final String SEND_EVENT = "send_event";
|
||||
|
||||
private MessageTypes() {
|
||||
}
|
||||
}
|
||||
|
||||
/* loaded from: classes3.dex */
|
||||
public static final class ScionAnalytics {
|
||||
public static final String EVENT_FIREBASE_CAMPAIGN = "_cmp";
|
||||
public static final String EVENT_NOTIFICATION_DISMISS = "_nd";
|
||||
public static final String EVENT_NOTIFICATION_FOREGROUND = "_nf";
|
||||
public static final String EVENT_NOTIFICATION_OPEN = "_no";
|
||||
public static final String EVENT_NOTIFICATION_RECEIVE = "_nr";
|
||||
public static final String ORIGIN_FCM = "fcm";
|
||||
public static final String PARAM_CAMPAIGN = "campaign";
|
||||
static final String PARAM_COMPOSER_ID = "_nmid";
|
||||
public static final String PARAM_LABEL = "label";
|
||||
public static final String PARAM_MEDIUM = "medium";
|
||||
public static final String PARAM_MESSAGE_CHANNEL = "message_channel";
|
||||
public static final String PARAM_MESSAGE_DEVICE_TIME = "_ndt";
|
||||
public static final String PARAM_MESSAGE_NAME = "_nmn";
|
||||
public static final String PARAM_MESSAGE_TIME = "_nmt";
|
||||
public static final String PARAM_MESSAGE_TYPE = "_nmc";
|
||||
public static final String PARAM_SOURCE = "source";
|
||||
public static final String PARAM_TOPIC = "_nt";
|
||||
public static final String USER_PROPERTY_FIREBASE_LAST_NOTIFICATION = "_ln";
|
||||
|
||||
/* loaded from: classes3.dex */
|
||||
public @interface MessageType {
|
||||
public static final String DATA_MESSAGE = "data";
|
||||
public static final String DISPLAY_NOTIFICATION = "display";
|
||||
}
|
||||
|
||||
private ScionAnalytics() {
|
||||
}
|
||||
}
|
||||
|
||||
private Constants() {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,132 @@
|
||||
package com.google.firebase.messaging;
|
||||
|
||||
import C.u;
|
||||
import android.app.ActivityManager;
|
||||
import android.app.KeyguardManager;
|
||||
import android.app.NotificationManager;
|
||||
import android.content.Context;
|
||||
import android.graphics.Bitmap;
|
||||
import android.os.Process;
|
||||
import android.os.SystemClock;
|
||||
import android.util.Log;
|
||||
import androidx.core.graphics.drawable.IconCompat;
|
||||
import com.google.android.gms.common.util.PlatformVersion;
|
||||
import com.google.android.gms.tasks.Tasks;
|
||||
import com.google.firebase.messaging.CommonNotificationBuilder;
|
||||
import com.google.firebase.messaging.Constants;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.ExecutionException;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.concurrent.TimeoutException;
|
||||
|
||||
/* loaded from: classes3.dex */
|
||||
class DisplayNotification {
|
||||
private static final int IMAGE_DOWNLOAD_TIMEOUT_SECONDS = 5;
|
||||
private final Context context;
|
||||
private final ExecutorService networkIoExecutor;
|
||||
private final NotificationParams params;
|
||||
|
||||
public DisplayNotification(Context context, NotificationParams notificationParams, ExecutorService executorService) {
|
||||
this.networkIoExecutor = executorService;
|
||||
this.context = context;
|
||||
this.params = notificationParams;
|
||||
}
|
||||
|
||||
private boolean isAppForeground() {
|
||||
if (((KeyguardManager) this.context.getSystemService("keyguard")).inKeyguardRestrictedInputMode()) {
|
||||
return false;
|
||||
}
|
||||
if (!PlatformVersion.isAtLeastLollipop()) {
|
||||
SystemClock.sleep(10L);
|
||||
}
|
||||
int myPid = Process.myPid();
|
||||
List<ActivityManager.RunningAppProcessInfo> runningAppProcesses = ((ActivityManager) this.context.getSystemService("activity")).getRunningAppProcesses();
|
||||
if (runningAppProcesses != null) {
|
||||
Iterator<ActivityManager.RunningAppProcessInfo> it = runningAppProcesses.iterator();
|
||||
while (true) {
|
||||
if (!it.hasNext()) {
|
||||
break;
|
||||
}
|
||||
ActivityManager.RunningAppProcessInfo next = it.next();
|
||||
if (next.pid == myPid) {
|
||||
if (next.importance == 100) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private void showNotification(CommonNotificationBuilder.DisplayNotificationInfo displayNotificationInfo) {
|
||||
if (Log.isLoggable(Constants.TAG, 3)) {
|
||||
Log.d(Constants.TAG, "Showing notification");
|
||||
}
|
||||
((NotificationManager) this.context.getSystemService("notification")).notify(displayNotificationInfo.tag, displayNotificationInfo.id, displayNotificationInfo.notificationBuilder.a());
|
||||
}
|
||||
|
||||
private ImageDownload startImageDownloadInBackground() {
|
||||
ImageDownload create = ImageDownload.create(this.params.getString(Constants.MessageNotificationKeys.IMAGE_URL));
|
||||
if (create != null) {
|
||||
create.start(this.networkIoExecutor);
|
||||
}
|
||||
return create;
|
||||
}
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
/* JADX WARN: Type inference failed for: r3v2, types: [C.r, java.lang.Object, C.v] */
|
||||
private void waitForAndApplyImageDownload(u uVar, ImageDownload imageDownload) {
|
||||
IconCompat iconCompat;
|
||||
IconCompat iconCompat2;
|
||||
if (imageDownload == null) {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
Bitmap bitmap = (Bitmap) Tasks.await(imageDownload.getTask(), 5L, TimeUnit.SECONDS);
|
||||
if (bitmap == null) {
|
||||
iconCompat = null;
|
||||
} else {
|
||||
uVar.getClass();
|
||||
iconCompat = new IconCompat(1);
|
||||
iconCompat.f2785b = bitmap;
|
||||
}
|
||||
uVar.h = iconCompat;
|
||||
?? obj = new Object();
|
||||
if (bitmap == null) {
|
||||
iconCompat2 = null;
|
||||
} else {
|
||||
iconCompat2 = new IconCompat(1);
|
||||
iconCompat2.f2785b = bitmap;
|
||||
}
|
||||
obj.f244b = iconCompat2;
|
||||
obj.f245c = null;
|
||||
obj.f246d = true;
|
||||
uVar.e(obj);
|
||||
} catch (InterruptedException unused) {
|
||||
Log.w(Constants.TAG, "Interrupted while downloading image, showing notification without it");
|
||||
imageDownload.close();
|
||||
Thread.currentThread().interrupt();
|
||||
} catch (ExecutionException e4) {
|
||||
Log.w(Constants.TAG, "Failed to download image: " + e4.getCause());
|
||||
} catch (TimeoutException unused2) {
|
||||
Log.w(Constants.TAG, "Failed to download image in time, showing notification without it");
|
||||
imageDownload.close();
|
||||
}
|
||||
}
|
||||
|
||||
public boolean handleNotification() {
|
||||
if (this.params.getBoolean(Constants.MessageNotificationKeys.NO_UI)) {
|
||||
return true;
|
||||
}
|
||||
if (isAppForeground()) {
|
||||
return false;
|
||||
}
|
||||
ImageDownload startImageDownloadInBackground = startImageDownloadInBackground();
|
||||
CommonNotificationBuilder.DisplayNotificationInfo createNotificationInfo = CommonNotificationBuilder.createNotificationInfo(this.context, this.params);
|
||||
waitForAndApplyImageDownload(createNotificationInfo.notificationBuilder, startImageDownloadInBackground);
|
||||
showNotification(createNotificationInfo);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,140 @@
|
||||
package com.google.firebase.messaging;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.Service;
|
||||
import android.content.Intent;
|
||||
import android.os.Binder;
|
||||
import android.os.IBinder;
|
||||
import android.util.Log;
|
||||
import com.google.android.gms.common.annotation.KeepForSdk;
|
||||
import com.google.android.gms.tasks.OnCompleteListener;
|
||||
import com.google.android.gms.tasks.Task;
|
||||
import com.google.android.gms.tasks.TaskCompletionSource;
|
||||
import com.google.android.gms.tasks.Tasks;
|
||||
import com.google.firebase.messaging.WithinAppServiceBinder;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import n.ExecutorC0507a;
|
||||
|
||||
@SuppressLint({"UnwrappedWakefulBroadcastReceiver"})
|
||||
/* loaded from: classes3.dex */
|
||||
public abstract class EnhancedIntentService extends Service {
|
||||
static final long MESSAGE_TIMEOUT_S = 20;
|
||||
private static final String TAG = "EnhancedIntentService";
|
||||
private Binder binder;
|
||||
private int lastStartId;
|
||||
final ExecutorService executor = FcmExecutors.newIntentHandleExecutor();
|
||||
private final Object lock = new Object();
|
||||
private int runningTasks = 0;
|
||||
|
||||
private void finishTask(Intent intent) {
|
||||
if (intent != null) {
|
||||
WakeLockHolder.completeWakefulIntent(intent);
|
||||
}
|
||||
synchronized (this.lock) {
|
||||
try {
|
||||
int i = this.runningTasks - 1;
|
||||
this.runningTasks = i;
|
||||
if (i == 0) {
|
||||
stopSelfResultHook(this.lastStartId);
|
||||
}
|
||||
} catch (Throwable th) {
|
||||
throw th;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: private */
|
||||
public /* synthetic */ void lambda$onStartCommand$1(Intent intent, Task task) {
|
||||
finishTask(intent);
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: private */
|
||||
public /* synthetic */ void lambda$processIntent$0(Intent intent, TaskCompletionSource taskCompletionSource) {
|
||||
try {
|
||||
handleIntent(intent);
|
||||
} finally {
|
||||
taskCompletionSource.setResult(null);
|
||||
}
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: private */
|
||||
public Task<Void> processIntent(final Intent intent) {
|
||||
if (handleIntentOnMainThread(intent)) {
|
||||
return Tasks.forResult(null);
|
||||
}
|
||||
final TaskCompletionSource taskCompletionSource = new TaskCompletionSource();
|
||||
this.executor.execute(new Runnable() { // from class: com.google.firebase.messaging.b
|
||||
@Override // java.lang.Runnable
|
||||
public final void run() {
|
||||
EnhancedIntentService.this.lambda$processIntent$0(intent, taskCompletionSource);
|
||||
}
|
||||
});
|
||||
return taskCompletionSource.getTask();
|
||||
}
|
||||
|
||||
public Intent getStartCommandIntent(Intent intent) {
|
||||
return intent;
|
||||
}
|
||||
|
||||
public abstract void handleIntent(Intent intent);
|
||||
|
||||
public boolean handleIntentOnMainThread(Intent intent) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override // android.app.Service
|
||||
public final synchronized IBinder onBind(Intent intent) {
|
||||
try {
|
||||
if (Log.isLoggable(TAG, 3)) {
|
||||
Log.d(TAG, "Service received bind request");
|
||||
}
|
||||
if (this.binder == null) {
|
||||
this.binder = new WithinAppServiceBinder(new WithinAppServiceBinder.IntentHandler() { // from class: com.google.firebase.messaging.EnhancedIntentService.1
|
||||
@Override // com.google.firebase.messaging.WithinAppServiceBinder.IntentHandler
|
||||
@KeepForSdk
|
||||
public Task<Void> handle(Intent intent2) {
|
||||
return EnhancedIntentService.this.processIntent(intent2);
|
||||
}
|
||||
});
|
||||
}
|
||||
} catch (Throwable th) {
|
||||
throw th;
|
||||
}
|
||||
return this.binder;
|
||||
}
|
||||
|
||||
@Override // android.app.Service
|
||||
public void onDestroy() {
|
||||
this.executor.shutdown();
|
||||
super.onDestroy();
|
||||
}
|
||||
|
||||
@Override // android.app.Service
|
||||
public final int onStartCommand(final Intent intent, int i, int i4) {
|
||||
synchronized (this.lock) {
|
||||
this.lastStartId = i4;
|
||||
this.runningTasks++;
|
||||
}
|
||||
Intent startCommandIntent = getStartCommandIntent(intent);
|
||||
if (startCommandIntent == null) {
|
||||
finishTask(intent);
|
||||
return 2;
|
||||
}
|
||||
Task<Void> processIntent = processIntent(startCommandIntent);
|
||||
if (processIntent.isComplete()) {
|
||||
finishTask(intent);
|
||||
return 2;
|
||||
}
|
||||
processIntent.addOnCompleteListener(new ExecutorC0507a(1), new OnCompleteListener() { // from class: com.google.firebase.messaging.a
|
||||
@Override // com.google.android.gms.tasks.OnCompleteListener
|
||||
public final void onComplete(Task task) {
|
||||
EnhancedIntentService.this.lambda$onStartCommand$1(intent, task);
|
||||
}
|
||||
});
|
||||
return 3;
|
||||
}
|
||||
|
||||
public boolean stopSelfResultHook(int i) {
|
||||
return stopSelfResult(i);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,128 @@
|
||||
package com.google.firebase.messaging;
|
||||
|
||||
import B0.w;
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.util.Base64;
|
||||
import android.util.Log;
|
||||
import com.google.android.gms.common.annotation.KeepForSdk;
|
||||
import com.google.android.gms.common.util.PlatformVersion;
|
||||
import com.google.android.gms.tasks.Continuation;
|
||||
import com.google.android.gms.tasks.Task;
|
||||
import com.google.android.gms.tasks.Tasks;
|
||||
import java.util.concurrent.Callable;
|
||||
import java.util.concurrent.Executor;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import n.ExecutorC0507a;
|
||||
|
||||
@KeepForSdk
|
||||
/* loaded from: classes3.dex */
|
||||
public class FcmBroadcastProcessor {
|
||||
private static final String EXTRA_BINARY_DATA = "rawData";
|
||||
private static final String EXTRA_BINARY_DATA_BASE_64 = "gcm.rawData64";
|
||||
private static WithinAppServiceConnection fcmServiceConn;
|
||||
private static final Object lock = new Object();
|
||||
private final Context context;
|
||||
private final Executor executor;
|
||||
|
||||
public FcmBroadcastProcessor(Context context) {
|
||||
this.context = context;
|
||||
this.executor = new ExecutorC0507a(1);
|
||||
}
|
||||
|
||||
private static Task<Integer> bindToMessagingService(Context context, Intent intent, boolean z3) {
|
||||
if (Log.isLoggable(Constants.TAG, 3)) {
|
||||
Log.d(Constants.TAG, "Binding to service");
|
||||
}
|
||||
WithinAppServiceConnection serviceConnection = getServiceConnection(context, "com.google.firebase.MESSAGING_EVENT");
|
||||
if (!z3) {
|
||||
return serviceConnection.sendIntent(intent).continueWith(new ExecutorC0507a(1), new w(15));
|
||||
}
|
||||
if (ServiceStarter.getInstance().hasWakeLockPermission(context)) {
|
||||
WakeLockHolder.sendWakefulServiceIntent(context, serviceConnection, intent);
|
||||
} else {
|
||||
serviceConnection.sendIntent(intent);
|
||||
}
|
||||
return Tasks.forResult(-1);
|
||||
}
|
||||
|
||||
private static WithinAppServiceConnection getServiceConnection(Context context, String str) {
|
||||
WithinAppServiceConnection withinAppServiceConnection;
|
||||
synchronized (lock) {
|
||||
try {
|
||||
if (fcmServiceConn == null) {
|
||||
fcmServiceConn = new WithinAppServiceConnection(context, str);
|
||||
}
|
||||
withinAppServiceConnection = fcmServiceConn;
|
||||
} catch (Throwable th) {
|
||||
throw th;
|
||||
}
|
||||
}
|
||||
return withinAppServiceConnection;
|
||||
}
|
||||
|
||||
public static /* synthetic */ Integer lambda$bindToMessagingService$3(Task task) throws Exception {
|
||||
return -1;
|
||||
}
|
||||
|
||||
public static /* synthetic */ Integer lambda$startMessagingService$0(Context context, Intent intent) throws Exception {
|
||||
return Integer.valueOf(ServiceStarter.getInstance().startMessagingService(context, intent));
|
||||
}
|
||||
|
||||
public static /* synthetic */ Integer lambda$startMessagingService$1(Task task) throws Exception {
|
||||
return 403;
|
||||
}
|
||||
|
||||
public static /* synthetic */ Task lambda$startMessagingService$2(Context context, Intent intent, boolean z3, Task task) throws Exception {
|
||||
return (PlatformVersion.isAtLeastO() && ((Integer) task.getResult()).intValue() == 402) ? bindToMessagingService(context, intent, z3).continueWith(new ExecutorC0507a(1), new w(14)) : task;
|
||||
}
|
||||
|
||||
public static void reset() {
|
||||
synchronized (lock) {
|
||||
fcmServiceConn = null;
|
||||
}
|
||||
}
|
||||
|
||||
public static void setServiceConnection(WithinAppServiceConnection withinAppServiceConnection) {
|
||||
synchronized (lock) {
|
||||
fcmServiceConn = withinAppServiceConnection;
|
||||
}
|
||||
}
|
||||
|
||||
@KeepForSdk
|
||||
public Task<Integer> process(Intent intent) {
|
||||
String stringExtra = intent.getStringExtra(EXTRA_BINARY_DATA_BASE_64);
|
||||
if (stringExtra != null) {
|
||||
intent.putExtra("rawData", Base64.decode(stringExtra, 0));
|
||||
intent.removeExtra(EXTRA_BINARY_DATA_BASE_64);
|
||||
}
|
||||
return startMessagingService(this.context, intent);
|
||||
}
|
||||
|
||||
@SuppressLint({"InlinedApi"})
|
||||
public Task<Integer> startMessagingService(final Context context, final Intent intent) {
|
||||
boolean z3 = PlatformVersion.isAtLeastO() && context.getApplicationInfo().targetSdkVersion >= 26;
|
||||
final boolean z4 = (intent.getFlags() & 268435456) != 0;
|
||||
return (!z3 || z4) ? Tasks.call(this.executor, new Callable() { // from class: com.google.firebase.messaging.c
|
||||
@Override // java.util.concurrent.Callable
|
||||
public final Object call() {
|
||||
Integer lambda$startMessagingService$0;
|
||||
lambda$startMessagingService$0 = FcmBroadcastProcessor.lambda$startMessagingService$0(context, intent);
|
||||
return lambda$startMessagingService$0;
|
||||
}
|
||||
}).continueWithTask(this.executor, new Continuation() { // from class: com.google.firebase.messaging.d
|
||||
@Override // com.google.android.gms.tasks.Continuation
|
||||
public final Object then(Task task) {
|
||||
Task lambda$startMessagingService$2;
|
||||
lambda$startMessagingService$2 = FcmBroadcastProcessor.lambda$startMessagingService$2(context, intent, z4, task);
|
||||
return lambda$startMessagingService$2;
|
||||
}
|
||||
}) : bindToMessagingService(context, intent, z4);
|
||||
}
|
||||
|
||||
public FcmBroadcastProcessor(Context context, ExecutorService executorService) {
|
||||
this.context = context;
|
||||
this.executor = executorService;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
package com.google.firebase.messaging;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import com.google.android.gms.common.util.concurrent.NamedThreadFactory;
|
||||
import com.google.firebase.messaging.threads.PoolableExecutors;
|
||||
import com.google.firebase.messaging.threads.ThreadPriority;
|
||||
import java.util.concurrent.Executor;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.Executors;
|
||||
import java.util.concurrent.LinkedBlockingQueue;
|
||||
import java.util.concurrent.ScheduledExecutorService;
|
||||
import java.util.concurrent.ScheduledThreadPoolExecutor;
|
||||
import java.util.concurrent.ThreadPoolExecutor;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: package-private */
|
||||
/* loaded from: classes3.dex */
|
||||
public class FcmExecutors {
|
||||
private static final String THREAD_FILE = "Firebase-Messaging-File";
|
||||
static final String THREAD_FILE_IO = "Firebase-Messaging-File-Io";
|
||||
private static final String THREAD_INIT = "Firebase-Messaging-Init";
|
||||
private static final String THREAD_INTENT_HANDLE = "Firebase-Messaging-Intent-Handle";
|
||||
private static final String THREAD_NETWORK_IO = "Firebase-Messaging-Network-Io";
|
||||
static final String THREAD_RPC_TASK = "Firebase-Messaging-Rpc-Task";
|
||||
private static final String THREAD_TASK = "Firebase-Messaging-Task";
|
||||
private static final String THREAD_TOPICS_IO = "Firebase-Messaging-Topics-Io";
|
||||
|
||||
private FcmExecutors() {
|
||||
}
|
||||
|
||||
@SuppressLint({"ThreadPoolCreation"})
|
||||
private static Executor newCachedSingleThreadExecutor(String str) {
|
||||
return new ThreadPoolExecutor(0, 1, 30L, TimeUnit.SECONDS, new LinkedBlockingQueue(), new NamedThreadFactory(str));
|
||||
}
|
||||
|
||||
@SuppressLint({"ThreadPoolCreation"})
|
||||
public static ExecutorService newFileExecutor() {
|
||||
return Executors.newSingleThreadExecutor(new NamedThreadFactory(THREAD_FILE));
|
||||
}
|
||||
|
||||
public static Executor newFileIOExecutor() {
|
||||
return newCachedSingleThreadExecutor(THREAD_FILE_IO);
|
||||
}
|
||||
|
||||
@SuppressLint({"ThreadPoolCreation"})
|
||||
public static ScheduledExecutorService newInitExecutor() {
|
||||
return new ScheduledThreadPoolExecutor(1, new NamedThreadFactory(THREAD_INIT));
|
||||
}
|
||||
|
||||
@SuppressLint({"ThreadPoolCreation"})
|
||||
public static ExecutorService newIntentHandleExecutor() {
|
||||
return PoolableExecutors.factory().newSingleThreadExecutor(new NamedThreadFactory(THREAD_INTENT_HANDLE), ThreadPriority.HIGH_SPEED);
|
||||
}
|
||||
|
||||
@SuppressLint({"ThreadPoolCreation"})
|
||||
public static ExecutorService newNetworkIOExecutor() {
|
||||
return Executors.newSingleThreadExecutor(new NamedThreadFactory(THREAD_NETWORK_IO));
|
||||
}
|
||||
|
||||
public static Executor newRpcTasksExecutor() {
|
||||
return newCachedSingleThreadExecutor(THREAD_RPC_TASK);
|
||||
}
|
||||
|
||||
@SuppressLint({"ThreadPoolCreation"})
|
||||
public static ExecutorService newTaskExecutor() {
|
||||
return Executors.newSingleThreadExecutor(new NamedThreadFactory(THREAD_TASK));
|
||||
}
|
||||
|
||||
@SuppressLint({"ThreadPoolCreation"})
|
||||
public static ScheduledExecutorService newTopicsSyncExecutor() {
|
||||
return new ScheduledThreadPoolExecutor(1, new NamedThreadFactory(THREAD_TOPICS_IO));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
package com.google.firebase.messaging;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.Activity;
|
||||
import android.app.Application;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
import com.google.firebase.messaging.Constants;
|
||||
import java.util.Collections;
|
||||
import java.util.Set;
|
||||
import java.util.WeakHashMap;
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: package-private */
|
||||
/* loaded from: classes3.dex */
|
||||
public class FcmLifecycleCallbacks implements Application.ActivityLifecycleCallbacks {
|
||||
private final Set<Intent> seenIntents = Collections.newSetFromMap(new WeakHashMap());
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: private */
|
||||
/* renamed from: logNotificationOpen, reason: merged with bridge method [inline-methods] */
|
||||
public void lambda$onActivityCreated$0(Intent intent) {
|
||||
Bundle bundle = null;
|
||||
try {
|
||||
Bundle extras = intent.getExtras();
|
||||
if (extras != null) {
|
||||
bundle = extras.getBundle(Constants.MessageNotificationKeys.ANALYTICS_DATA);
|
||||
}
|
||||
} catch (RuntimeException e4) {
|
||||
Log.w(Constants.TAG, "Failed trying to get analytics data from Intent extras.", e4);
|
||||
}
|
||||
if (MessagingAnalytics.shouldUploadScionMetrics(bundle)) {
|
||||
MessagingAnalytics.logNotificationOpen(bundle);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.app.Application.ActivityLifecycleCallbacks
|
||||
@SuppressLint({"ThreadPoolCreation"})
|
||||
public void onActivityCreated(Activity activity, Bundle bundle) {
|
||||
Intent intent = activity.getIntent();
|
||||
if (intent == null || !this.seenIntents.add(intent)) {
|
||||
return;
|
||||
}
|
||||
lambda$onActivityCreated$0(intent);
|
||||
}
|
||||
|
||||
@Override // android.app.Application.ActivityLifecycleCallbacks
|
||||
public void onActivityDestroyed(Activity activity) {
|
||||
}
|
||||
|
||||
@Override // android.app.Application.ActivityLifecycleCallbacks
|
||||
public void onActivityPaused(Activity activity) {
|
||||
if (activity.isFinishing()) {
|
||||
this.seenIntents.remove(activity.getIntent());
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.app.Application.ActivityLifecycleCallbacks
|
||||
public void onActivityResumed(Activity activity) {
|
||||
}
|
||||
|
||||
@Override // android.app.Application.ActivityLifecycleCallbacks
|
||||
public void onActivitySaveInstanceState(Activity activity, Bundle bundle) {
|
||||
}
|
||||
|
||||
@Override // android.app.Application.ActivityLifecycleCallbacks
|
||||
public void onActivityStarted(Activity activity) {
|
||||
}
|
||||
|
||||
@Override // android.app.Application.ActivityLifecycleCallbacks
|
||||
public void onActivityStopped(Activity activity) {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,534 @@
|
||||
package com.google.firebase.messaging;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.Application;
|
||||
import android.app.PendingIntent;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.content.pm.ApplicationInfo;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.os.Bundle;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import androidx.annotation.Keep;
|
||||
import com.google.android.gms.common.internal.Preconditions;
|
||||
import com.google.android.gms.common.util.concurrent.NamedThreadFactory;
|
||||
import com.google.android.gms.tasks.OnSuccessListener;
|
||||
import com.google.android.gms.tasks.Task;
|
||||
import com.google.android.gms.tasks.TaskCompletionSource;
|
||||
import com.google.android.gms.tasks.Tasks;
|
||||
import com.google.firebase.DataCollectionDefaultChange;
|
||||
import com.google.firebase.FirebaseApp;
|
||||
import com.google.firebase.events.Event;
|
||||
import com.google.firebase.events.EventHandler;
|
||||
import com.google.firebase.events.Subscriber;
|
||||
import com.google.firebase.heartbeatinfo.HeartBeatInfo;
|
||||
import com.google.firebase.iid.internal.FirebaseInstanceIdInternal;
|
||||
import com.google.firebase.inject.Provider;
|
||||
import com.google.firebase.installations.FirebaseInstallationsApi;
|
||||
import com.google.firebase.messaging.FirebaseMessaging;
|
||||
import com.google.firebase.messaging.Store;
|
||||
import com.google.firebase.platforminfo.UserAgentPublisher;
|
||||
import java.io.IOException;
|
||||
import java.util.concurrent.ExecutionException;
|
||||
import java.util.concurrent.Executor;
|
||||
import java.util.concurrent.ScheduledExecutorService;
|
||||
import java.util.concurrent.ScheduledThreadPoolExecutor;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
/* loaded from: classes3.dex */
|
||||
public class FirebaseMessaging {
|
||||
private static final String EXTRA_DUMMY_P_INTENT = "app";
|
||||
static final String GMS_PACKAGE = "com.google.android.gms";
|
||||
|
||||
@Deprecated
|
||||
public static final String INSTANCE_ID_SCOPE = "FCM";
|
||||
private static final long MAX_DELAY_SEC = TimeUnit.HOURS.toSeconds(8);
|
||||
private static final long MIN_DELAY_SEC = 30;
|
||||
private static final String SEND_INTENT_ACTION = "com.google.android.gcm.intent.SEND";
|
||||
private static final String SUBTYPE_DEFAULT = "";
|
||||
static final String TAG = "FirebaseMessaging";
|
||||
private static Store store;
|
||||
static ScheduledExecutorService syncExecutor;
|
||||
|
||||
@SuppressLint({"FirebaseUnknownNullness"})
|
||||
static T1.g transportFactory;
|
||||
private final AutoInit autoInit;
|
||||
private final Context context;
|
||||
private final Executor fileExecutor;
|
||||
private final FirebaseApp firebaseApp;
|
||||
private final FirebaseInstallationsApi fis;
|
||||
private final GmsRpc gmsRpc;
|
||||
private final FirebaseInstanceIdInternal iid;
|
||||
private final Executor initExecutor;
|
||||
private final Application.ActivityLifecycleCallbacks lifecycleCallbacks;
|
||||
private final Metadata metadata;
|
||||
private final RequestDeduplicator requestDeduplicator;
|
||||
private boolean syncScheduledOrRunning;
|
||||
private final Executor taskExecutor;
|
||||
private final Task<TopicsSubscriber> topicsSubscriberTask;
|
||||
|
||||
/* loaded from: classes3.dex */
|
||||
public class AutoInit {
|
||||
private static final String AUTO_INIT_PREF = "auto_init";
|
||||
private static final String FCM_PREFERENCES = "com.google.firebase.messaging";
|
||||
private static final String MANIFEST_METADATA_AUTO_INIT_ENABLED = "firebase_messaging_auto_init_enabled";
|
||||
private Boolean autoInitEnabled;
|
||||
private EventHandler<DataCollectionDefaultChange> dataCollectionDefaultChangeEventHandler;
|
||||
private boolean initialized;
|
||||
private final Subscriber subscriber;
|
||||
|
||||
public AutoInit(Subscriber subscriber) {
|
||||
this.subscriber = subscriber;
|
||||
}
|
||||
|
||||
public /* synthetic */ void lambda$initialize$0(Event event) {
|
||||
if (isEnabled()) {
|
||||
FirebaseMessaging.this.startSyncIfNecessary();
|
||||
}
|
||||
}
|
||||
|
||||
private Boolean readEnabled() {
|
||||
ApplicationInfo applicationInfo;
|
||||
Bundle bundle;
|
||||
Context applicationContext = FirebaseMessaging.this.firebaseApp.getApplicationContext();
|
||||
SharedPreferences sharedPreferences = applicationContext.getSharedPreferences("com.google.firebase.messaging", 0);
|
||||
if (sharedPreferences.contains(AUTO_INIT_PREF)) {
|
||||
return Boolean.valueOf(sharedPreferences.getBoolean(AUTO_INIT_PREF, false));
|
||||
}
|
||||
try {
|
||||
PackageManager packageManager = applicationContext.getPackageManager();
|
||||
if (packageManager == null || (applicationInfo = packageManager.getApplicationInfo(applicationContext.getPackageName(), 128)) == null || (bundle = applicationInfo.metaData) == null || !bundle.containsKey(MANIFEST_METADATA_AUTO_INIT_ENABLED)) {
|
||||
return null;
|
||||
}
|
||||
return Boolean.valueOf(applicationInfo.metaData.getBoolean(MANIFEST_METADATA_AUTO_INIT_ENABLED));
|
||||
} catch (PackageManager.NameNotFoundException unused) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public synchronized void initialize() {
|
||||
try {
|
||||
if (this.initialized) {
|
||||
return;
|
||||
}
|
||||
Boolean readEnabled = readEnabled();
|
||||
this.autoInitEnabled = readEnabled;
|
||||
if (readEnabled == null) {
|
||||
EventHandler<DataCollectionDefaultChange> eventHandler = new EventHandler() { // from class: com.google.firebase.messaging.j
|
||||
@Override // com.google.firebase.events.EventHandler
|
||||
public final void handle(Event event) {
|
||||
FirebaseMessaging.AutoInit.this.lambda$initialize$0(event);
|
||||
}
|
||||
};
|
||||
this.dataCollectionDefaultChangeEventHandler = eventHandler;
|
||||
this.subscriber.subscribe(DataCollectionDefaultChange.class, eventHandler);
|
||||
}
|
||||
this.initialized = true;
|
||||
} catch (Throwable th) {
|
||||
throw th;
|
||||
}
|
||||
}
|
||||
|
||||
public synchronized boolean isEnabled() {
|
||||
Boolean bool;
|
||||
try {
|
||||
initialize();
|
||||
bool = this.autoInitEnabled;
|
||||
} catch (Throwable th) {
|
||||
throw th;
|
||||
}
|
||||
return bool != null ? bool.booleanValue() : FirebaseMessaging.this.firebaseApp.isDataCollectionDefaultEnabled();
|
||||
}
|
||||
|
||||
public synchronized void setEnabled(boolean z3) {
|
||||
try {
|
||||
initialize();
|
||||
EventHandler<DataCollectionDefaultChange> eventHandler = this.dataCollectionDefaultChangeEventHandler;
|
||||
if (eventHandler != null) {
|
||||
this.subscriber.unsubscribe(DataCollectionDefaultChange.class, eventHandler);
|
||||
this.dataCollectionDefaultChangeEventHandler = null;
|
||||
}
|
||||
SharedPreferences.Editor edit = FirebaseMessaging.this.firebaseApp.getApplicationContext().getSharedPreferences("com.google.firebase.messaging", 0).edit();
|
||||
edit.putBoolean(AUTO_INIT_PREF, z3);
|
||||
edit.apply();
|
||||
if (z3) {
|
||||
FirebaseMessaging.this.startSyncIfNecessary();
|
||||
}
|
||||
this.autoInitEnabled = Boolean.valueOf(z3);
|
||||
} catch (Throwable th) {
|
||||
throw th;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public FirebaseMessaging(FirebaseApp firebaseApp, FirebaseInstanceIdInternal firebaseInstanceIdInternal, Provider<UserAgentPublisher> provider, Provider<HeartBeatInfo> provider2, FirebaseInstallationsApi firebaseInstallationsApi, T1.g gVar, Subscriber subscriber) {
|
||||
this(firebaseApp, firebaseInstanceIdInternal, provider, provider2, firebaseInstallationsApi, gVar, subscriber, new Metadata(firebaseApp.getApplicationContext()));
|
||||
}
|
||||
|
||||
public static synchronized void clearStoreForTest() {
|
||||
synchronized (FirebaseMessaging.class) {
|
||||
store = null;
|
||||
}
|
||||
}
|
||||
|
||||
public static void clearTransportFactoryForTest() {
|
||||
transportFactory = null;
|
||||
}
|
||||
|
||||
public static synchronized FirebaseMessaging getInstance() {
|
||||
FirebaseMessaging firebaseMessaging;
|
||||
synchronized (FirebaseMessaging.class) {
|
||||
firebaseMessaging = getInstance(FirebaseApp.getInstance());
|
||||
}
|
||||
return firebaseMessaging;
|
||||
}
|
||||
|
||||
private static synchronized Store getStore(Context context) {
|
||||
Store store2;
|
||||
synchronized (FirebaseMessaging.class) {
|
||||
try {
|
||||
if (store == null) {
|
||||
store = new Store(context);
|
||||
}
|
||||
store2 = store;
|
||||
} catch (Throwable th) {
|
||||
throw th;
|
||||
}
|
||||
}
|
||||
return store2;
|
||||
}
|
||||
|
||||
private String getSubtype() {
|
||||
return FirebaseApp.DEFAULT_APP_NAME.equals(this.firebaseApp.getName()) ? "" : this.firebaseApp.getPersistenceKey();
|
||||
}
|
||||
|
||||
public static T1.g getTransportFactory() {
|
||||
return transportFactory;
|
||||
}
|
||||
|
||||
/* renamed from: invokeOnTokenRefresh */
|
||||
public void lambda$new$0(String str) {
|
||||
if (FirebaseApp.DEFAULT_APP_NAME.equals(this.firebaseApp.getName())) {
|
||||
if (Log.isLoggable("FirebaseMessaging", 3)) {
|
||||
Log.d("FirebaseMessaging", "Invoking onNewToken for app: " + this.firebaseApp.getName());
|
||||
}
|
||||
Intent intent = new Intent("com.google.firebase.messaging.NEW_TOKEN");
|
||||
intent.putExtra("token", str);
|
||||
new FcmBroadcastProcessor(this.context).process(intent);
|
||||
}
|
||||
}
|
||||
|
||||
public /* synthetic */ Task lambda$blockingGetToken$10(String str, Store.Token token) {
|
||||
return this.gmsRpc.getToken().onSuccessTask(this.fileExecutor, new f(this, str, token));
|
||||
}
|
||||
|
||||
public /* synthetic */ Task lambda$blockingGetToken$9(String str, Store.Token token, String str2) throws Exception {
|
||||
getStore(this.context).saveToken(getSubtype(), str, str2, this.metadata.getAppVersionCode());
|
||||
if (token == null || !str2.equals(token.token)) {
|
||||
lambda$new$0(str2);
|
||||
}
|
||||
return Tasks.forResult(str2);
|
||||
}
|
||||
|
||||
public /* synthetic */ void lambda$deleteToken$5(TaskCompletionSource taskCompletionSource) {
|
||||
try {
|
||||
this.iid.deleteToken(Metadata.getDefaultSenderId(this.firebaseApp), INSTANCE_ID_SCOPE);
|
||||
taskCompletionSource.setResult(null);
|
||||
} catch (Exception e4) {
|
||||
taskCompletionSource.setException(e4);
|
||||
}
|
||||
}
|
||||
|
||||
public /* synthetic */ void lambda$deleteToken$6(TaskCompletionSource taskCompletionSource) {
|
||||
try {
|
||||
Tasks.await(this.gmsRpc.deleteToken());
|
||||
getStore(this.context).deleteToken(getSubtype(), Metadata.getDefaultSenderId(this.firebaseApp));
|
||||
taskCompletionSource.setResult(null);
|
||||
} catch (Exception e4) {
|
||||
taskCompletionSource.setException(e4);
|
||||
}
|
||||
}
|
||||
|
||||
public /* synthetic */ void lambda$getToken$4(TaskCompletionSource taskCompletionSource) {
|
||||
try {
|
||||
taskCompletionSource.setResult(blockingGetToken());
|
||||
} catch (Exception e4) {
|
||||
taskCompletionSource.setException(e4);
|
||||
}
|
||||
}
|
||||
|
||||
public /* synthetic */ void lambda$new$1() {
|
||||
if (isAutoInitEnabled()) {
|
||||
startSyncIfNecessary();
|
||||
}
|
||||
}
|
||||
|
||||
public /* synthetic */ void lambda$new$2(TopicsSubscriber topicsSubscriber) {
|
||||
if (isAutoInitEnabled()) {
|
||||
topicsSubscriber.startTopicsSyncIfNecessary();
|
||||
}
|
||||
}
|
||||
|
||||
public /* synthetic */ void lambda$new$3() {
|
||||
ProxyNotificationInitializer.initialize(this.context);
|
||||
}
|
||||
|
||||
public static /* synthetic */ Task lambda$subscribeToTopic$7(String str, TopicsSubscriber topicsSubscriber) throws Exception {
|
||||
return topicsSubscriber.subscribeToTopic(str);
|
||||
}
|
||||
|
||||
public static /* synthetic */ Task lambda$unsubscribeFromTopic$8(String str, TopicsSubscriber topicsSubscriber) throws Exception {
|
||||
return topicsSubscriber.unsubscribeFromTopic(str);
|
||||
}
|
||||
|
||||
private synchronized void startSync() {
|
||||
if (!this.syncScheduledOrRunning) {
|
||||
syncWithDelaySecondsInternal(0L);
|
||||
}
|
||||
}
|
||||
|
||||
public void startSyncIfNecessary() {
|
||||
FirebaseInstanceIdInternal firebaseInstanceIdInternal = this.iid;
|
||||
if (firebaseInstanceIdInternal != null) {
|
||||
firebaseInstanceIdInternal.getToken();
|
||||
} else if (tokenNeedsRefresh(getTokenWithoutTriggeringSync())) {
|
||||
startSync();
|
||||
}
|
||||
}
|
||||
|
||||
public String blockingGetToken() throws IOException {
|
||||
FirebaseInstanceIdInternal firebaseInstanceIdInternal = this.iid;
|
||||
if (firebaseInstanceIdInternal != null) {
|
||||
try {
|
||||
return (String) Tasks.await(firebaseInstanceIdInternal.getTokenTask());
|
||||
} catch (InterruptedException | ExecutionException e4) {
|
||||
throw new IOException(e4);
|
||||
}
|
||||
}
|
||||
Store.Token tokenWithoutTriggeringSync = getTokenWithoutTriggeringSync();
|
||||
if (!tokenNeedsRefresh(tokenWithoutTriggeringSync)) {
|
||||
return tokenWithoutTriggeringSync.token;
|
||||
}
|
||||
String defaultSenderId = Metadata.getDefaultSenderId(this.firebaseApp);
|
||||
try {
|
||||
return (String) Tasks.await(this.requestDeduplicator.getOrStartGetTokenRequest(defaultSenderId, new f(this, defaultSenderId, tokenWithoutTriggeringSync)));
|
||||
} catch (InterruptedException | ExecutionException e5) {
|
||||
throw new IOException(e5);
|
||||
}
|
||||
}
|
||||
|
||||
public Task<Void> deleteToken() {
|
||||
if (this.iid != null) {
|
||||
TaskCompletionSource taskCompletionSource = new TaskCompletionSource();
|
||||
this.initExecutor.execute(new i(this, taskCompletionSource, 1));
|
||||
return taskCompletionSource.getTask();
|
||||
}
|
||||
if (getTokenWithoutTriggeringSync() == null) {
|
||||
return Tasks.forResult(null);
|
||||
}
|
||||
TaskCompletionSource taskCompletionSource2 = new TaskCompletionSource();
|
||||
FcmExecutors.newNetworkIOExecutor().execute(new i(this, taskCompletionSource2, 2));
|
||||
return taskCompletionSource2.getTask();
|
||||
}
|
||||
|
||||
public boolean deliveryMetricsExportToBigQueryEnabled() {
|
||||
return MessagingAnalytics.deliveryMetricsExportToBigQueryEnabled();
|
||||
}
|
||||
|
||||
@SuppressLint({"ThreadPoolCreation"})
|
||||
public void enqueueTaskWithDelaySeconds(Runnable runnable, long j4) {
|
||||
synchronized (FirebaseMessaging.class) {
|
||||
try {
|
||||
if (syncExecutor == null) {
|
||||
syncExecutor = new ScheduledThreadPoolExecutor(1, new NamedThreadFactory("TAG"));
|
||||
}
|
||||
syncExecutor.schedule(runnable, j4, TimeUnit.SECONDS);
|
||||
} catch (Throwable th) {
|
||||
throw th;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public Context getApplicationContext() {
|
||||
return this.context;
|
||||
}
|
||||
|
||||
public Task<String> getToken() {
|
||||
FirebaseInstanceIdInternal firebaseInstanceIdInternal = this.iid;
|
||||
if (firebaseInstanceIdInternal != null) {
|
||||
return firebaseInstanceIdInternal.getTokenTask();
|
||||
}
|
||||
TaskCompletionSource taskCompletionSource = new TaskCompletionSource();
|
||||
this.initExecutor.execute(new i(this, taskCompletionSource, 0));
|
||||
return taskCompletionSource.getTask();
|
||||
}
|
||||
|
||||
public Store.Token getTokenWithoutTriggeringSync() {
|
||||
return getStore(this.context).getToken(getSubtype(), Metadata.getDefaultSenderId(this.firebaseApp));
|
||||
}
|
||||
|
||||
public Task<TopicsSubscriber> getTopicsSubscriberTask() {
|
||||
return this.topicsSubscriberTask;
|
||||
}
|
||||
|
||||
public boolean isAutoInitEnabled() {
|
||||
return this.autoInit.isEnabled();
|
||||
}
|
||||
|
||||
public boolean isGmsCorePresent() {
|
||||
return this.metadata.isGmscorePresent();
|
||||
}
|
||||
|
||||
public boolean isNotificationDelegationEnabled() {
|
||||
return ProxyNotificationInitializer.isProxyNotificationEnabled(this.context);
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public void send(RemoteMessage remoteMessage) {
|
||||
if (TextUtils.isEmpty(remoteMessage.getTo())) {
|
||||
throw new IllegalArgumentException("Missing 'to'");
|
||||
}
|
||||
Intent intent = new Intent(SEND_INTENT_ACTION);
|
||||
Intent intent2 = new Intent();
|
||||
intent2.setPackage("com.google.example.invalidpackage");
|
||||
intent.putExtra(EXTRA_DUMMY_P_INTENT, PendingIntent.getBroadcast(this.context, 0, intent2, 67108864));
|
||||
intent.setPackage("com.google.android.gms");
|
||||
remoteMessage.populateSendMessageIntent(intent);
|
||||
this.context.sendOrderedBroadcast(intent, "com.google.android.gtalkservice.permission.GTALK_SERVICE");
|
||||
}
|
||||
|
||||
public void setAutoInitEnabled(boolean z3) {
|
||||
this.autoInit.setEnabled(z3);
|
||||
}
|
||||
|
||||
public void setDeliveryMetricsExportToBigQuery(boolean z3) {
|
||||
MessagingAnalytics.setDeliveryMetricsExportToBigQuery(z3);
|
||||
}
|
||||
|
||||
public Task<Void> setNotificationDelegationEnabled(boolean z3) {
|
||||
return ProxyNotificationInitializer.setEnableProxyNotification(this.initExecutor, this.context, z3);
|
||||
}
|
||||
|
||||
public synchronized void setSyncScheduledOrRunning(boolean z3) {
|
||||
this.syncScheduledOrRunning = z3;
|
||||
}
|
||||
|
||||
@SuppressLint({"TaskMainThread"})
|
||||
public Task<Void> subscribeToTopic(String str) {
|
||||
return this.topicsSubscriberTask.onSuccessTask(new e(str, 0));
|
||||
}
|
||||
|
||||
public synchronized void syncWithDelaySecondsInternal(long j4) {
|
||||
enqueueTaskWithDelaySeconds(new SyncTask(this, Math.min(Math.max(MIN_DELAY_SEC, 2 * j4), MAX_DELAY_SEC)), j4);
|
||||
this.syncScheduledOrRunning = true;
|
||||
}
|
||||
|
||||
public boolean tokenNeedsRefresh(Store.Token token) {
|
||||
return token == null || token.needsRefresh(this.metadata.getAppVersionCode());
|
||||
}
|
||||
|
||||
@SuppressLint({"TaskMainThread"})
|
||||
public Task<Void> unsubscribeFromTopic(String str) {
|
||||
return this.topicsSubscriberTask.onSuccessTask(new e(str, 1));
|
||||
}
|
||||
|
||||
@Keep
|
||||
public static synchronized FirebaseMessaging getInstance(FirebaseApp firebaseApp) {
|
||||
FirebaseMessaging firebaseMessaging;
|
||||
synchronized (FirebaseMessaging.class) {
|
||||
firebaseMessaging = (FirebaseMessaging) firebaseApp.get(FirebaseMessaging.class);
|
||||
Preconditions.checkNotNull(firebaseMessaging, "Firebase Messaging component is not present");
|
||||
}
|
||||
return firebaseMessaging;
|
||||
}
|
||||
|
||||
public FirebaseMessaging(FirebaseApp firebaseApp, FirebaseInstanceIdInternal firebaseInstanceIdInternal, Provider<UserAgentPublisher> provider, Provider<HeartBeatInfo> provider2, FirebaseInstallationsApi firebaseInstallationsApi, T1.g gVar, Subscriber subscriber, Metadata metadata) {
|
||||
this(firebaseApp, firebaseInstanceIdInternal, firebaseInstallationsApi, gVar, subscriber, metadata, new GmsRpc(firebaseApp, metadata, provider, provider2, firebaseInstallationsApi), FcmExecutors.newTaskExecutor(), FcmExecutors.newInitExecutor(), FcmExecutors.newFileIOExecutor());
|
||||
}
|
||||
|
||||
public FirebaseMessaging(FirebaseApp firebaseApp, FirebaseInstanceIdInternal firebaseInstanceIdInternal, FirebaseInstallationsApi firebaseInstallationsApi, T1.g gVar, Subscriber subscriber, Metadata metadata, GmsRpc gmsRpc, Executor executor, Executor executor2, Executor executor3) {
|
||||
this.syncScheduledOrRunning = false;
|
||||
transportFactory = gVar;
|
||||
this.firebaseApp = firebaseApp;
|
||||
this.iid = firebaseInstanceIdInternal;
|
||||
this.fis = firebaseInstallationsApi;
|
||||
this.autoInit = new AutoInit(subscriber);
|
||||
Context applicationContext = firebaseApp.getApplicationContext();
|
||||
this.context = applicationContext;
|
||||
FcmLifecycleCallbacks fcmLifecycleCallbacks = new FcmLifecycleCallbacks();
|
||||
this.lifecycleCallbacks = fcmLifecycleCallbacks;
|
||||
this.metadata = metadata;
|
||||
this.taskExecutor = executor;
|
||||
this.gmsRpc = gmsRpc;
|
||||
this.requestDeduplicator = new RequestDeduplicator(executor);
|
||||
this.initExecutor = executor2;
|
||||
this.fileExecutor = executor3;
|
||||
Context applicationContext2 = firebaseApp.getApplicationContext();
|
||||
if (applicationContext2 instanceof Application) {
|
||||
((Application) applicationContext2).registerActivityLifecycleCallbacks(fcmLifecycleCallbacks);
|
||||
} else {
|
||||
Log.w("FirebaseMessaging", "Context " + applicationContext2 + " was not an application, can't register for lifecycle callbacks. Some notification events may be dropped as a result.");
|
||||
}
|
||||
if (firebaseInstanceIdInternal != null) {
|
||||
firebaseInstanceIdInternal.addNewTokenListener(new k(this));
|
||||
}
|
||||
final int i = 0;
|
||||
executor2.execute(new Runnable(this) { // from class: com.google.firebase.messaging.g
|
||||
|
||||
/* renamed from: b, reason: collision with root package name */
|
||||
public final /* synthetic */ FirebaseMessaging f6011b;
|
||||
|
||||
{
|
||||
this.f6011b = this;
|
||||
}
|
||||
|
||||
@Override // java.lang.Runnable
|
||||
public final void run() {
|
||||
int i4 = i;
|
||||
FirebaseMessaging firebaseMessaging = this.f6011b;
|
||||
switch (i4) {
|
||||
case 0:
|
||||
firebaseMessaging.lambda$new$1();
|
||||
return;
|
||||
default:
|
||||
firebaseMessaging.lambda$new$3();
|
||||
return;
|
||||
}
|
||||
}
|
||||
});
|
||||
Task<TopicsSubscriber> createInstance = TopicsSubscriber.createInstance(this, metadata, gmsRpc, applicationContext, FcmExecutors.newTopicsSyncExecutor());
|
||||
this.topicsSubscriberTask = createInstance;
|
||||
createInstance.addOnSuccessListener(executor2, new OnSuccessListener() { // from class: com.google.firebase.messaging.h
|
||||
@Override // com.google.android.gms.tasks.OnSuccessListener
|
||||
public final void onSuccess(Object obj) {
|
||||
FirebaseMessaging.this.lambda$new$2((TopicsSubscriber) obj);
|
||||
}
|
||||
});
|
||||
final int i4 = 1;
|
||||
executor2.execute(new Runnable(this) { // from class: com.google.firebase.messaging.g
|
||||
|
||||
/* renamed from: b, reason: collision with root package name */
|
||||
public final /* synthetic */ FirebaseMessaging f6011b;
|
||||
|
||||
{
|
||||
this.f6011b = this;
|
||||
}
|
||||
|
||||
@Override // java.lang.Runnable
|
||||
public final void run() {
|
||||
int i42 = i4;
|
||||
FirebaseMessaging firebaseMessaging = this.f6011b;
|
||||
switch (i42) {
|
||||
case 0:
|
||||
firebaseMessaging.lambda$new$1();
|
||||
return;
|
||||
default:
|
||||
firebaseMessaging.lambda$new$3();
|
||||
return;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.google.firebase.messaging;
|
||||
|
||||
import com.google.firebase.components.Component;
|
||||
import com.google.firebase.components.ComponentRegistrar;
|
||||
import java.util.List;
|
||||
import kotlin.collections.CollectionsKt;
|
||||
|
||||
@kotlin.Metadata(d1 = {"\u0000\u0016\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010 \n\u0002\u0018\u0002\n\u0000\u0018\u00002\u00020\u0001B\u0005¢\u0006\u0002\u0010\u0002J\u0012\u0010\u0003\u001a\f\u0012\b\u0012\u0006\u0012\u0002\b\u00030\u00050\u0004H\u0016¨\u0006\u0006"}, d2 = {"Lcom/google/firebase/messaging/FirebaseMessagingKtxRegistrar;", "Lcom/google/firebase/components/ComponentRegistrar;", "()V", "getComponents", "", "Lcom/google/firebase/components/Component;", "com.google.firebase-firebase-messaging"}, k = 1, mv = {1, 7, 1}, xi = 48)
|
||||
/* loaded from: classes3.dex */
|
||||
public final class FirebaseMessagingKtxRegistrar implements ComponentRegistrar {
|
||||
@Override // com.google.firebase.components.ComponentRegistrar
|
||||
public List<Component<?>> getComponents() {
|
||||
return CollectionsKt.emptyList();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package com.google.firebase.messaging;
|
||||
|
||||
import androidx.annotation.Keep;
|
||||
import com.google.android.gms.common.annotation.KeepForSdk;
|
||||
import com.google.firebase.FirebaseApp;
|
||||
import com.google.firebase.components.Component;
|
||||
import com.google.firebase.components.ComponentContainer;
|
||||
import com.google.firebase.components.ComponentRegistrar;
|
||||
import com.google.firebase.components.Dependency;
|
||||
import com.google.firebase.events.Subscriber;
|
||||
import com.google.firebase.heartbeatinfo.HeartBeatInfo;
|
||||
import com.google.firebase.iid.internal.FirebaseInstanceIdInternal;
|
||||
import com.google.firebase.installations.FirebaseInstallationsApi;
|
||||
import com.google.firebase.platforminfo.LibraryVersionComponent;
|
||||
import com.google.firebase.platforminfo.UserAgentPublisher;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
@Keep
|
||||
@KeepForSdk
|
||||
/* loaded from: classes3.dex */
|
||||
public class FirebaseMessagingRegistrar implements ComponentRegistrar {
|
||||
private static final String LIBRARY_NAME = "fire-fcm";
|
||||
|
||||
public static /* synthetic */ FirebaseMessaging lambda$getComponents$0(ComponentContainer componentContainer) {
|
||||
return new FirebaseMessaging((FirebaseApp) componentContainer.get(FirebaseApp.class), (FirebaseInstanceIdInternal) componentContainer.get(FirebaseInstanceIdInternal.class), componentContainer.getProvider(UserAgentPublisher.class), componentContainer.getProvider(HeartBeatInfo.class), (FirebaseInstallationsApi) componentContainer.get(FirebaseInstallationsApi.class), (T1.g) componentContainer.get(T1.g.class), (Subscriber) componentContainer.get(Subscriber.class));
|
||||
}
|
||||
|
||||
@Override // com.google.firebase.components.ComponentRegistrar
|
||||
@Keep
|
||||
public List<Component<?>> getComponents() {
|
||||
return Arrays.asList(Component.builder(FirebaseMessaging.class).name(LIBRARY_NAME).add(Dependency.required((Class<?>) FirebaseApp.class)).add(Dependency.optional(FirebaseInstanceIdInternal.class)).add(Dependency.optionalProvider((Class<?>) UserAgentPublisher.class)).add(Dependency.optionalProvider((Class<?>) HeartBeatInfo.class)).add(Dependency.optional(T1.g.class)).add(Dependency.required((Class<?>) FirebaseInstallationsApi.class)).add(Dependency.required((Class<?>) Subscriber.class)).factory(new M2.a(8)).alwaysEager().build(), LibraryVersionComponent.create(LIBRARY_NAME, BuildConfig.VERSION_NAME));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,180 @@
|
||||
package com.google.firebase.messaging;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import com.google.android.gms.cloudmessaging.CloudMessage;
|
||||
import com.google.android.gms.cloudmessaging.Rpc;
|
||||
import com.google.firebase.messaging.Constants;
|
||||
import java.util.ArrayDeque;
|
||||
import java.util.Queue;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
|
||||
/* loaded from: classes3.dex */
|
||||
public class FirebaseMessagingService extends EnhancedIntentService {
|
||||
public static final String ACTION_DIRECT_BOOT_REMOTE_INTENT = "com.google.firebase.messaging.RECEIVE_DIRECT_BOOT";
|
||||
static final String ACTION_NEW_TOKEN = "com.google.firebase.messaging.NEW_TOKEN";
|
||||
static final String ACTION_REMOTE_INTENT = "com.google.android.c2dm.intent.RECEIVE";
|
||||
static final String EXTRA_TOKEN = "token";
|
||||
private static final int RECENTLY_RECEIVED_MESSAGE_IDS_MAX_SIZE = 10;
|
||||
private static final Queue<String> recentlyReceivedMessageIds = new ArrayDeque(10);
|
||||
private Rpc rpc;
|
||||
|
||||
private boolean alreadyReceivedMessage(String str) {
|
||||
if (TextUtils.isEmpty(str)) {
|
||||
return false;
|
||||
}
|
||||
Queue<String> queue = recentlyReceivedMessageIds;
|
||||
if (!queue.contains(str)) {
|
||||
if (queue.size() >= 10) {
|
||||
queue.remove();
|
||||
}
|
||||
queue.add(str);
|
||||
return false;
|
||||
}
|
||||
if (!Log.isLoggable(Constants.TAG, 3)) {
|
||||
return true;
|
||||
}
|
||||
Log.d(Constants.TAG, "Received duplicate message: " + str);
|
||||
return true;
|
||||
}
|
||||
|
||||
private void dispatchMessage(Intent intent) {
|
||||
Bundle extras = intent.getExtras();
|
||||
if (extras == null) {
|
||||
extras = new Bundle();
|
||||
}
|
||||
extras.remove("androidx.content.wakelockid");
|
||||
if (NotificationParams.isNotification(extras)) {
|
||||
NotificationParams notificationParams = new NotificationParams(extras);
|
||||
ExecutorService newNetworkIOExecutor = FcmExecutors.newNetworkIOExecutor();
|
||||
try {
|
||||
if (new DisplayNotification(this, notificationParams, newNetworkIOExecutor).handleNotification()) {
|
||||
return;
|
||||
}
|
||||
newNetworkIOExecutor.shutdown();
|
||||
if (MessagingAnalytics.shouldUploadScionMetrics(intent)) {
|
||||
MessagingAnalytics.logNotificationForeground(intent);
|
||||
}
|
||||
} finally {
|
||||
newNetworkIOExecutor.shutdown();
|
||||
}
|
||||
}
|
||||
onMessageReceived(new RemoteMessage(extras));
|
||||
}
|
||||
|
||||
private String getMessageId(Intent intent) {
|
||||
String stringExtra = intent.getStringExtra(Constants.MessagePayloadKeys.MSGID);
|
||||
return stringExtra == null ? intent.getStringExtra(Constants.MessagePayloadKeys.MSGID_SERVER) : stringExtra;
|
||||
}
|
||||
|
||||
private Rpc getRpc(Context context) {
|
||||
if (this.rpc == null) {
|
||||
this.rpc = new Rpc(context.getApplicationContext());
|
||||
}
|
||||
return this.rpc;
|
||||
}
|
||||
|
||||
private void handleMessageIntent(Intent intent) {
|
||||
if (!alreadyReceivedMessage(intent.getStringExtra(Constants.MessagePayloadKeys.MSGID))) {
|
||||
passMessageIntentToSdk(intent);
|
||||
}
|
||||
getRpc(this).messageHandled(new CloudMessage(intent));
|
||||
}
|
||||
|
||||
private void passMessageIntentToSdk(Intent intent) {
|
||||
String stringExtra = intent.getStringExtra(Constants.MessagePayloadKeys.MESSAGE_TYPE);
|
||||
if (stringExtra == null) {
|
||||
stringExtra = Constants.MessageTypes.MESSAGE;
|
||||
}
|
||||
char c4 = 65535;
|
||||
switch (stringExtra.hashCode()) {
|
||||
case -2062414158:
|
||||
if (stringExtra.equals(Constants.MessageTypes.DELETED)) {
|
||||
c4 = 0;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 102161:
|
||||
if (stringExtra.equals(Constants.MessageTypes.MESSAGE)) {
|
||||
c4 = 1;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 814694033:
|
||||
if (stringExtra.equals(Constants.MessageTypes.SEND_ERROR)) {
|
||||
c4 = 2;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 814800675:
|
||||
if (stringExtra.equals(Constants.MessageTypes.SEND_EVENT)) {
|
||||
c4 = 3;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
switch (c4) {
|
||||
case 0:
|
||||
onDeletedMessages();
|
||||
return;
|
||||
case 1:
|
||||
MessagingAnalytics.logNotificationReceived(intent);
|
||||
dispatchMessage(intent);
|
||||
return;
|
||||
case 2:
|
||||
onSendError(getMessageId(intent), new SendException(intent.getStringExtra(Constants.IPC_BUNDLE_KEY_SEND_ERROR)));
|
||||
return;
|
||||
case 3:
|
||||
onMessageSent(intent.getStringExtra(Constants.MessagePayloadKeys.MSGID));
|
||||
return;
|
||||
default:
|
||||
Log.w(Constants.TAG, "Received message with unknown type: ".concat(stringExtra));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
public static void resetForTesting() {
|
||||
recentlyReceivedMessageIds.clear();
|
||||
}
|
||||
|
||||
@Override // com.google.firebase.messaging.EnhancedIntentService
|
||||
public Intent getStartCommandIntent(Intent intent) {
|
||||
return ServiceStarter.getInstance().getMessagingEvent();
|
||||
}
|
||||
|
||||
@Override // com.google.firebase.messaging.EnhancedIntentService
|
||||
public void handleIntent(Intent intent) {
|
||||
String action = intent.getAction();
|
||||
if (ACTION_REMOTE_INTENT.equals(action) || ACTION_DIRECT_BOOT_REMOTE_INTENT.equals(action)) {
|
||||
handleMessageIntent(intent);
|
||||
} else {
|
||||
if (ACTION_NEW_TOKEN.equals(action)) {
|
||||
onNewToken(intent.getStringExtra("token"));
|
||||
return;
|
||||
}
|
||||
Log.d(Constants.TAG, "Unknown intent action: " + intent.getAction());
|
||||
}
|
||||
}
|
||||
|
||||
public void onDeletedMessages() {
|
||||
}
|
||||
|
||||
public void onMessageReceived(RemoteMessage remoteMessage) {
|
||||
}
|
||||
|
||||
public void onMessageSent(String str) {
|
||||
}
|
||||
|
||||
public void onNewToken(String str) {
|
||||
}
|
||||
|
||||
public void onSendError(String str, Exception exc) {
|
||||
}
|
||||
|
||||
public void setRpcForTesting(Rpc rpc) {
|
||||
this.rpc = rpc;
|
||||
}
|
||||
}
|
||||
186
apk_decompiled/sources/com/google/firebase/messaging/GmsRpc.java
Normal file
186
apk_decompiled/sources/com/google/firebase/messaging/GmsRpc.java
Normal file
@@ -0,0 +1,186 @@
|
||||
package com.google.firebase.messaging;
|
||||
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Base64;
|
||||
import android.util.Log;
|
||||
import com.google.android.gms.cloudmessaging.Rpc;
|
||||
import com.google.android.gms.tasks.Task;
|
||||
import com.google.android.gms.tasks.Tasks;
|
||||
import com.google.firebase.FirebaseApp;
|
||||
import com.google.firebase.heartbeatinfo.HeartBeatInfo;
|
||||
import com.google.firebase.inject.Provider;
|
||||
import com.google.firebase.installations.FirebaseInstallationsApi;
|
||||
import com.google.firebase.installations.InstallationTokenResult;
|
||||
import com.google.firebase.platforminfo.UserAgentPublisher;
|
||||
import java.io.IOException;
|
||||
import java.security.MessageDigest;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import java.util.concurrent.ExecutionException;
|
||||
import n.ExecutorC0507a;
|
||||
|
||||
/* loaded from: classes3.dex */
|
||||
public class GmsRpc {
|
||||
static final String CMD_RST = "RST";
|
||||
static final String CMD_RST_FULL = "RST_FULL";
|
||||
static final String CMD_SYNC = "SYNC";
|
||||
static final String ERROR_INSTANCE_ID_RESET = "INSTANCE_ID_RESET";
|
||||
static final String ERROR_INTERNAL_SERVER_ERROR = "INTERNAL_SERVER_ERROR";
|
||||
static final String ERROR_INTERNAL_SERVER_ERROR_ALT = "InternalServerError";
|
||||
static final String ERROR_SERVICE_NOT_AVAILABLE = "SERVICE_NOT_AVAILABLE";
|
||||
private static final String EXTRA_DELETE = "delete";
|
||||
private static final String EXTRA_ERROR = "error";
|
||||
private static final String EXTRA_IID_OPERATION = "iid-operation";
|
||||
private static final String EXTRA_REGISTRATION_ID = "registration_id";
|
||||
private static final String EXTRA_SCOPE = "scope";
|
||||
private static final String EXTRA_SENDER = "sender";
|
||||
private static final String EXTRA_SUBTYPE = "subtype";
|
||||
private static final String EXTRA_TOPIC = "gcm.topic";
|
||||
private static final String EXTRA_UNREGISTERED = "unregistered";
|
||||
static final String FIREBASE_IID_HEARTBEAT_TAG = "fire-iid";
|
||||
private static final String PARAM_APP_VER_CODE = "app_ver";
|
||||
private static final String PARAM_APP_VER_NAME = "app_ver_name";
|
||||
private static final String PARAM_CLIENT_VER = "cliv";
|
||||
private static final String PARAM_FIREBASE_APP_NAME_HASH = "firebase-app-name-hash";
|
||||
private static final String PARAM_FIS_AUTH_TOKEN = "Goog-Firebase-Installations-Auth";
|
||||
private static final String PARAM_GMP_APP_ID = "gmp_app_id";
|
||||
private static final String PARAM_GMS_VER = "gmsv";
|
||||
private static final String PARAM_HEARTBEAT_CODE = "Firebase-Client-Log-Type";
|
||||
private static final String PARAM_INSTANCE_ID = "appid";
|
||||
private static final String PARAM_OS_VER = "osv";
|
||||
private static final String PARAM_USER_AGENT = "Firebase-Client";
|
||||
private static final String SCOPE_ALL = "*";
|
||||
static final String TAG = "FirebaseMessaging";
|
||||
private static final String TOPIC_PREFIX = "/topics/";
|
||||
private final FirebaseApp app;
|
||||
private final FirebaseInstallationsApi firebaseInstallations;
|
||||
private final Provider<HeartBeatInfo> heartbeatInfo;
|
||||
private final Metadata metadata;
|
||||
private final Rpc rpc;
|
||||
private final Provider<UserAgentPublisher> userAgentPublisher;
|
||||
|
||||
public GmsRpc(FirebaseApp firebaseApp, Metadata metadata, Provider<UserAgentPublisher> provider, Provider<HeartBeatInfo> provider2, FirebaseInstallationsApi firebaseInstallationsApi) {
|
||||
this(firebaseApp, metadata, new Rpc(firebaseApp.getApplicationContext()), provider, provider2, firebaseInstallationsApi);
|
||||
}
|
||||
|
||||
private static String base64UrlSafe(byte[] bArr) {
|
||||
return Base64.encodeToString(bArr, 11);
|
||||
}
|
||||
|
||||
private Task<String> extractResponseWhenComplete(Task<Bundle> task) {
|
||||
return task.continueWith(new ExecutorC0507a(1), new k(this));
|
||||
}
|
||||
|
||||
private String getHashedFirebaseAppName() {
|
||||
try {
|
||||
return base64UrlSafe(MessageDigest.getInstance("SHA-1").digest(this.app.getName().getBytes()));
|
||||
} catch (NoSuchAlgorithmException unused) {
|
||||
return "[HASH-ERROR]";
|
||||
}
|
||||
}
|
||||
|
||||
private String handleResponse(Bundle bundle) throws IOException {
|
||||
if (bundle == null) {
|
||||
throw new IOException(ERROR_SERVICE_NOT_AVAILABLE);
|
||||
}
|
||||
String string = bundle.getString(EXTRA_REGISTRATION_ID);
|
||||
if (string != null) {
|
||||
return string;
|
||||
}
|
||||
String string2 = bundle.getString(EXTRA_UNREGISTERED);
|
||||
if (string2 != null) {
|
||||
return string2;
|
||||
}
|
||||
String string3 = bundle.getString("error");
|
||||
if (CMD_RST.equals(string3)) {
|
||||
throw new IOException(ERROR_INSTANCE_ID_RESET);
|
||||
}
|
||||
if (string3 != null) {
|
||||
throw new IOException(string3);
|
||||
}
|
||||
Log.w("FirebaseMessaging", "Unexpected response: " + bundle, new Throwable());
|
||||
throw new IOException(ERROR_SERVICE_NOT_AVAILABLE);
|
||||
}
|
||||
|
||||
public static boolean isErrorMessageForRetryableError(String str) {
|
||||
return ERROR_SERVICE_NOT_AVAILABLE.equals(str) || ERROR_INTERNAL_SERVER_ERROR.equals(str) || ERROR_INTERNAL_SERVER_ERROR_ALT.equals(str);
|
||||
}
|
||||
|
||||
public /* synthetic */ String lambda$extractResponseWhenComplete$0(Task task) throws Exception {
|
||||
return handleResponse((Bundle) task.getResult(IOException.class));
|
||||
}
|
||||
|
||||
private void setDefaultAttributesToBundle(String str, String str2, Bundle bundle) throws ExecutionException, InterruptedException {
|
||||
HeartBeatInfo.HeartBeat heartBeatCode;
|
||||
bundle.putString(EXTRA_SCOPE, str2);
|
||||
bundle.putString(EXTRA_SENDER, str);
|
||||
bundle.putString(EXTRA_SUBTYPE, str);
|
||||
bundle.putString(PARAM_GMP_APP_ID, this.app.getOptions().getApplicationId());
|
||||
bundle.putString(PARAM_GMS_VER, Integer.toString(this.metadata.getGmsVersionCode()));
|
||||
bundle.putString(PARAM_OS_VER, Integer.toString(Build.VERSION.SDK_INT));
|
||||
bundle.putString(PARAM_APP_VER_CODE, this.metadata.getAppVersionCode());
|
||||
bundle.putString(PARAM_APP_VER_NAME, this.metadata.getAppVersionName());
|
||||
bundle.putString(PARAM_FIREBASE_APP_NAME_HASH, getHashedFirebaseAppName());
|
||||
try {
|
||||
String token = ((InstallationTokenResult) Tasks.await(this.firebaseInstallations.getToken(false))).getToken();
|
||||
if (TextUtils.isEmpty(token)) {
|
||||
Log.w("FirebaseMessaging", "FIS auth token is empty");
|
||||
} else {
|
||||
bundle.putString(PARAM_FIS_AUTH_TOKEN, token);
|
||||
}
|
||||
} catch (InterruptedException | ExecutionException e4) {
|
||||
Log.e("FirebaseMessaging", "Failed to get FIS auth token", e4);
|
||||
}
|
||||
bundle.putString(PARAM_INSTANCE_ID, (String) Tasks.await(this.firebaseInstallations.getId()));
|
||||
bundle.putString(PARAM_CLIENT_VER, "fcm-23.4.0");
|
||||
HeartBeatInfo heartBeatInfo = this.heartbeatInfo.get();
|
||||
UserAgentPublisher userAgentPublisher = this.userAgentPublisher.get();
|
||||
if (heartBeatInfo == null || userAgentPublisher == null || (heartBeatCode = heartBeatInfo.getHeartBeatCode(FIREBASE_IID_HEARTBEAT_TAG)) == HeartBeatInfo.HeartBeat.NONE) {
|
||||
return;
|
||||
}
|
||||
bundle.putString(PARAM_HEARTBEAT_CODE, Integer.toString(heartBeatCode.getCode()));
|
||||
bundle.putString(PARAM_USER_AGENT, userAgentPublisher.getUserAgent());
|
||||
}
|
||||
|
||||
private Task<Bundle> startRpc(String str, String str2, Bundle bundle) {
|
||||
try {
|
||||
setDefaultAttributesToBundle(str, str2, bundle);
|
||||
return this.rpc.send(bundle);
|
||||
} catch (InterruptedException | ExecutionException e4) {
|
||||
return Tasks.forException(e4);
|
||||
}
|
||||
}
|
||||
|
||||
public Task<?> deleteToken() {
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putString(EXTRA_DELETE, "1");
|
||||
return extractResponseWhenComplete(startRpc(Metadata.getDefaultSenderId(this.app), "*", bundle));
|
||||
}
|
||||
|
||||
public Task<String> getToken() {
|
||||
return extractResponseWhenComplete(startRpc(Metadata.getDefaultSenderId(this.app), "*", new Bundle()));
|
||||
}
|
||||
|
||||
public Task<?> subscribeToTopic(String str, String str2) {
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putString(EXTRA_TOPIC, TOPIC_PREFIX + str2);
|
||||
return extractResponseWhenComplete(startRpc(str, TOPIC_PREFIX + str2, bundle));
|
||||
}
|
||||
|
||||
public Task<?> unsubscribeFromTopic(String str, String str2) {
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putString(EXTRA_TOPIC, TOPIC_PREFIX + str2);
|
||||
bundle.putString(EXTRA_DELETE, "1");
|
||||
return extractResponseWhenComplete(startRpc(str, TOPIC_PREFIX + str2, bundle));
|
||||
}
|
||||
|
||||
public GmsRpc(FirebaseApp firebaseApp, Metadata metadata, Rpc rpc, Provider<UserAgentPublisher> provider, Provider<HeartBeatInfo> provider2, FirebaseInstallationsApi firebaseInstallationsApi) {
|
||||
this.app = firebaseApp;
|
||||
this.metadata = metadata;
|
||||
this.rpc = rpc;
|
||||
this.userAgentPublisher = provider;
|
||||
this.heartbeatInfo = provider2;
|
||||
this.firebaseInstallations = firebaseInstallationsApi;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,109 @@
|
||||
package com.google.firebase.messaging;
|
||||
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.BitmapFactory;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import com.google.android.gms.common.internal.Preconditions;
|
||||
import com.google.android.gms.tasks.Task;
|
||||
import com.google.android.gms.tasks.TaskCompletionSource;
|
||||
import java.io.Closeable;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URL;
|
||||
import java.net.URLConnection;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.Future;
|
||||
|
||||
/* loaded from: classes3.dex */
|
||||
public class ImageDownload implements Closeable {
|
||||
private static final int MAX_IMAGE_SIZE_BYTES = 1048576;
|
||||
private volatile Future<?> future;
|
||||
private Task<Bitmap> task;
|
||||
private final URL url;
|
||||
|
||||
private ImageDownload(URL url) {
|
||||
this.url = url;
|
||||
}
|
||||
|
||||
private byte[] blockingDownloadBytes() throws IOException {
|
||||
URLConnection openConnection = this.url.openConnection();
|
||||
if (openConnection.getContentLength() > MAX_IMAGE_SIZE_BYTES) {
|
||||
throw new IOException("Content-Length exceeds max size of 1048576");
|
||||
}
|
||||
InputStream inputStream = openConnection.getInputStream();
|
||||
try {
|
||||
byte[] byteArray = ByteStreams.toByteArray(ByteStreams.limit(inputStream, 1048577L));
|
||||
if (inputStream != null) {
|
||||
inputStream.close();
|
||||
}
|
||||
if (Log.isLoggable(Constants.TAG, 2)) {
|
||||
Log.v(Constants.TAG, "Downloaded " + byteArray.length + " bytes from " + this.url);
|
||||
}
|
||||
if (byteArray.length <= MAX_IMAGE_SIZE_BYTES) {
|
||||
return byteArray;
|
||||
}
|
||||
throw new IOException("Image exceeds max size of 1048576");
|
||||
} catch (Throwable th) {
|
||||
if (inputStream != null) {
|
||||
try {
|
||||
inputStream.close();
|
||||
} catch (Throwable th2) {
|
||||
th.addSuppressed(th2);
|
||||
}
|
||||
}
|
||||
throw th;
|
||||
}
|
||||
}
|
||||
|
||||
public static ImageDownload create(String str) {
|
||||
if (TextUtils.isEmpty(str)) {
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
return new ImageDownload(new URL(str));
|
||||
} catch (MalformedURLException unused) {
|
||||
Log.w(Constants.TAG, "Not downloading image, bad URL: " + str);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public /* synthetic */ void lambda$start$0(TaskCompletionSource taskCompletionSource) {
|
||||
try {
|
||||
taskCompletionSource.setResult(blockingDownload());
|
||||
} catch (Exception e4) {
|
||||
taskCompletionSource.setException(e4);
|
||||
}
|
||||
}
|
||||
|
||||
public Bitmap blockingDownload() throws IOException {
|
||||
if (Log.isLoggable(Constants.TAG, 4)) {
|
||||
Log.i(Constants.TAG, "Starting download of: " + this.url);
|
||||
}
|
||||
byte[] blockingDownloadBytes = blockingDownloadBytes();
|
||||
Bitmap decodeByteArray = BitmapFactory.decodeByteArray(blockingDownloadBytes, 0, blockingDownloadBytes.length);
|
||||
if (decodeByteArray == null) {
|
||||
throw new IOException("Failed to decode image: " + this.url);
|
||||
}
|
||||
if (Log.isLoggable(Constants.TAG, 3)) {
|
||||
Log.d(Constants.TAG, "Successfully downloaded image: " + this.url);
|
||||
}
|
||||
return decodeByteArray;
|
||||
}
|
||||
|
||||
@Override // java.io.Closeable, java.lang.AutoCloseable
|
||||
public void close() {
|
||||
this.future.cancel(true);
|
||||
}
|
||||
|
||||
public Task<Bitmap> getTask() {
|
||||
return (Task) Preconditions.checkNotNull(this.task);
|
||||
}
|
||||
|
||||
public void start(ExecutorService executorService) {
|
||||
TaskCompletionSource taskCompletionSource = new TaskCompletionSource();
|
||||
this.future = executorService.submit(new i(this, taskCompletionSource, 3));
|
||||
this.task = taskCompletionSource.getTask();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,399 @@
|
||||
package com.google.firebase.messaging;
|
||||
|
||||
import B0.w;
|
||||
import W1.r;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.content.pm.ApplicationInfo;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.os.Bundle;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import com.google.android.gms.tasks.Tasks;
|
||||
import com.google.firebase.FirebaseApp;
|
||||
import com.google.firebase.analytics.connector.AnalyticsConnector;
|
||||
import com.google.firebase.installations.FirebaseInstallations;
|
||||
import com.google.firebase.messaging.Constants;
|
||||
import com.google.firebase.messaging.reporting.MessagingClientEvent;
|
||||
import com.google.firebase.messaging.reporting.MessagingClientEventExtension;
|
||||
import java.util.concurrent.ExecutionException;
|
||||
|
||||
/* loaded from: classes3.dex */
|
||||
public class MessagingAnalytics {
|
||||
private static final int DEFAULT_PRODUCT_ID = 111881503;
|
||||
private static final String DELIVERY_METRICS_EXPORT_TO_BIG_QUERY_PREF = "export_to_big_query";
|
||||
private static final String FCM_PREFERENCES = "com.google.firebase.messaging";
|
||||
private static final String MANIFEST_DELIVERY_METRICS_EXPORT_TO_BIG_QUERY_ENABLED = "delivery_metrics_exported_to_big_query_enabled";
|
||||
private static final String REENGAGEMENT_MEDIUM = "notification";
|
||||
private static final String REENGAGEMENT_SOURCE = "Firebase";
|
||||
|
||||
public static boolean deliveryMetricsExportToBigQueryEnabled() {
|
||||
ApplicationInfo applicationInfo;
|
||||
Bundle bundle;
|
||||
try {
|
||||
FirebaseApp.getInstance();
|
||||
Context applicationContext = FirebaseApp.getInstance().getApplicationContext();
|
||||
SharedPreferences sharedPreferences = applicationContext.getSharedPreferences("com.google.firebase.messaging", 0);
|
||||
if (sharedPreferences.contains(DELIVERY_METRICS_EXPORT_TO_BIG_QUERY_PREF)) {
|
||||
return sharedPreferences.getBoolean(DELIVERY_METRICS_EXPORT_TO_BIG_QUERY_PREF, false);
|
||||
}
|
||||
try {
|
||||
PackageManager packageManager = applicationContext.getPackageManager();
|
||||
if (packageManager != null && (applicationInfo = packageManager.getApplicationInfo(applicationContext.getPackageName(), 128)) != null && (bundle = applicationInfo.metaData) != null && bundle.containsKey(MANIFEST_DELIVERY_METRICS_EXPORT_TO_BIG_QUERY_ENABLED)) {
|
||||
return applicationInfo.metaData.getBoolean(MANIFEST_DELIVERY_METRICS_EXPORT_TO_BIG_QUERY_ENABLED, false);
|
||||
}
|
||||
} catch (PackageManager.NameNotFoundException unused) {
|
||||
}
|
||||
return false;
|
||||
} catch (IllegalStateException unused2) {
|
||||
Log.i(Constants.TAG, "FirebaseApp has not being initialized. Device might be in direct boot mode. Skip exporting delivery metrics to Big Query");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public static MessagingClientEvent eventToProto(MessagingClientEvent.Event event, Intent intent) {
|
||||
if (intent == null) {
|
||||
return null;
|
||||
}
|
||||
Bundle extras = intent.getExtras();
|
||||
if (extras == null) {
|
||||
extras = Bundle.EMPTY;
|
||||
}
|
||||
MessagingClientEvent.Builder messageType = MessagingClientEvent.newBuilder().setTtl(getTtl(extras)).setEvent(event).setInstanceId(getInstanceId(extras)).setPackageName(getPackageName()).setSdkPlatform(MessagingClientEvent.SDKPlatform.ANDROID).setMessageType(getMessageTypeForFirelog(extras));
|
||||
String messageId = getMessageId(extras);
|
||||
if (messageId != null) {
|
||||
messageType.setMessageId(messageId);
|
||||
}
|
||||
String topic = getTopic(extras);
|
||||
if (topic != null) {
|
||||
messageType.setTopic(topic);
|
||||
}
|
||||
String collapseKey = getCollapseKey(extras);
|
||||
if (collapseKey != null) {
|
||||
messageType.setCollapseKey(collapseKey);
|
||||
}
|
||||
String messageLabel = getMessageLabel(extras);
|
||||
if (messageLabel != null) {
|
||||
messageType.setAnalyticsLabel(messageLabel);
|
||||
}
|
||||
String composerLabel = getComposerLabel(extras);
|
||||
if (composerLabel != null) {
|
||||
messageType.setComposerLabel(composerLabel);
|
||||
}
|
||||
long projectNumber = getProjectNumber(extras);
|
||||
if (projectNumber > 0) {
|
||||
messageType.setProjectNumber(projectNumber);
|
||||
}
|
||||
return messageType.build();
|
||||
}
|
||||
|
||||
public static String getCollapseKey(Bundle bundle) {
|
||||
return bundle.getString(Constants.MessagePayloadKeys.COLLAPSE_KEY);
|
||||
}
|
||||
|
||||
public static String getComposerId(Bundle bundle) {
|
||||
return bundle.getString(Constants.AnalyticsKeys.COMPOSER_ID);
|
||||
}
|
||||
|
||||
public static String getComposerLabel(Bundle bundle) {
|
||||
return bundle.getString(Constants.AnalyticsKeys.COMPOSER_LABEL);
|
||||
}
|
||||
|
||||
public static String getInstanceId(Bundle bundle) {
|
||||
String string = bundle.getString(Constants.MessagePayloadKeys.TO);
|
||||
if (!TextUtils.isEmpty(string)) {
|
||||
return string;
|
||||
}
|
||||
try {
|
||||
return (String) Tasks.await(FirebaseInstallations.getInstance(FirebaseApp.getInstance()).getId());
|
||||
} catch (InterruptedException | ExecutionException e4) {
|
||||
throw new RuntimeException(e4);
|
||||
}
|
||||
}
|
||||
|
||||
public static String getMessageChannel(Bundle bundle) {
|
||||
return bundle.getString(Constants.AnalyticsKeys.MESSAGE_CHANNEL);
|
||||
}
|
||||
|
||||
public static String getMessageId(Bundle bundle) {
|
||||
String string = bundle.getString(Constants.MessagePayloadKeys.MSGID);
|
||||
return string == null ? bundle.getString(Constants.MessagePayloadKeys.MSGID_SERVER) : string;
|
||||
}
|
||||
|
||||
public static String getMessageLabel(Bundle bundle) {
|
||||
return bundle.getString(Constants.AnalyticsKeys.MESSAGE_LABEL);
|
||||
}
|
||||
|
||||
private static int getMessagePriority(String str) {
|
||||
if ("high".equals(str)) {
|
||||
return 1;
|
||||
}
|
||||
return "normal".equals(str) ? 2 : 0;
|
||||
}
|
||||
|
||||
public static int getMessagePriorityForFirelog(Bundle bundle) {
|
||||
int priority = getPriority(bundle);
|
||||
if (priority == 2) {
|
||||
return 5;
|
||||
}
|
||||
return priority == 1 ? 10 : 0;
|
||||
}
|
||||
|
||||
public static String getMessageTime(Bundle bundle) {
|
||||
return bundle.getString(Constants.AnalyticsKeys.MESSAGE_TIMESTAMP);
|
||||
}
|
||||
|
||||
public static MessagingClientEvent.MessageType getMessageTypeForFirelog(Bundle bundle) {
|
||||
return (bundle == null || !NotificationParams.isNotification(bundle)) ? MessagingClientEvent.MessageType.DATA_MESSAGE : MessagingClientEvent.MessageType.DISPLAY_NOTIFICATION;
|
||||
}
|
||||
|
||||
public static String getMessageTypeForScion(Bundle bundle) {
|
||||
return (bundle == null || !NotificationParams.isNotification(bundle)) ? Constants.ScionAnalytics.MessageType.DATA_MESSAGE : Constants.ScionAnalytics.MessageType.DISPLAY_NOTIFICATION;
|
||||
}
|
||||
|
||||
public static String getPackageName() {
|
||||
return FirebaseApp.getInstance().getApplicationContext().getPackageName();
|
||||
}
|
||||
|
||||
public static int getPriority(Bundle bundle) {
|
||||
String string = bundle.getString(Constants.MessagePayloadKeys.DELIVERED_PRIORITY);
|
||||
if (string == null) {
|
||||
if ("1".equals(bundle.getString(Constants.MessagePayloadKeys.PRIORITY_REDUCED_V19))) {
|
||||
return 2;
|
||||
}
|
||||
string = bundle.getString(Constants.MessagePayloadKeys.PRIORITY_V19);
|
||||
}
|
||||
return getMessagePriority(string);
|
||||
}
|
||||
|
||||
public static long getProjectNumber(Bundle bundle) {
|
||||
if (bundle.containsKey(Constants.MessagePayloadKeys.SENDER_ID)) {
|
||||
try {
|
||||
return Long.parseLong(bundle.getString(Constants.MessagePayloadKeys.SENDER_ID));
|
||||
} catch (NumberFormatException e4) {
|
||||
Log.w(Constants.TAG, "error parsing project number", e4);
|
||||
}
|
||||
}
|
||||
FirebaseApp firebaseApp = FirebaseApp.getInstance();
|
||||
String gcmSenderId = firebaseApp.getOptions().getGcmSenderId();
|
||||
if (gcmSenderId != null) {
|
||||
try {
|
||||
return Long.parseLong(gcmSenderId);
|
||||
} catch (NumberFormatException e5) {
|
||||
Log.w(Constants.TAG, "error parsing sender ID", e5);
|
||||
}
|
||||
}
|
||||
String applicationId = firebaseApp.getOptions().getApplicationId();
|
||||
if (applicationId.startsWith("1:")) {
|
||||
String[] split = applicationId.split(":");
|
||||
if (split.length < 2) {
|
||||
return 0L;
|
||||
}
|
||||
String str = split[1];
|
||||
if (str.isEmpty()) {
|
||||
return 0L;
|
||||
}
|
||||
try {
|
||||
return Long.parseLong(str);
|
||||
} catch (NumberFormatException e6) {
|
||||
Log.w(Constants.TAG, "error parsing app ID", e6);
|
||||
}
|
||||
} else {
|
||||
try {
|
||||
return Long.parseLong(applicationId);
|
||||
} catch (NumberFormatException e7) {
|
||||
Log.w(Constants.TAG, "error parsing app ID", e7);
|
||||
}
|
||||
}
|
||||
return 0L;
|
||||
}
|
||||
|
||||
public static String getTopic(Bundle bundle) {
|
||||
String string = bundle.getString(Constants.MessagePayloadKeys.FROM);
|
||||
if (string == null || !string.startsWith("/topics/")) {
|
||||
return null;
|
||||
}
|
||||
return string;
|
||||
}
|
||||
|
||||
public static int getTtl(Bundle bundle) {
|
||||
Object obj = bundle.get(Constants.MessagePayloadKeys.TTL);
|
||||
if (obj instanceof Integer) {
|
||||
return ((Integer) obj).intValue();
|
||||
}
|
||||
if (!(obj instanceof String)) {
|
||||
return 0;
|
||||
}
|
||||
try {
|
||||
return Integer.parseInt((String) obj);
|
||||
} catch (NumberFormatException unused) {
|
||||
Log.w(Constants.TAG, "Invalid TTL: " + obj);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
public static String getUseDeviceTime(Bundle bundle) {
|
||||
if (bundle.containsKey(Constants.AnalyticsKeys.MESSAGE_USE_DEVICE_TIME)) {
|
||||
return bundle.getString(Constants.AnalyticsKeys.MESSAGE_USE_DEVICE_TIME);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private static boolean isDirectBootMessage(Intent intent) {
|
||||
return FirebaseMessagingService.ACTION_DIRECT_BOOT_REMOTE_INTENT.equals(intent.getAction());
|
||||
}
|
||||
|
||||
public static void logNotificationDismiss(Intent intent) {
|
||||
logToScion(Constants.ScionAnalytics.EVENT_NOTIFICATION_DISMISS, intent.getExtras());
|
||||
}
|
||||
|
||||
public static void logNotificationForeground(Intent intent) {
|
||||
logToScion(Constants.ScionAnalytics.EVENT_NOTIFICATION_FOREGROUND, intent.getExtras());
|
||||
}
|
||||
|
||||
public static void logNotificationOpen(Bundle bundle) {
|
||||
setUserPropertyIfRequired(bundle);
|
||||
logToScion(Constants.ScionAnalytics.EVENT_NOTIFICATION_OPEN, bundle);
|
||||
}
|
||||
|
||||
public static void logNotificationReceived(Intent intent) {
|
||||
if (shouldUploadScionMetrics(intent)) {
|
||||
logToScion(Constants.ScionAnalytics.EVENT_NOTIFICATION_RECEIVE, intent.getExtras());
|
||||
}
|
||||
if (shouldUploadFirelogAnalytics(intent)) {
|
||||
logToFirelog(MessagingClientEvent.Event.MESSAGE_DELIVERED, intent, FirebaseMessaging.getTransportFactory());
|
||||
}
|
||||
}
|
||||
|
||||
private static void logToFirelog(MessagingClientEvent.Event event, Intent intent, T1.g gVar) {
|
||||
if (gVar == null) {
|
||||
Log.e(Constants.TAG, "TransportFactory is null. Skip exporting message delivery metrics to Big Query");
|
||||
return;
|
||||
}
|
||||
MessagingClientEvent eventToProto = eventToProto(event, intent);
|
||||
if (eventToProto == null) {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
r rVar = (r) gVar;
|
||||
rVar.a(Constants.FirelogAnalytics.FCM_LOG_SOURCE, new T1.c("proto"), new w(16)).a(new T1.a(MessagingClientEventExtension.newBuilder().setMessagingClientEvent(eventToProto).build(), T1.d.f1658a, new T1.b(Integer.valueOf(intent.getIntExtra(Constants.MessagePayloadKeys.PRODUCT_ID, DEFAULT_PRODUCT_ID)))), new w(8));
|
||||
} catch (RuntimeException e4) {
|
||||
Log.w(Constants.TAG, "Failed to send big query analytics payload.", e4);
|
||||
}
|
||||
}
|
||||
|
||||
public static void logToScion(String str, Bundle bundle) {
|
||||
try {
|
||||
FirebaseApp.getInstance();
|
||||
if (bundle == null) {
|
||||
bundle = new Bundle();
|
||||
}
|
||||
Bundle bundle2 = new Bundle();
|
||||
String composerId = getComposerId(bundle);
|
||||
if (composerId != null) {
|
||||
bundle2.putString("_nmid", composerId);
|
||||
}
|
||||
String composerLabel = getComposerLabel(bundle);
|
||||
if (composerLabel != null) {
|
||||
bundle2.putString(Constants.ScionAnalytics.PARAM_MESSAGE_NAME, composerLabel);
|
||||
}
|
||||
String messageLabel = getMessageLabel(bundle);
|
||||
if (!TextUtils.isEmpty(messageLabel)) {
|
||||
bundle2.putString(Constants.ScionAnalytics.PARAM_LABEL, messageLabel);
|
||||
}
|
||||
String messageChannel = getMessageChannel(bundle);
|
||||
if (!TextUtils.isEmpty(messageChannel)) {
|
||||
bundle2.putString(Constants.ScionAnalytics.PARAM_MESSAGE_CHANNEL, messageChannel);
|
||||
}
|
||||
String topic = getTopic(bundle);
|
||||
if (topic != null) {
|
||||
bundle2.putString(Constants.ScionAnalytics.PARAM_TOPIC, topic);
|
||||
}
|
||||
String messageTime = getMessageTime(bundle);
|
||||
if (messageTime != null) {
|
||||
try {
|
||||
bundle2.putInt(Constants.ScionAnalytics.PARAM_MESSAGE_TIME, Integer.parseInt(messageTime));
|
||||
} catch (NumberFormatException e4) {
|
||||
Log.w(Constants.TAG, "Error while parsing timestamp in GCM event", e4);
|
||||
}
|
||||
}
|
||||
String useDeviceTime = getUseDeviceTime(bundle);
|
||||
if (useDeviceTime != null) {
|
||||
try {
|
||||
bundle2.putInt(Constants.ScionAnalytics.PARAM_MESSAGE_DEVICE_TIME, Integer.parseInt(useDeviceTime));
|
||||
} catch (NumberFormatException e5) {
|
||||
Log.w(Constants.TAG, "Error while parsing use_device_time in GCM event", e5);
|
||||
}
|
||||
}
|
||||
String messageTypeForScion = getMessageTypeForScion(bundle);
|
||||
if (Constants.ScionAnalytics.EVENT_NOTIFICATION_RECEIVE.equals(str) || Constants.ScionAnalytics.EVENT_NOTIFICATION_FOREGROUND.equals(str)) {
|
||||
bundle2.putString(Constants.ScionAnalytics.PARAM_MESSAGE_TYPE, messageTypeForScion);
|
||||
}
|
||||
if (Log.isLoggable(Constants.TAG, 3)) {
|
||||
Log.d(Constants.TAG, "Logging to scion event=" + str + " scionPayload=" + bundle2);
|
||||
}
|
||||
AnalyticsConnector analyticsConnector = (AnalyticsConnector) FirebaseApp.getInstance().get(AnalyticsConnector.class);
|
||||
if (analyticsConnector != null) {
|
||||
analyticsConnector.logEvent("fcm", str, bundle2);
|
||||
} else {
|
||||
Log.w(Constants.TAG, "Unable to log event: analytics library is missing");
|
||||
}
|
||||
} catch (IllegalStateException unused) {
|
||||
Log.e(Constants.TAG, "Default FirebaseApp has not been initialized. Skip logging event to GA.");
|
||||
}
|
||||
}
|
||||
|
||||
public static void setDeliveryMetricsExportToBigQuery(boolean z3) {
|
||||
FirebaseApp.getInstance().getApplicationContext().getSharedPreferences("com.google.firebase.messaging", 0).edit().putBoolean(DELIVERY_METRICS_EXPORT_TO_BIG_QUERY_PREF, z3).apply();
|
||||
}
|
||||
|
||||
private static void setUserPropertyIfRequired(Bundle bundle) {
|
||||
if (bundle == null) {
|
||||
return;
|
||||
}
|
||||
if (!"1".equals(bundle.getString(Constants.AnalyticsKeys.TRACK_CONVERSIONS))) {
|
||||
if (Log.isLoggable(Constants.TAG, 3)) {
|
||||
Log.d(Constants.TAG, "Received event with track-conversion=false. Do not set user property");
|
||||
return;
|
||||
}
|
||||
return;
|
||||
}
|
||||
AnalyticsConnector analyticsConnector = (AnalyticsConnector) FirebaseApp.getInstance().get(AnalyticsConnector.class);
|
||||
if (Log.isLoggable(Constants.TAG, 3)) {
|
||||
Log.d(Constants.TAG, "Received event with track-conversion=true. Setting user property and reengagement event");
|
||||
}
|
||||
if (analyticsConnector == null) {
|
||||
Log.w(Constants.TAG, "Unable to set user property for conversion tracking: analytics library is missing");
|
||||
return;
|
||||
}
|
||||
String string = bundle.getString(Constants.AnalyticsKeys.COMPOSER_ID);
|
||||
analyticsConnector.setUserProperty("fcm", Constants.ScionAnalytics.USER_PROPERTY_FIREBASE_LAST_NOTIFICATION, string);
|
||||
Bundle bundle2 = new Bundle();
|
||||
bundle2.putString("source", REENGAGEMENT_SOURCE);
|
||||
bundle2.putString("medium", REENGAGEMENT_MEDIUM);
|
||||
bundle2.putString("campaign", string);
|
||||
analyticsConnector.logEvent("fcm", "_cmp", bundle2);
|
||||
}
|
||||
|
||||
public static boolean shouldUploadFirelogAnalytics(Intent intent) {
|
||||
if (intent == null || isDirectBootMessage(intent)) {
|
||||
return false;
|
||||
}
|
||||
return deliveryMetricsExportToBigQueryEnabled();
|
||||
}
|
||||
|
||||
public static boolean shouldUploadScionMetrics(Intent intent) {
|
||||
if (intent == null || isDirectBootMessage(intent)) {
|
||||
return false;
|
||||
}
|
||||
return shouldUploadScionMetrics(intent.getExtras());
|
||||
}
|
||||
|
||||
public static boolean shouldUploadScionMetrics(Bundle bundle) {
|
||||
if (bundle == null) {
|
||||
return false;
|
||||
}
|
||||
return "1".equals(bundle.getString(Constants.AnalyticsKeys.ENABLED));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.google.firebase.messaging;
|
||||
|
||||
import com.google.firebase.Firebase;
|
||||
import com.google.firebase.messaging.RemoteMessage;
|
||||
import kotlin.Unit;
|
||||
import kotlin.jvm.functions.Function1;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
|
||||
@kotlin.Metadata(d1 = {"\u0000,\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u000e\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0010\u0002\n\u0002\u0018\u0002\n\u0000\u001a/\u0010\u0005\u001a\u00020\u00062\u0006\u0010\u0007\u001a\u00020\b2\u0019\b\u0004\u0010\t\u001a\u0013\u0012\u0004\u0012\u00020\u000b\u0012\u0004\u0012\u00020\f0\n¢\u0006\u0002\b\rH\u0086\bø\u0001\u0000\"\u0015\u0010\u0000\u001a\u00020\u0001*\u00020\u00028F¢\u0006\u0006\u001a\u0004\b\u0003\u0010\u0004\u0082\u0002\u0007\n\u0005\b\u009920\u0001¨\u0006\u000e"}, d2 = {"messaging", "Lcom/google/firebase/messaging/FirebaseMessaging;", "Lcom/google/firebase/Firebase;", "getMessaging", "(Lcom/google/firebase/Firebase;)Lcom/google/firebase/messaging/FirebaseMessaging;", "remoteMessage", "Lcom/google/firebase/messaging/RemoteMessage;", "to", "", "init", "Lkotlin/Function1;", "Lcom/google/firebase/messaging/RemoteMessage$Builder;", "", "Lkotlin/ExtensionFunctionType;", "com.google.firebase-firebase-messaging"}, k = 2, mv = {1, 7, 1}, xi = 48)
|
||||
/* loaded from: classes3.dex */
|
||||
public final class MessagingKt {
|
||||
public static final FirebaseMessaging getMessaging(Firebase firebase) {
|
||||
Intrinsics.checkNotNullParameter(firebase, "<this>");
|
||||
FirebaseMessaging firebaseMessaging = FirebaseMessaging.getInstance();
|
||||
Intrinsics.checkNotNullExpressionValue(firebaseMessaging, "getInstance()");
|
||||
return firebaseMessaging;
|
||||
}
|
||||
|
||||
public static final RemoteMessage remoteMessage(String to, Function1<? super RemoteMessage.Builder, Unit> init) {
|
||||
Intrinsics.checkNotNullParameter(to, "to");
|
||||
Intrinsics.checkNotNullParameter(init, "init");
|
||||
RemoteMessage.Builder builder = new RemoteMessage.Builder(to);
|
||||
init.invoke(builder);
|
||||
RemoteMessage build = builder.build();
|
||||
Intrinsics.checkNotNullExpressionValue(build, "builder.build()");
|
||||
return build;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,142 @@
|
||||
package com.google.firebase.messaging;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.PackageInfo;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.content.pm.ResolveInfo;
|
||||
import android.util.Log;
|
||||
import com.google.android.gms.common.util.PlatformVersion;
|
||||
import com.google.firebase.FirebaseApp;
|
||||
import java.util.List;
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: package-private */
|
||||
/* loaded from: classes3.dex */
|
||||
public class Metadata {
|
||||
private static final String ACTION_C2DM_REGISTER = "com.google.android.c2dm.intent.REGISTER";
|
||||
private static final String ACTION_IID_TOKEN_REQUEST = "com.google.iid.TOKEN_REQUEST";
|
||||
static final int GMSCORE_NOT_FOUND = 0;
|
||||
private static final String GMSCORE_SEND_PERMISSION = "com.google.android.c2dm.permission.SEND";
|
||||
static final String GMS_PACKAGE = "com.google.android.gms";
|
||||
static final int IID_VIA_RECEIVER = 2;
|
||||
static final int IID_VIA_SERVICE = 1;
|
||||
private String appVersionCode;
|
||||
private String appVersionName;
|
||||
private final Context context;
|
||||
private int gmsVersionCode;
|
||||
private int iidImplementation = 0;
|
||||
|
||||
public Metadata(Context context) {
|
||||
this.context = context;
|
||||
}
|
||||
|
||||
public static String getDefaultSenderId(FirebaseApp firebaseApp) {
|
||||
String gcmSenderId = firebaseApp.getOptions().getGcmSenderId();
|
||||
if (gcmSenderId != null) {
|
||||
return gcmSenderId;
|
||||
}
|
||||
String applicationId = firebaseApp.getOptions().getApplicationId();
|
||||
if (!applicationId.startsWith("1:")) {
|
||||
return applicationId;
|
||||
}
|
||||
String[] split = applicationId.split(":");
|
||||
if (split.length < 2) {
|
||||
return null;
|
||||
}
|
||||
String str = split[1];
|
||||
if (str.isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
||||
private PackageInfo getPackageInfo(String str) {
|
||||
try {
|
||||
return this.context.getPackageManager().getPackageInfo(str, 0);
|
||||
} catch (PackageManager.NameNotFoundException e4) {
|
||||
Log.w(Constants.TAG, "Failed to find package " + e4);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private synchronized void populateAppVersionInfo() {
|
||||
PackageInfo packageInfo = getPackageInfo(this.context.getPackageName());
|
||||
if (packageInfo != null) {
|
||||
this.appVersionCode = Integer.toString(packageInfo.versionCode);
|
||||
this.appVersionName = packageInfo.versionName;
|
||||
}
|
||||
}
|
||||
|
||||
public synchronized String getAppVersionCode() {
|
||||
try {
|
||||
if (this.appVersionCode == null) {
|
||||
populateAppVersionInfo();
|
||||
}
|
||||
} catch (Throwable th) {
|
||||
throw th;
|
||||
}
|
||||
return this.appVersionCode;
|
||||
}
|
||||
|
||||
public synchronized String getAppVersionName() {
|
||||
try {
|
||||
if (this.appVersionName == null) {
|
||||
populateAppVersionInfo();
|
||||
}
|
||||
} catch (Throwable th) {
|
||||
throw th;
|
||||
}
|
||||
return this.appVersionName;
|
||||
}
|
||||
|
||||
public synchronized int getGmsVersionCode() {
|
||||
PackageInfo packageInfo;
|
||||
try {
|
||||
if (this.gmsVersionCode == 0 && (packageInfo = getPackageInfo("com.google.android.gms")) != null) {
|
||||
this.gmsVersionCode = packageInfo.versionCode;
|
||||
}
|
||||
} catch (Throwable th) {
|
||||
throw th;
|
||||
}
|
||||
return this.gmsVersionCode;
|
||||
}
|
||||
|
||||
public synchronized int getIidImplementation() {
|
||||
int i = this.iidImplementation;
|
||||
if (i != 0) {
|
||||
return i;
|
||||
}
|
||||
PackageManager packageManager = this.context.getPackageManager();
|
||||
if (packageManager.checkPermission(GMSCORE_SEND_PERMISSION, "com.google.android.gms") == -1) {
|
||||
Log.e(Constants.TAG, "Google Play services missing or without correct permission.");
|
||||
return 0;
|
||||
}
|
||||
if (!PlatformVersion.isAtLeastO()) {
|
||||
Intent intent = new Intent(ACTION_C2DM_REGISTER);
|
||||
intent.setPackage("com.google.android.gms");
|
||||
List<ResolveInfo> queryIntentServices = packageManager.queryIntentServices(intent, 0);
|
||||
if (queryIntentServices != null && queryIntentServices.size() > 0) {
|
||||
this.iidImplementation = 1;
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
Intent intent2 = new Intent(ACTION_IID_TOKEN_REQUEST);
|
||||
intent2.setPackage("com.google.android.gms");
|
||||
List<ResolveInfo> queryBroadcastReceivers = packageManager.queryBroadcastReceivers(intent2, 0);
|
||||
if (queryBroadcastReceivers != null && queryBroadcastReceivers.size() > 0) {
|
||||
this.iidImplementation = 2;
|
||||
return 2;
|
||||
}
|
||||
Log.w(Constants.TAG, "Failed to resolve IID implementation package, falling back");
|
||||
if (PlatformVersion.isAtLeastO()) {
|
||||
this.iidImplementation = 2;
|
||||
} else {
|
||||
this.iidImplementation = 1;
|
||||
}
|
||||
return this.iidImplementation;
|
||||
}
|
||||
|
||||
public boolean isGmscorePresent() {
|
||||
return getIidImplementation() != 0;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,289 @@
|
||||
package com.google.firebase.messaging;
|
||||
|
||||
import C.w;
|
||||
import android.content.res.Resources;
|
||||
import android.graphics.Color;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import com.google.firebase.messaging.Constants;
|
||||
import java.util.Arrays;
|
||||
import java.util.MissingFormatArgumentException;
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONException;
|
||||
|
||||
/* loaded from: classes3.dex */
|
||||
public class NotificationParams {
|
||||
private static final int COLOR_TRANSPARENT_IN_HEX = -16777216;
|
||||
private static final int EMPTY_JSON_ARRAY_LENGTH = 1;
|
||||
private static final String TAG = "NotificationParams";
|
||||
private static final int VISIBILITY_MAX = 1;
|
||||
private static final int VISIBILITY_MIN = -1;
|
||||
private final Bundle data;
|
||||
|
||||
public NotificationParams(Bundle bundle) {
|
||||
if (bundle == null) {
|
||||
throw new NullPointerException(Constants.ScionAnalytics.MessageType.DATA_MESSAGE);
|
||||
}
|
||||
this.data = new Bundle(bundle);
|
||||
}
|
||||
|
||||
private static int getLightColor(String str) {
|
||||
int parseColor = Color.parseColor(str);
|
||||
if (parseColor != COLOR_TRANSPARENT_IN_HEX) {
|
||||
return parseColor;
|
||||
}
|
||||
throw new IllegalArgumentException("Transparent color is invalid");
|
||||
}
|
||||
|
||||
private static boolean isAnalyticsKey(String str) {
|
||||
return str.startsWith(Constants.AnalyticsKeys.PREFIX) || str.equals(Constants.MessagePayloadKeys.FROM);
|
||||
}
|
||||
|
||||
private static boolean isReservedKey(String str) {
|
||||
return str.startsWith(Constants.MessagePayloadKeys.RESERVED_CLIENT_LIB_PREFIX) || str.startsWith(Constants.MessageNotificationKeys.NOTIFICATION_PREFIX) || str.startsWith(Constants.MessageNotificationKeys.NOTIFICATION_PREFIX_OLD);
|
||||
}
|
||||
|
||||
private static String keyWithOldPrefix(String str) {
|
||||
return !str.startsWith(Constants.MessageNotificationKeys.NOTIFICATION_PREFIX) ? str : str.replace(Constants.MessageNotificationKeys.NOTIFICATION_PREFIX, Constants.MessageNotificationKeys.NOTIFICATION_PREFIX_OLD);
|
||||
}
|
||||
|
||||
private String normalizePrefix(String str) {
|
||||
if (!this.data.containsKey(str) && str.startsWith(Constants.MessageNotificationKeys.NOTIFICATION_PREFIX)) {
|
||||
String keyWithOldPrefix = keyWithOldPrefix(str);
|
||||
if (this.data.containsKey(keyWithOldPrefix)) {
|
||||
return keyWithOldPrefix;
|
||||
}
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
||||
private static String userFriendlyKey(String str) {
|
||||
return str.startsWith(Constants.MessageNotificationKeys.NOTIFICATION_PREFIX) ? str.substring(6) : str;
|
||||
}
|
||||
|
||||
public boolean getBoolean(String str) {
|
||||
String string = getString(str);
|
||||
return "1".equals(string) || Boolean.parseBoolean(string);
|
||||
}
|
||||
|
||||
public Integer getInteger(String str) {
|
||||
String string = getString(str);
|
||||
if (TextUtils.isEmpty(string)) {
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
return Integer.valueOf(Integer.parseInt(string));
|
||||
} catch (NumberFormatException unused) {
|
||||
Log.w(TAG, "Couldn't parse value of " + userFriendlyKey(str) + "(" + string + ") into an int");
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public JSONArray getJSONArray(String str) {
|
||||
String string = getString(str);
|
||||
if (TextUtils.isEmpty(string)) {
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
return new JSONArray(string);
|
||||
} catch (JSONException unused) {
|
||||
Log.w(TAG, "Malformed JSON for key " + userFriendlyKey(str) + ": " + string + ", falling back to default");
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public int[] getLightSettings() {
|
||||
JSONArray jSONArray = getJSONArray(Constants.MessageNotificationKeys.LIGHT_SETTINGS);
|
||||
if (jSONArray == null) {
|
||||
return null;
|
||||
}
|
||||
int[] iArr = new int[3];
|
||||
try {
|
||||
if (jSONArray.length() != 3) {
|
||||
throw new JSONException("lightSettings don't have all three fields");
|
||||
}
|
||||
iArr[0] = getLightColor(jSONArray.optString(0));
|
||||
iArr[1] = jSONArray.optInt(1);
|
||||
iArr[2] = jSONArray.optInt(2);
|
||||
return iArr;
|
||||
} catch (IllegalArgumentException e4) {
|
||||
Log.w(TAG, "LightSettings is invalid: " + jSONArray + ". " + e4.getMessage() + ". Skipping setting LightSettings");
|
||||
return null;
|
||||
} catch (JSONException unused) {
|
||||
Log.w(TAG, "LightSettings is invalid: " + jSONArray + ". Skipping setting LightSettings");
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public Uri getLink() {
|
||||
String string = getString(Constants.MessageNotificationKeys.LINK_ANDROID);
|
||||
if (TextUtils.isEmpty(string)) {
|
||||
string = getString(Constants.MessageNotificationKeys.LINK);
|
||||
}
|
||||
if (TextUtils.isEmpty(string)) {
|
||||
return null;
|
||||
}
|
||||
return Uri.parse(string);
|
||||
}
|
||||
|
||||
public Object[] getLocalizationArgsForKey(String str) {
|
||||
JSONArray jSONArray = getJSONArray(str + Constants.MessageNotificationKeys.TEXT_ARGS_SUFFIX);
|
||||
if (jSONArray == null) {
|
||||
return null;
|
||||
}
|
||||
int length = jSONArray.length();
|
||||
String[] strArr = new String[length];
|
||||
for (int i = 0; i < length; i++) {
|
||||
strArr[i] = jSONArray.optString(i);
|
||||
}
|
||||
return strArr;
|
||||
}
|
||||
|
||||
public String getLocalizationResourceForKey(String str) {
|
||||
return getString(str + Constants.MessageNotificationKeys.TEXT_RESOURCE_SUFFIX);
|
||||
}
|
||||
|
||||
public String getLocalizedString(Resources resources, String str, String str2) {
|
||||
String localizationResourceForKey = getLocalizationResourceForKey(str2);
|
||||
if (TextUtils.isEmpty(localizationResourceForKey)) {
|
||||
return null;
|
||||
}
|
||||
int identifier = resources.getIdentifier(localizationResourceForKey, "string", str);
|
||||
if (identifier == 0) {
|
||||
Log.w(TAG, userFriendlyKey(w.n(str2, Constants.MessageNotificationKeys.TEXT_RESOURCE_SUFFIX)) + " resource not found: " + str2 + " Default value will be used.");
|
||||
return null;
|
||||
}
|
||||
Object[] localizationArgsForKey = getLocalizationArgsForKey(str2);
|
||||
if (localizationArgsForKey == null) {
|
||||
return resources.getString(identifier);
|
||||
}
|
||||
try {
|
||||
return resources.getString(identifier, localizationArgsForKey);
|
||||
} catch (MissingFormatArgumentException e4) {
|
||||
Log.w(TAG, "Missing format argument for " + userFriendlyKey(str2) + ": " + Arrays.toString(localizationArgsForKey) + " Default value will be used.", e4);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public Long getLong(String str) {
|
||||
String string = getString(str);
|
||||
if (TextUtils.isEmpty(string)) {
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
return Long.valueOf(Long.parseLong(string));
|
||||
} catch (NumberFormatException unused) {
|
||||
Log.w(TAG, "Couldn't parse value of " + userFriendlyKey(str) + "(" + string + ") into a long");
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public String getNotificationChannelId() {
|
||||
return getString(Constants.MessageNotificationKeys.CHANNEL);
|
||||
}
|
||||
|
||||
public Integer getNotificationCount() {
|
||||
Integer integer = getInteger(Constants.MessageNotificationKeys.NOTIFICATION_COUNT);
|
||||
if (integer == null) {
|
||||
return null;
|
||||
}
|
||||
if (integer.intValue() >= 0) {
|
||||
return integer;
|
||||
}
|
||||
Log.w(Constants.TAG, "notificationCount is invalid: " + integer + ". Skipping setting notificationCount.");
|
||||
return null;
|
||||
}
|
||||
|
||||
public Integer getNotificationPriority() {
|
||||
Integer integer = getInteger(Constants.MessageNotificationKeys.NOTIFICATION_PRIORITY);
|
||||
if (integer == null) {
|
||||
return null;
|
||||
}
|
||||
if (integer.intValue() >= -2 && integer.intValue() <= 2) {
|
||||
return integer;
|
||||
}
|
||||
Log.w(Constants.TAG, "notificationPriority is invalid " + integer + ". Skipping setting notificationPriority.");
|
||||
return null;
|
||||
}
|
||||
|
||||
public String getPossiblyLocalizedString(Resources resources, String str, String str2) {
|
||||
String string = getString(str2);
|
||||
return !TextUtils.isEmpty(string) ? string : getLocalizedString(resources, str, str2);
|
||||
}
|
||||
|
||||
public String getSoundResourceName() {
|
||||
String string = getString(Constants.MessageNotificationKeys.SOUND_2);
|
||||
return TextUtils.isEmpty(string) ? getString(Constants.MessageNotificationKeys.SOUND) : string;
|
||||
}
|
||||
|
||||
public String getString(String str) {
|
||||
return this.data.getString(normalizePrefix(str));
|
||||
}
|
||||
|
||||
public long[] getVibrateTimings() {
|
||||
JSONArray jSONArray = getJSONArray(Constants.MessageNotificationKeys.VIBRATE_TIMINGS);
|
||||
if (jSONArray == null) {
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
if (jSONArray.length() <= 1) {
|
||||
throw new JSONException("vibrateTimings have invalid length");
|
||||
}
|
||||
int length = jSONArray.length();
|
||||
long[] jArr = new long[length];
|
||||
for (int i = 0; i < length; i++) {
|
||||
jArr[i] = jSONArray.optLong(i);
|
||||
}
|
||||
return jArr;
|
||||
} catch (NumberFormatException | JSONException unused) {
|
||||
Log.w(TAG, "User defined vibrateTimings is invalid: " + jSONArray + ". Skipping setting vibrateTimings.");
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public Integer getVisibility() {
|
||||
Integer integer = getInteger(Constants.MessageNotificationKeys.VISIBILITY);
|
||||
if (integer == null) {
|
||||
return null;
|
||||
}
|
||||
if (integer.intValue() >= -1 && integer.intValue() <= 1) {
|
||||
return integer;
|
||||
}
|
||||
Log.w(TAG, "visibility is invalid: " + integer + ". Skipping setting visibility.");
|
||||
return null;
|
||||
}
|
||||
|
||||
public boolean hasImage() {
|
||||
return !TextUtils.isEmpty(getString(Constants.MessageNotificationKeys.IMAGE_URL));
|
||||
}
|
||||
|
||||
public boolean isNotification() {
|
||||
return getBoolean(Constants.MessageNotificationKeys.ENABLE_NOTIFICATION);
|
||||
}
|
||||
|
||||
public Bundle paramsForAnalyticsIntent() {
|
||||
Bundle bundle = new Bundle(this.data);
|
||||
for (String str : this.data.keySet()) {
|
||||
if (!isAnalyticsKey(str)) {
|
||||
bundle.remove(str);
|
||||
}
|
||||
}
|
||||
return bundle;
|
||||
}
|
||||
|
||||
public Bundle paramsWithReservedKeysRemoved() {
|
||||
Bundle bundle = new Bundle(this.data);
|
||||
for (String str : this.data.keySet()) {
|
||||
if (isReservedKey(str)) {
|
||||
bundle.remove(str);
|
||||
}
|
||||
}
|
||||
return bundle;
|
||||
}
|
||||
|
||||
public static boolean isNotification(Bundle bundle) {
|
||||
return "1".equals(bundle.getString(Constants.MessageNotificationKeys.ENABLE_NOTIFICATION)) || "1".equals(bundle.getString(keyWithOldPrefix(Constants.MessageNotificationKeys.ENABLE_NOTIFICATION)));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.google.firebase.messaging;
|
||||
|
||||
import com.google.firebase.encoders.annotations.Encodable;
|
||||
import com.google.firebase.encoders.proto.ProtobufEncoder;
|
||||
import com.google.firebase.messaging.reporting.MessagingClientEventExtension;
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStream;
|
||||
|
||||
@Encodable
|
||||
/* loaded from: classes3.dex */
|
||||
public abstract class ProtoEncoderDoNotUse {
|
||||
private static final ProtobufEncoder ENCODER = ProtobufEncoder.builder().configureWith(AutoProtoEncoderDoNotUseEncoder.CONFIG).build();
|
||||
|
||||
private ProtoEncoderDoNotUse() {
|
||||
}
|
||||
|
||||
public static byte[] encode(Object obj) {
|
||||
return ENCODER.encode(obj);
|
||||
}
|
||||
|
||||
public abstract MessagingClientEventExtension getMessagingClientEventExtension();
|
||||
|
||||
public static void encode(Object obj, OutputStream outputStream) throws IOException {
|
||||
ENCODER.encode(obj, outputStream);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,106 @@
|
||||
package com.google.firebase.messaging;
|
||||
|
||||
import android.annotation.TargetApi;
|
||||
import android.app.NotificationManager;
|
||||
import android.content.Context;
|
||||
import android.content.pm.ApplicationInfo;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.os.Binder;
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
import com.google.android.gms.common.util.PlatformVersion;
|
||||
import com.google.android.gms.tasks.Task;
|
||||
import com.google.android.gms.tasks.TaskCompletionSource;
|
||||
import com.google.android.gms.tasks.Tasks;
|
||||
import java.util.concurrent.Executor;
|
||||
import n.ExecutorC0507a;
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: package-private */
|
||||
/* loaded from: classes3.dex */
|
||||
public final class ProxyNotificationInitializer {
|
||||
private static final String MANIFEST_METADATA_NOTIFICATION_DELEGATION_ENABLED = "firebase_messaging_notification_delegation_enabled";
|
||||
|
||||
private ProxyNotificationInitializer() {
|
||||
}
|
||||
|
||||
private static boolean allowedToUse(Context context) {
|
||||
return Binder.getCallingUid() == context.getApplicationInfo().uid;
|
||||
}
|
||||
|
||||
public static void initialize(Context context) {
|
||||
if (ProxyNotificationPreferences.isProxyNotificationInitialized(context)) {
|
||||
return;
|
||||
}
|
||||
setEnableProxyNotification(new ExecutorC0507a(1), context, shouldEnableProxyNotification(context));
|
||||
}
|
||||
|
||||
public static boolean isProxyNotificationEnabled(Context context) {
|
||||
if (!PlatformVersion.isAtLeastQ()) {
|
||||
if (Log.isLoggable(Constants.TAG, 3)) {
|
||||
Log.d(Constants.TAG, "Platform doesn't support proxying.");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
if (!allowedToUse(context)) {
|
||||
Log.e(Constants.TAG, "error retrieving notification delegate for package " + context.getPackageName());
|
||||
return false;
|
||||
}
|
||||
if (!"com.google.android.gms".equals(((NotificationManager) context.getSystemService(NotificationManager.class)).getNotificationDelegate())) {
|
||||
return false;
|
||||
}
|
||||
if (!Log.isLoggable(Constants.TAG, 3)) {
|
||||
return true;
|
||||
}
|
||||
Log.d(Constants.TAG, "GMS core is set for proxying");
|
||||
return true;
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: private */
|
||||
public static /* synthetic */ void lambda$setEnableProxyNotification$0(Context context, boolean z3, TaskCompletionSource taskCompletionSource) {
|
||||
try {
|
||||
if (!allowedToUse(context)) {
|
||||
Log.e(Constants.TAG, "error configuring notification delegate for package " + context.getPackageName());
|
||||
} else {
|
||||
ProxyNotificationPreferences.setProxyNotificationsInitialized(context, true);
|
||||
NotificationManager notificationManager = (NotificationManager) context.getSystemService(NotificationManager.class);
|
||||
if (z3) {
|
||||
notificationManager.setNotificationDelegate("com.google.android.gms");
|
||||
} else if ("com.google.android.gms".equals(notificationManager.getNotificationDelegate())) {
|
||||
notificationManager.setNotificationDelegate(null);
|
||||
}
|
||||
}
|
||||
} finally {
|
||||
taskCompletionSource.trySetResult(null);
|
||||
}
|
||||
}
|
||||
|
||||
@TargetApi(29)
|
||||
public static Task<Void> setEnableProxyNotification(Executor executor, final Context context, final boolean z3) {
|
||||
if (!PlatformVersion.isAtLeastQ()) {
|
||||
return Tasks.forResult(null);
|
||||
}
|
||||
final TaskCompletionSource taskCompletionSource = new TaskCompletionSource();
|
||||
executor.execute(new Runnable() { // from class: com.google.firebase.messaging.l
|
||||
@Override // java.lang.Runnable
|
||||
public final void run() {
|
||||
ProxyNotificationInitializer.lambda$setEnableProxyNotification$0(context, z3, taskCompletionSource);
|
||||
}
|
||||
});
|
||||
return taskCompletionSource.getTask();
|
||||
}
|
||||
|
||||
private static boolean shouldEnableProxyNotification(Context context) {
|
||||
ApplicationInfo applicationInfo;
|
||||
Bundle bundle;
|
||||
try {
|
||||
Context applicationContext = context.getApplicationContext();
|
||||
PackageManager packageManager = applicationContext.getPackageManager();
|
||||
if (packageManager == null || (applicationInfo = packageManager.getApplicationInfo(applicationContext.getPackageName(), 128)) == null || (bundle = applicationInfo.metaData) == null || !bundle.containsKey(MANIFEST_METADATA_NOTIFICATION_DELEGATION_ENABLED)) {
|
||||
return true;
|
||||
}
|
||||
return applicationInfo.metaData.getBoolean(MANIFEST_METADATA_NOTIFICATION_DELEGATION_ENABLED);
|
||||
} catch (PackageManager.NameNotFoundException unused) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.google.firebase.messaging;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: package-private */
|
||||
/* loaded from: classes3.dex */
|
||||
public final class ProxyNotificationPreferences {
|
||||
private static final String FCM_PREFERENCES = "com.google.firebase.messaging";
|
||||
|
||||
private ProxyNotificationPreferences() {
|
||||
}
|
||||
|
||||
private static SharedPreferences getPreference(Context context) {
|
||||
Context applicationContext = context.getApplicationContext();
|
||||
if (applicationContext != null) {
|
||||
context = applicationContext;
|
||||
}
|
||||
return context.getSharedPreferences("com.google.firebase.messaging", 0);
|
||||
}
|
||||
|
||||
public static boolean isProxyNotificationInitialized(Context context) {
|
||||
return getPreference(context).getBoolean("proxy_notification_initialized", false);
|
||||
}
|
||||
|
||||
public static void setProxyNotificationsInitialized(Context context, boolean z3) {
|
||||
SharedPreferences.Editor edit = getPreference(context).edit();
|
||||
edit.putBoolean("proxy_notification_initialized", z3);
|
||||
edit.apply();
|
||||
}
|
||||
}
|
||||
362
apk_decompiled/sources/com/google/firebase/messaging/R.java
Normal file
362
apk_decompiled/sources/com/google/firebase/messaging/R.java
Normal file
@@ -0,0 +1,362 @@
|
||||
package com.google.firebase.messaging;
|
||||
|
||||
/* loaded from: classes3.dex */
|
||||
public final class R {
|
||||
|
||||
/* loaded from: classes3.dex */
|
||||
public static final class attr {
|
||||
public static final int alpha = 0x7f030031;
|
||||
public static final int buttonSize = 0x7f0300a5;
|
||||
public static final int circleCrop = 0x7f0300e9;
|
||||
public static final int colorScheme = 0x7f030135;
|
||||
public static final int coordinatorLayoutStyle = 0x7f03016c;
|
||||
public static final int font = 0x7f03022d;
|
||||
public static final int fontProviderAuthority = 0x7f03022f;
|
||||
public static final int fontProviderCerts = 0x7f030230;
|
||||
public static final int fontProviderFetchStrategy = 0x7f030231;
|
||||
public static final int fontProviderFetchTimeout = 0x7f030232;
|
||||
public static final int fontProviderPackage = 0x7f030233;
|
||||
public static final int fontProviderQuery = 0x7f030234;
|
||||
public static final int fontStyle = 0x7f030236;
|
||||
public static final int fontVariationSettings = 0x7f030237;
|
||||
public static final int fontWeight = 0x7f030238;
|
||||
public static final int imageAspectRatio = 0x7f030271;
|
||||
public static final int imageAspectRatioAdjust = 0x7f030272;
|
||||
public static final int keylines = 0x7f0302b5;
|
||||
public static final int layout_anchor = 0x7f0302c6;
|
||||
public static final int layout_anchorGravity = 0x7f0302c7;
|
||||
public static final int layout_behavior = 0x7f0302c9;
|
||||
public static final int layout_dodgeInsetEdges = 0x7f0302fa;
|
||||
public static final int layout_insetEdge = 0x7f030305;
|
||||
public static final int layout_keyline = 0x7f030306;
|
||||
public static final int scopeUris = 0x7f03041a;
|
||||
public static final int statusBarBackground = 0x7f030488;
|
||||
public static final int ttcIndex = 0x7f030559;
|
||||
|
||||
private attr() {
|
||||
}
|
||||
}
|
||||
|
||||
/* loaded from: classes3.dex */
|
||||
public static final class color {
|
||||
public static final int common_google_signin_btn_text_dark = 0x7f050045;
|
||||
public static final int common_google_signin_btn_text_dark_default = 0x7f050046;
|
||||
public static final int common_google_signin_btn_text_dark_disabled = 0x7f050047;
|
||||
public static final int common_google_signin_btn_text_dark_focused = 0x7f050048;
|
||||
public static final int common_google_signin_btn_text_dark_pressed = 0x7f050049;
|
||||
public static final int common_google_signin_btn_text_light = 0x7f05004a;
|
||||
public static final int common_google_signin_btn_text_light_default = 0x7f05004b;
|
||||
public static final int common_google_signin_btn_text_light_disabled = 0x7f05004c;
|
||||
public static final int common_google_signin_btn_text_light_focused = 0x7f05004d;
|
||||
public static final int common_google_signin_btn_text_light_pressed = 0x7f05004e;
|
||||
public static final int common_google_signin_btn_tint = 0x7f05004f;
|
||||
public static final int notification_action_color_filter = 0x7f050315;
|
||||
public static final int notification_icon_bg_color = 0x7f050316;
|
||||
public static final int ripple_material_light = 0x7f050322;
|
||||
public static final int secondary_text_default_material_light = 0x7f050324;
|
||||
|
||||
private color() {
|
||||
}
|
||||
}
|
||||
|
||||
/* loaded from: classes3.dex */
|
||||
public static final class dimen {
|
||||
public static final int compat_button_inset_horizontal_material = 0x7f06006d;
|
||||
public static final int compat_button_inset_vertical_material = 0x7f06006e;
|
||||
public static final int compat_button_padding_horizontal_material = 0x7f06006f;
|
||||
public static final int compat_button_padding_vertical_material = 0x7f060070;
|
||||
public static final int compat_control_corner_material = 0x7f060071;
|
||||
public static final int compat_notification_large_icon_max_height = 0x7f060072;
|
||||
public static final int compat_notification_large_icon_max_width = 0x7f060073;
|
||||
public static final int notification_action_icon_size = 0x7f060385;
|
||||
public static final int notification_action_text_size = 0x7f060386;
|
||||
public static final int notification_big_circle_margin = 0x7f060387;
|
||||
public static final int notification_content_margin_start = 0x7f060388;
|
||||
public static final int notification_large_icon_height = 0x7f06038d;
|
||||
public static final int notification_large_icon_width = 0x7f06038e;
|
||||
public static final int notification_main_column_padding_top = 0x7f06038f;
|
||||
public static final int notification_media_narrow_margin = 0x7f060391;
|
||||
public static final int notification_right_icon_size = 0x7f060393;
|
||||
public static final int notification_right_side_padding_top = 0x7f060394;
|
||||
public static final int notification_small_icon_background_padding = 0x7f060395;
|
||||
public static final int notification_small_icon_size_as_large = 0x7f060396;
|
||||
public static final int notification_subtext_size = 0x7f060397;
|
||||
public static final int notification_top_pad = 0x7f06039b;
|
||||
public static final int notification_top_pad_large_text = 0x7f06039c;
|
||||
|
||||
private dimen() {
|
||||
}
|
||||
}
|
||||
|
||||
/* loaded from: classes3.dex */
|
||||
public static final class drawable {
|
||||
public static final int common_full_open_on_phone = 0x7f07008b;
|
||||
public static final int common_google_signin_btn_icon_dark = 0x7f07008c;
|
||||
public static final int common_google_signin_btn_icon_dark_focused = 0x7f07008d;
|
||||
public static final int common_google_signin_btn_icon_dark_normal = 0x7f07008e;
|
||||
public static final int common_google_signin_btn_icon_dark_normal_background = 0x7f07008f;
|
||||
public static final int common_google_signin_btn_icon_disabled = 0x7f070090;
|
||||
public static final int common_google_signin_btn_icon_light = 0x7f070091;
|
||||
public static final int common_google_signin_btn_icon_light_focused = 0x7f070092;
|
||||
public static final int common_google_signin_btn_icon_light_normal = 0x7f070093;
|
||||
public static final int common_google_signin_btn_icon_light_normal_background = 0x7f070094;
|
||||
public static final int common_google_signin_btn_text_dark = 0x7f070095;
|
||||
public static final int common_google_signin_btn_text_dark_focused = 0x7f070096;
|
||||
public static final int common_google_signin_btn_text_dark_normal = 0x7f070097;
|
||||
public static final int common_google_signin_btn_text_dark_normal_background = 0x7f070098;
|
||||
public static final int common_google_signin_btn_text_disabled = 0x7f070099;
|
||||
public static final int common_google_signin_btn_text_light = 0x7f07009a;
|
||||
public static final int common_google_signin_btn_text_light_focused = 0x7f07009b;
|
||||
public static final int common_google_signin_btn_text_light_normal = 0x7f07009c;
|
||||
public static final int common_google_signin_btn_text_light_normal_background = 0x7f07009d;
|
||||
public static final int googleg_disabled_color_18 = 0x7f0700ac;
|
||||
public static final int googleg_standard_color_18 = 0x7f0700ad;
|
||||
public static final int notification_action_background = 0x7f070181;
|
||||
public static final int notification_bg = 0x7f070182;
|
||||
public static final int notification_bg_low = 0x7f070183;
|
||||
public static final int notification_bg_low_normal = 0x7f070184;
|
||||
public static final int notification_bg_low_pressed = 0x7f070185;
|
||||
public static final int notification_bg_normal = 0x7f070186;
|
||||
public static final int notification_bg_normal_pressed = 0x7f070187;
|
||||
public static final int notification_icon_background = 0x7f070188;
|
||||
public static final int notification_template_icon_bg = 0x7f07018a;
|
||||
public static final int notification_template_icon_low_bg = 0x7f07018b;
|
||||
public static final int notification_tile_bg = 0x7f07018c;
|
||||
public static final int notify_panel_notification_icon_bg = 0x7f07018d;
|
||||
|
||||
private drawable() {
|
||||
}
|
||||
}
|
||||
|
||||
/* loaded from: classes3.dex */
|
||||
public static final class id {
|
||||
public static final int accessibility_action_clickable_span = 0x7f090013;
|
||||
public static final int accessibility_custom_action_0 = 0x7f090014;
|
||||
public static final int accessibility_custom_action_1 = 0x7f090015;
|
||||
public static final int accessibility_custom_action_10 = 0x7f090016;
|
||||
public static final int accessibility_custom_action_11 = 0x7f090017;
|
||||
public static final int accessibility_custom_action_12 = 0x7f090018;
|
||||
public static final int accessibility_custom_action_13 = 0x7f090019;
|
||||
public static final int accessibility_custom_action_14 = 0x7f09001a;
|
||||
public static final int accessibility_custom_action_15 = 0x7f09001b;
|
||||
public static final int accessibility_custom_action_16 = 0x7f09001c;
|
||||
public static final int accessibility_custom_action_17 = 0x7f09001d;
|
||||
public static final int accessibility_custom_action_18 = 0x7f09001e;
|
||||
public static final int accessibility_custom_action_19 = 0x7f09001f;
|
||||
public static final int accessibility_custom_action_2 = 0x7f090020;
|
||||
public static final int accessibility_custom_action_20 = 0x7f090021;
|
||||
public static final int accessibility_custom_action_21 = 0x7f090022;
|
||||
public static final int accessibility_custom_action_22 = 0x7f090023;
|
||||
public static final int accessibility_custom_action_23 = 0x7f090024;
|
||||
public static final int accessibility_custom_action_24 = 0x7f090025;
|
||||
public static final int accessibility_custom_action_25 = 0x7f090026;
|
||||
public static final int accessibility_custom_action_26 = 0x7f090027;
|
||||
public static final int accessibility_custom_action_27 = 0x7f090028;
|
||||
public static final int accessibility_custom_action_28 = 0x7f090029;
|
||||
public static final int accessibility_custom_action_29 = 0x7f09002a;
|
||||
public static final int accessibility_custom_action_3 = 0x7f09002b;
|
||||
public static final int accessibility_custom_action_30 = 0x7f09002c;
|
||||
public static final int accessibility_custom_action_31 = 0x7f09002d;
|
||||
public static final int accessibility_custom_action_4 = 0x7f09002e;
|
||||
public static final int accessibility_custom_action_5 = 0x7f09002f;
|
||||
public static final int accessibility_custom_action_6 = 0x7f090030;
|
||||
public static final int accessibility_custom_action_7 = 0x7f090031;
|
||||
public static final int accessibility_custom_action_8 = 0x7f090032;
|
||||
public static final int accessibility_custom_action_9 = 0x7f090033;
|
||||
public static final int action_container = 0x7f090045;
|
||||
public static final int action_divider = 0x7f090048;
|
||||
public static final int action_image = 0x7f09004a;
|
||||
public static final int action_text = 0x7f090051;
|
||||
public static final int actions = 0x7f090052;
|
||||
public static final int adjust_height = 0x7f090058;
|
||||
public static final int adjust_width = 0x7f090059;
|
||||
public static final int async = 0x7f090071;
|
||||
public static final int auto = 0x7f090072;
|
||||
public static final int blocking = 0x7f090082;
|
||||
public static final int bottom = 0x7f090083;
|
||||
public static final int chronometer = 0x7f0900a9;
|
||||
public static final int dark = 0x7f0900ea;
|
||||
public static final int dialog_button = 0x7f09010b;
|
||||
public static final int end = 0x7f090133;
|
||||
public static final int forever = 0x7f090152;
|
||||
public static final int icon = 0x7f090195;
|
||||
public static final int icon_group = 0x7f090196;
|
||||
public static final int icon_only = 0x7f090198;
|
||||
public static final int info = 0x7f0901a9;
|
||||
public static final int italic = 0x7f0901be;
|
||||
public static final int left = 0x7f0901e2;
|
||||
public static final int light = 0x7f0901e7;
|
||||
public static final int line1 = 0x7f0901e9;
|
||||
public static final int line3 = 0x7f0901ea;
|
||||
public static final int none = 0x7f090264;
|
||||
public static final int normal = 0x7f090265;
|
||||
public static final int notification_background = 0x7f090269;
|
||||
public static final int notification_main_column = 0x7f09026a;
|
||||
public static final int notification_main_column_container = 0x7f09026b;
|
||||
public static final int right = 0x7f0902cd;
|
||||
public static final int right_icon = 0x7f0902cf;
|
||||
public static final int right_side = 0x7f0902d0;
|
||||
public static final int standard = 0x7f090321;
|
||||
public static final int start = 0x7f090322;
|
||||
public static final int tag_accessibility_actions = 0x7f09035c;
|
||||
public static final int tag_accessibility_clickable_spans = 0x7f09035d;
|
||||
public static final int tag_accessibility_heading = 0x7f09035e;
|
||||
public static final int tag_accessibility_pane_title = 0x7f09035f;
|
||||
public static final int tag_screen_reader_focusable = 0x7f090363;
|
||||
public static final int tag_transition_group = 0x7f090365;
|
||||
public static final int tag_unhandled_key_event_manager = 0x7f090366;
|
||||
public static final int tag_unhandled_key_listeners = 0x7f090367;
|
||||
public static final int text = 0x7f09036d;
|
||||
public static final int text2 = 0x7f09036e;
|
||||
public static final int time = 0x7f09038e;
|
||||
public static final int title = 0x7f090393;
|
||||
public static final int top = 0x7f0903ac;
|
||||
public static final int wide = 0x7f090401;
|
||||
|
||||
private id() {
|
||||
}
|
||||
}
|
||||
|
||||
/* loaded from: classes3.dex */
|
||||
public static final class integer {
|
||||
public static final int google_play_services_version = 0x7f0a0009;
|
||||
public static final int status_bar_notification_info_maxnum = 0x7f0a0045;
|
||||
|
||||
private integer() {
|
||||
}
|
||||
}
|
||||
|
||||
/* loaded from: classes3.dex */
|
||||
public static final class layout {
|
||||
public static final int custom_dialog = 0x7f0c0026;
|
||||
public static final int notification_action = 0x7f0c00a8;
|
||||
public static final int notification_action_tombstone = 0x7f0c00a9;
|
||||
public static final int notification_template_custom_big = 0x7f0c00aa;
|
||||
public static final int notification_template_icon_group = 0x7f0c00ab;
|
||||
public static final int notification_template_part_chronometer = 0x7f0c00ac;
|
||||
public static final int notification_template_part_time = 0x7f0c00ad;
|
||||
|
||||
private layout() {
|
||||
}
|
||||
}
|
||||
|
||||
/* loaded from: classes3.dex */
|
||||
public static final class raw {
|
||||
public static final int firebase_common_keep = 0x7f120000;
|
||||
|
||||
private raw() {
|
||||
}
|
||||
}
|
||||
|
||||
/* loaded from: classes3.dex */
|
||||
public static final class string {
|
||||
public static final int common_google_play_services_enable_button = 0x7f1300b4;
|
||||
public static final int common_google_play_services_enable_text = 0x7f1300b5;
|
||||
public static final int common_google_play_services_enable_title = 0x7f1300b6;
|
||||
public static final int common_google_play_services_install_button = 0x7f1300b7;
|
||||
public static final int common_google_play_services_install_text = 0x7f1300b8;
|
||||
public static final int common_google_play_services_install_title = 0x7f1300b9;
|
||||
public static final int common_google_play_services_notification_channel_name = 0x7f1300ba;
|
||||
public static final int common_google_play_services_notification_ticker = 0x7f1300bb;
|
||||
public static final int common_google_play_services_unknown_issue = 0x7f1300bc;
|
||||
public static final int common_google_play_services_unsupported_text = 0x7f1300bd;
|
||||
public static final int common_google_play_services_update_button = 0x7f1300be;
|
||||
public static final int common_google_play_services_update_text = 0x7f1300bf;
|
||||
public static final int common_google_play_services_update_title = 0x7f1300c0;
|
||||
public static final int common_google_play_services_updating_text = 0x7f1300c1;
|
||||
public static final int common_google_play_services_wear_update_text = 0x7f1300c2;
|
||||
public static final int common_open_on_phone = 0x7f1300c4;
|
||||
public static final int common_signin_button_text = 0x7f1300c5;
|
||||
public static final int common_signin_button_text_long = 0x7f1300c6;
|
||||
public static final int fcm_fallback_notification_channel_label = 0x7f130134;
|
||||
public static final int status_bar_notification_info_overflow = 0x7f13023b;
|
||||
|
||||
private string() {
|
||||
}
|
||||
}
|
||||
|
||||
/* loaded from: classes3.dex */
|
||||
public static final class style {
|
||||
public static final int TextAppearance_Compat_Notification = 0x7f1401fb;
|
||||
public static final int TextAppearance_Compat_Notification_Info = 0x7f1401fc;
|
||||
public static final int TextAppearance_Compat_Notification_Line2 = 0x7f1401fd;
|
||||
public static final int TextAppearance_Compat_Notification_Time = 0x7f1401fe;
|
||||
public static final int TextAppearance_Compat_Notification_Title = 0x7f1401ff;
|
||||
public static final int Widget_Compat_NotificationActionContainer = 0x7f1403a1;
|
||||
public static final int Widget_Compat_NotificationActionText = 0x7f1403a2;
|
||||
public static final int Widget_Support_CoordinatorLayout = 0x7f1404d7;
|
||||
|
||||
private style() {
|
||||
}
|
||||
}
|
||||
|
||||
/* loaded from: classes3.dex */
|
||||
public static final class styleable {
|
||||
public static final int ColorStateListItem_alpha = 0x00000003;
|
||||
public static final int ColorStateListItem_android_alpha = 0x00000001;
|
||||
public static final int ColorStateListItem_android_color = 0x00000000;
|
||||
public static final int ColorStateListItem_android_lStar = 0x00000002;
|
||||
public static final int ColorStateListItem_lStar = 0x00000004;
|
||||
public static final int CoordinatorLayout_Layout_android_layout_gravity = 0x00000000;
|
||||
public static final int CoordinatorLayout_Layout_layout_anchor = 0x00000001;
|
||||
public static final int CoordinatorLayout_Layout_layout_anchorGravity = 0x00000002;
|
||||
public static final int CoordinatorLayout_Layout_layout_behavior = 0x00000003;
|
||||
public static final int CoordinatorLayout_Layout_layout_dodgeInsetEdges = 0x00000004;
|
||||
public static final int CoordinatorLayout_Layout_layout_insetEdge = 0x00000005;
|
||||
public static final int CoordinatorLayout_Layout_layout_keyline = 0x00000006;
|
||||
public static final int CoordinatorLayout_keylines = 0x00000000;
|
||||
public static final int CoordinatorLayout_statusBarBackground = 0x00000001;
|
||||
public static final int FontFamilyFont_android_font = 0x00000000;
|
||||
public static final int FontFamilyFont_android_fontStyle = 0x00000002;
|
||||
public static final int FontFamilyFont_android_fontVariationSettings = 0x00000004;
|
||||
public static final int FontFamilyFont_android_fontWeight = 0x00000001;
|
||||
public static final int FontFamilyFont_android_ttcIndex = 0x00000003;
|
||||
public static final int FontFamilyFont_font = 0x00000005;
|
||||
public static final int FontFamilyFont_fontStyle = 0x00000006;
|
||||
public static final int FontFamilyFont_fontVariationSettings = 0x00000007;
|
||||
public static final int FontFamilyFont_fontWeight = 0x00000008;
|
||||
public static final int FontFamilyFont_ttcIndex = 0x00000009;
|
||||
public static final int FontFamily_fontProviderAuthority = 0x00000000;
|
||||
public static final int FontFamily_fontProviderCerts = 0x00000001;
|
||||
public static final int FontFamily_fontProviderFetchStrategy = 0x00000002;
|
||||
public static final int FontFamily_fontProviderFetchTimeout = 0x00000003;
|
||||
public static final int FontFamily_fontProviderPackage = 0x00000004;
|
||||
public static final int FontFamily_fontProviderQuery = 0x00000005;
|
||||
public static final int FontFamily_fontProviderSystemFontFamily = 0x00000006;
|
||||
public static final int GradientColorItem_android_color = 0x00000000;
|
||||
public static final int GradientColorItem_android_offset = 0x00000001;
|
||||
public static final int GradientColor_android_centerColor = 0x00000007;
|
||||
public static final int GradientColor_android_centerX = 0x00000003;
|
||||
public static final int GradientColor_android_centerY = 0x00000004;
|
||||
public static final int GradientColor_android_endColor = 0x00000001;
|
||||
public static final int GradientColor_android_endX = 0x0000000a;
|
||||
public static final int GradientColor_android_endY = 0x0000000b;
|
||||
public static final int GradientColor_android_gradientRadius = 0x00000005;
|
||||
public static final int GradientColor_android_startColor = 0x00000000;
|
||||
public static final int GradientColor_android_startX = 0x00000008;
|
||||
public static final int GradientColor_android_startY = 0x00000009;
|
||||
public static final int GradientColor_android_tileMode = 0x00000006;
|
||||
public static final int GradientColor_android_type = 0x00000002;
|
||||
public static final int LoadingImageView_circleCrop = 0x00000000;
|
||||
public static final int LoadingImageView_imageAspectRatio = 0x00000001;
|
||||
public static final int LoadingImageView_imageAspectRatioAdjust = 0x00000002;
|
||||
public static final int SignInButton_buttonSize = 0x00000000;
|
||||
public static final int SignInButton_colorScheme = 0x00000001;
|
||||
public static final int SignInButton_scopeUris = 0x00000002;
|
||||
public static final int[] ColorStateListItem = {android.R.attr.color, android.R.attr.alpha, 16844359, com.adif.elcanomovil.R.attr.alpha, com.adif.elcanomovil.R.attr.lStar};
|
||||
public static final int[] CoordinatorLayout = {com.adif.elcanomovil.R.attr.keylines, com.adif.elcanomovil.R.attr.statusBarBackground};
|
||||
public static final int[] CoordinatorLayout_Layout = {android.R.attr.layout_gravity, com.adif.elcanomovil.R.attr.layout_anchor, com.adif.elcanomovil.R.attr.layout_anchorGravity, com.adif.elcanomovil.R.attr.layout_behavior, com.adif.elcanomovil.R.attr.layout_dodgeInsetEdges, com.adif.elcanomovil.R.attr.layout_insetEdge, com.adif.elcanomovil.R.attr.layout_keyline};
|
||||
public static final int[] FontFamily = {com.adif.elcanomovil.R.attr.fontProviderAuthority, com.adif.elcanomovil.R.attr.fontProviderCerts, com.adif.elcanomovil.R.attr.fontProviderFetchStrategy, com.adif.elcanomovil.R.attr.fontProviderFetchTimeout, com.adif.elcanomovil.R.attr.fontProviderPackage, com.adif.elcanomovil.R.attr.fontProviderQuery, com.adif.elcanomovil.R.attr.fontProviderSystemFontFamily};
|
||||
public static final int[] FontFamilyFont = {android.R.attr.font, android.R.attr.fontWeight, android.R.attr.fontStyle, android.R.attr.ttcIndex, android.R.attr.fontVariationSettings, com.adif.elcanomovil.R.attr.font, com.adif.elcanomovil.R.attr.fontStyle, com.adif.elcanomovil.R.attr.fontVariationSettings, com.adif.elcanomovil.R.attr.fontWeight, com.adif.elcanomovil.R.attr.ttcIndex};
|
||||
public static final int[] GradientColor = {android.R.attr.startColor, android.R.attr.endColor, android.R.attr.type, android.R.attr.centerX, android.R.attr.centerY, android.R.attr.gradientRadius, android.R.attr.tileMode, android.R.attr.centerColor, android.R.attr.startX, android.R.attr.startY, android.R.attr.endX, android.R.attr.endY};
|
||||
public static final int[] GradientColorItem = {android.R.attr.color, android.R.attr.offset};
|
||||
public static final int[] LoadingImageView = {com.adif.elcanomovil.R.attr.circleCrop, com.adif.elcanomovil.R.attr.imageAspectRatio, com.adif.elcanomovil.R.attr.imageAspectRatioAdjust};
|
||||
public static final int[] SignInButton = {com.adif.elcanomovil.R.attr.buttonSize, com.adif.elcanomovil.R.attr.colorScheme, com.adif.elcanomovil.R.attr.scopeUris};
|
||||
|
||||
private styleable() {
|
||||
}
|
||||
}
|
||||
|
||||
private R() {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,429 @@
|
||||
package com.google.firebase.messaging;
|
||||
|
||||
import C.w;
|
||||
import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import com.google.android.gms.common.annotation.KeepForSdk;
|
||||
import com.google.android.gms.common.internal.ShowFirstParty;
|
||||
import com.google.android.gms.common.internal.safeparcel.AbstractSafeParcelable;
|
||||
import com.google.android.gms.common.internal.safeparcel.SafeParcelable;
|
||||
import com.google.firebase.messaging.Constants;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.util.Map;
|
||||
|
||||
@SafeParcelable.Class(creator = "RemoteMessageCreator")
|
||||
@SafeParcelable.Reserved({1})
|
||||
/* loaded from: classes3.dex */
|
||||
public final class RemoteMessage extends AbstractSafeParcelable {
|
||||
public static final Parcelable.Creator<RemoteMessage> CREATOR = new RemoteMessageCreator();
|
||||
public static final int PRIORITY_HIGH = 1;
|
||||
public static final int PRIORITY_NORMAL = 2;
|
||||
public static final int PRIORITY_UNKNOWN = 0;
|
||||
|
||||
@SafeParcelable.Field(id = 2)
|
||||
Bundle bundle;
|
||||
private Map<String, String> data;
|
||||
private Notification notification;
|
||||
|
||||
/* loaded from: classes3.dex */
|
||||
public static class Builder {
|
||||
private final Bundle bundle;
|
||||
private final Map<String, String> data;
|
||||
|
||||
/* JADX WARN: Type inference failed for: r1v0, types: [java.util.Map<java.lang.String, java.lang.String>, s.j] */
|
||||
public Builder(String str) {
|
||||
Bundle bundle = new Bundle();
|
||||
this.bundle = bundle;
|
||||
this.data = new s.j(0);
|
||||
if (TextUtils.isEmpty(str)) {
|
||||
throw new IllegalArgumentException(w.z("Invalid to: ", str));
|
||||
}
|
||||
bundle.putString(Constants.MessagePayloadKeys.TO, str);
|
||||
}
|
||||
|
||||
public Builder addData(String str, String str2) {
|
||||
this.data.put(str, str2);
|
||||
return this;
|
||||
}
|
||||
|
||||
public RemoteMessage build() {
|
||||
Bundle bundle = new Bundle();
|
||||
for (Map.Entry<String, String> entry : this.data.entrySet()) {
|
||||
bundle.putString(entry.getKey(), entry.getValue());
|
||||
}
|
||||
bundle.putAll(this.bundle);
|
||||
this.bundle.remove(Constants.MessagePayloadKeys.FROM);
|
||||
return new RemoteMessage(bundle);
|
||||
}
|
||||
|
||||
public Builder clearData() {
|
||||
this.data.clear();
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getCollapseKey() {
|
||||
return this.bundle.getString(Constants.MessagePayloadKeys.MESSAGE_TYPE);
|
||||
}
|
||||
|
||||
public Map<String, String> getData() {
|
||||
return this.data;
|
||||
}
|
||||
|
||||
public String getMessageId() {
|
||||
return this.bundle.getString(Constants.MessagePayloadKeys.MSGID, "");
|
||||
}
|
||||
|
||||
public String getMessageType() {
|
||||
return this.bundle.getString(Constants.MessagePayloadKeys.MESSAGE_TYPE);
|
||||
}
|
||||
|
||||
public int getTtl() {
|
||||
return Integer.parseInt(this.bundle.getString(Constants.MessagePayloadKeys.MESSAGE_TYPE, "0"));
|
||||
}
|
||||
|
||||
public Builder setCollapseKey(String str) {
|
||||
this.bundle.putString(Constants.MessagePayloadKeys.COLLAPSE_KEY, str);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setData(Map<String, String> map) {
|
||||
this.data.clear();
|
||||
this.data.putAll(map);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setMessageId(String str) {
|
||||
this.bundle.putString(Constants.MessagePayloadKeys.MSGID, str);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setMessageType(String str) {
|
||||
this.bundle.putString(Constants.MessagePayloadKeys.MESSAGE_TYPE, str);
|
||||
return this;
|
||||
}
|
||||
|
||||
@ShowFirstParty
|
||||
public Builder setRawData(byte[] bArr) {
|
||||
this.bundle.putByteArray(Constants.MessagePayloadKeys.RAW_DATA, bArr);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setTtl(int i) {
|
||||
this.bundle.putString(Constants.MessagePayloadKeys.TTL, String.valueOf(i));
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
@Retention(RetentionPolicy.SOURCE)
|
||||
/* loaded from: classes3.dex */
|
||||
public @interface MessagePriority {
|
||||
}
|
||||
|
||||
/* loaded from: classes3.dex */
|
||||
public static class Notification {
|
||||
private final String body;
|
||||
private final String[] bodyLocArgs;
|
||||
private final String bodyLocKey;
|
||||
private final String channelId;
|
||||
private final String clickAction;
|
||||
private final String color;
|
||||
private final boolean defaultLightSettings;
|
||||
private final boolean defaultSound;
|
||||
private final boolean defaultVibrateTimings;
|
||||
private final Long eventTime;
|
||||
private final String icon;
|
||||
private final String imageUrl;
|
||||
private final int[] lightSettings;
|
||||
private final Uri link;
|
||||
private final boolean localOnly;
|
||||
private final Integer notificationCount;
|
||||
private final Integer notificationPriority;
|
||||
private final String sound;
|
||||
private final boolean sticky;
|
||||
private final String tag;
|
||||
private final String ticker;
|
||||
private final String title;
|
||||
private final String[] titleLocArgs;
|
||||
private final String titleLocKey;
|
||||
private final long[] vibrateTimings;
|
||||
private final Integer visibility;
|
||||
|
||||
private static String[] getLocalizationArgs(NotificationParams notificationParams, String str) {
|
||||
Object[] localizationArgsForKey = notificationParams.getLocalizationArgsForKey(str);
|
||||
if (localizationArgsForKey == null) {
|
||||
return null;
|
||||
}
|
||||
String[] strArr = new String[localizationArgsForKey.length];
|
||||
for (int i = 0; i < localizationArgsForKey.length; i++) {
|
||||
strArr[i] = String.valueOf(localizationArgsForKey[i]);
|
||||
}
|
||||
return strArr;
|
||||
}
|
||||
|
||||
public String getBody() {
|
||||
return this.body;
|
||||
}
|
||||
|
||||
public String[] getBodyLocalizationArgs() {
|
||||
return this.bodyLocArgs;
|
||||
}
|
||||
|
||||
public String getBodyLocalizationKey() {
|
||||
return this.bodyLocKey;
|
||||
}
|
||||
|
||||
public String getChannelId() {
|
||||
return this.channelId;
|
||||
}
|
||||
|
||||
public String getClickAction() {
|
||||
return this.clickAction;
|
||||
}
|
||||
|
||||
public String getColor() {
|
||||
return this.color;
|
||||
}
|
||||
|
||||
public boolean getDefaultLightSettings() {
|
||||
return this.defaultLightSettings;
|
||||
}
|
||||
|
||||
public boolean getDefaultSound() {
|
||||
return this.defaultSound;
|
||||
}
|
||||
|
||||
public boolean getDefaultVibrateSettings() {
|
||||
return this.defaultVibrateTimings;
|
||||
}
|
||||
|
||||
public Long getEventTime() {
|
||||
return this.eventTime;
|
||||
}
|
||||
|
||||
public String getIcon() {
|
||||
return this.icon;
|
||||
}
|
||||
|
||||
public Uri getImageUrl() {
|
||||
String str = this.imageUrl;
|
||||
if (str != null) {
|
||||
return Uri.parse(str);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public int[] getLightSettings() {
|
||||
return this.lightSettings;
|
||||
}
|
||||
|
||||
public Uri getLink() {
|
||||
return this.link;
|
||||
}
|
||||
|
||||
public boolean getLocalOnly() {
|
||||
return this.localOnly;
|
||||
}
|
||||
|
||||
public Integer getNotificationCount() {
|
||||
return this.notificationCount;
|
||||
}
|
||||
|
||||
public Integer getNotificationPriority() {
|
||||
return this.notificationPriority;
|
||||
}
|
||||
|
||||
public String getSound() {
|
||||
return this.sound;
|
||||
}
|
||||
|
||||
public boolean getSticky() {
|
||||
return this.sticky;
|
||||
}
|
||||
|
||||
public String getTag() {
|
||||
return this.tag;
|
||||
}
|
||||
|
||||
public String getTicker() {
|
||||
return this.ticker;
|
||||
}
|
||||
|
||||
public String getTitle() {
|
||||
return this.title;
|
||||
}
|
||||
|
||||
public String[] getTitleLocalizationArgs() {
|
||||
return this.titleLocArgs;
|
||||
}
|
||||
|
||||
public String getTitleLocalizationKey() {
|
||||
return this.titleLocKey;
|
||||
}
|
||||
|
||||
public long[] getVibrateTimings() {
|
||||
return this.vibrateTimings;
|
||||
}
|
||||
|
||||
public Integer getVisibility() {
|
||||
return this.visibility;
|
||||
}
|
||||
|
||||
private Notification(NotificationParams notificationParams) {
|
||||
this.title = notificationParams.getString(Constants.MessageNotificationKeys.TITLE);
|
||||
this.titleLocKey = notificationParams.getLocalizationResourceForKey(Constants.MessageNotificationKeys.TITLE);
|
||||
this.titleLocArgs = getLocalizationArgs(notificationParams, Constants.MessageNotificationKeys.TITLE);
|
||||
this.body = notificationParams.getString(Constants.MessageNotificationKeys.BODY);
|
||||
this.bodyLocKey = notificationParams.getLocalizationResourceForKey(Constants.MessageNotificationKeys.BODY);
|
||||
this.bodyLocArgs = getLocalizationArgs(notificationParams, Constants.MessageNotificationKeys.BODY);
|
||||
this.icon = notificationParams.getString(Constants.MessageNotificationKeys.ICON);
|
||||
this.sound = notificationParams.getSoundResourceName();
|
||||
this.tag = notificationParams.getString(Constants.MessageNotificationKeys.TAG);
|
||||
this.color = notificationParams.getString(Constants.MessageNotificationKeys.COLOR);
|
||||
this.clickAction = notificationParams.getString(Constants.MessageNotificationKeys.CLICK_ACTION);
|
||||
this.channelId = notificationParams.getString(Constants.MessageNotificationKeys.CHANNEL);
|
||||
this.link = notificationParams.getLink();
|
||||
this.imageUrl = notificationParams.getString(Constants.MessageNotificationKeys.IMAGE_URL);
|
||||
this.ticker = notificationParams.getString(Constants.MessageNotificationKeys.TICKER);
|
||||
this.notificationPriority = notificationParams.getInteger(Constants.MessageNotificationKeys.NOTIFICATION_PRIORITY);
|
||||
this.visibility = notificationParams.getInteger(Constants.MessageNotificationKeys.VISIBILITY);
|
||||
this.notificationCount = notificationParams.getInteger(Constants.MessageNotificationKeys.NOTIFICATION_COUNT);
|
||||
this.sticky = notificationParams.getBoolean(Constants.MessageNotificationKeys.STICKY);
|
||||
this.localOnly = notificationParams.getBoolean(Constants.MessageNotificationKeys.LOCAL_ONLY);
|
||||
this.defaultSound = notificationParams.getBoolean(Constants.MessageNotificationKeys.DEFAULT_SOUND);
|
||||
this.defaultVibrateTimings = notificationParams.getBoolean(Constants.MessageNotificationKeys.DEFAULT_VIBRATE_TIMINGS);
|
||||
this.defaultLightSettings = notificationParams.getBoolean(Constants.MessageNotificationKeys.DEFAULT_LIGHT_SETTINGS);
|
||||
this.eventTime = notificationParams.getLong(Constants.MessageNotificationKeys.EVENT_TIME);
|
||||
this.lightSettings = notificationParams.getLightSettings();
|
||||
this.vibrateTimings = notificationParams.getVibrateTimings();
|
||||
}
|
||||
}
|
||||
|
||||
@SafeParcelable.Constructor
|
||||
public RemoteMessage(@SafeParcelable.Param(id = 2) Bundle bundle) {
|
||||
this.bundle = bundle;
|
||||
}
|
||||
|
||||
private int getMessagePriority(String str) {
|
||||
if ("high".equals(str)) {
|
||||
return 1;
|
||||
}
|
||||
return "normal".equals(str) ? 2 : 0;
|
||||
}
|
||||
|
||||
public String getCollapseKey() {
|
||||
return this.bundle.getString(Constants.MessagePayloadKeys.COLLAPSE_KEY);
|
||||
}
|
||||
|
||||
public Map<String, String> getData() {
|
||||
if (this.data == null) {
|
||||
this.data = Constants.MessagePayloadKeys.extractDeveloperDefinedPayload(this.bundle);
|
||||
}
|
||||
return this.data;
|
||||
}
|
||||
|
||||
public String getFrom() {
|
||||
return this.bundle.getString(Constants.MessagePayloadKeys.FROM);
|
||||
}
|
||||
|
||||
public String getMessageId() {
|
||||
String string = this.bundle.getString(Constants.MessagePayloadKeys.MSGID);
|
||||
return string == null ? this.bundle.getString(Constants.MessagePayloadKeys.MSGID_SERVER) : string;
|
||||
}
|
||||
|
||||
public String getMessageType() {
|
||||
return this.bundle.getString(Constants.MessagePayloadKeys.MESSAGE_TYPE);
|
||||
}
|
||||
|
||||
public Notification getNotification() {
|
||||
if (this.notification == null && NotificationParams.isNotification(this.bundle)) {
|
||||
this.notification = new Notification(new NotificationParams(this.bundle));
|
||||
}
|
||||
return this.notification;
|
||||
}
|
||||
|
||||
public int getOriginalPriority() {
|
||||
String string = this.bundle.getString(Constants.MessagePayloadKeys.ORIGINAL_PRIORITY);
|
||||
if (string == null) {
|
||||
string = this.bundle.getString(Constants.MessagePayloadKeys.PRIORITY_V19);
|
||||
}
|
||||
return getMessagePriority(string);
|
||||
}
|
||||
|
||||
public int getPriority() {
|
||||
String string = this.bundle.getString(Constants.MessagePayloadKeys.DELIVERED_PRIORITY);
|
||||
if (string == null) {
|
||||
if ("1".equals(this.bundle.getString(Constants.MessagePayloadKeys.PRIORITY_REDUCED_V19))) {
|
||||
return 2;
|
||||
}
|
||||
string = this.bundle.getString(Constants.MessagePayloadKeys.PRIORITY_V19);
|
||||
}
|
||||
return getMessagePriority(string);
|
||||
}
|
||||
|
||||
@ShowFirstParty
|
||||
public byte[] getRawData() {
|
||||
return this.bundle.getByteArray(Constants.MessagePayloadKeys.RAW_DATA);
|
||||
}
|
||||
|
||||
public String getSenderId() {
|
||||
return this.bundle.getString(Constants.MessagePayloadKeys.SENDER_ID);
|
||||
}
|
||||
|
||||
public long getSentTime() {
|
||||
Object obj = this.bundle.get(Constants.MessagePayloadKeys.SENT_TIME);
|
||||
if (obj instanceof Long) {
|
||||
return ((Long) obj).longValue();
|
||||
}
|
||||
if (!(obj instanceof String)) {
|
||||
return 0L;
|
||||
}
|
||||
try {
|
||||
return Long.parseLong((String) obj);
|
||||
} catch (NumberFormatException unused) {
|
||||
Log.w(Constants.TAG, "Invalid sent time: " + obj);
|
||||
return 0L;
|
||||
}
|
||||
}
|
||||
|
||||
public String getTo() {
|
||||
return this.bundle.getString(Constants.MessagePayloadKeys.TO);
|
||||
}
|
||||
|
||||
public int getTtl() {
|
||||
Object obj = this.bundle.get(Constants.MessagePayloadKeys.TTL);
|
||||
if (obj instanceof Integer) {
|
||||
return ((Integer) obj).intValue();
|
||||
}
|
||||
if (!(obj instanceof String)) {
|
||||
return 0;
|
||||
}
|
||||
try {
|
||||
return Integer.parseInt((String) obj);
|
||||
} catch (NumberFormatException unused) {
|
||||
Log.w(Constants.TAG, "Invalid TTL: " + obj);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
public void populateSendMessageIntent(Intent intent) {
|
||||
intent.putExtras(this.bundle);
|
||||
}
|
||||
|
||||
@KeepForSdk
|
||||
public Intent toIntent() {
|
||||
Intent intent = new Intent();
|
||||
intent.putExtras(this.bundle);
|
||||
return intent;
|
||||
}
|
||||
|
||||
@Override // android.os.Parcelable
|
||||
public void writeToParcel(Parcel parcel, int i) {
|
||||
RemoteMessageCreator.writeToParcel(this, parcel, i);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
package com.google.firebase.messaging;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
import com.google.android.gms.common.internal.safeparcel.SafeParcelReader;
|
||||
import com.google.android.gms.common.internal.safeparcel.SafeParcelWriter;
|
||||
|
||||
/* loaded from: classes3.dex */
|
||||
public class RemoteMessageCreator implements Parcelable.Creator<RemoteMessage> {
|
||||
public static final int CONTENT_DESCRIPTION = 0;
|
||||
|
||||
public static void writeToParcel(RemoteMessage remoteMessage, Parcel parcel, int i) {
|
||||
int beginObjectHeader = SafeParcelWriter.beginObjectHeader(parcel);
|
||||
SafeParcelWriter.writeBundle(parcel, 2, remoteMessage.bundle, false);
|
||||
SafeParcelWriter.finishObjectHeader(parcel, beginObjectHeader);
|
||||
}
|
||||
|
||||
/* JADX WARN: Can't rename method to resolve collision */
|
||||
@Override // android.os.Parcelable.Creator
|
||||
public RemoteMessage createFromParcel(Parcel parcel) {
|
||||
int validateObjectHeader = SafeParcelReader.validateObjectHeader(parcel);
|
||||
Bundle bundle = null;
|
||||
while (parcel.dataPosition() < validateObjectHeader) {
|
||||
int readHeader = SafeParcelReader.readHeader(parcel);
|
||||
if (SafeParcelReader.getFieldId(readHeader) != 2) {
|
||||
SafeParcelReader.skipUnknownField(parcel, readHeader);
|
||||
} else {
|
||||
bundle = SafeParcelReader.createBundle(parcel, readHeader);
|
||||
}
|
||||
}
|
||||
SafeParcelReader.ensureAtEnd(parcel, validateObjectHeader);
|
||||
return new RemoteMessage(bundle);
|
||||
}
|
||||
|
||||
/* JADX WARN: Can't rename method to resolve collision */
|
||||
@Override // android.os.Parcelable.Creator
|
||||
public RemoteMessage[] newArray(int i) {
|
||||
return new RemoteMessage[i];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
package com.google.firebase.messaging;
|
||||
|
||||
import android.util.Log;
|
||||
import com.google.android.gms.tasks.Continuation;
|
||||
import com.google.android.gms.tasks.Task;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.Executor;
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: package-private */
|
||||
/* loaded from: classes3.dex */
|
||||
public class RequestDeduplicator {
|
||||
private final Executor executor;
|
||||
private final Map<String, Task<String>> getTokenRequests = new s.j(0);
|
||||
|
||||
/* loaded from: classes3.dex */
|
||||
public interface GetTokenRequest {
|
||||
Task<String> start();
|
||||
}
|
||||
|
||||
/* JADX WARN: Type inference failed for: r0v0, types: [java.util.Map<java.lang.String, com.google.android.gms.tasks.Task<java.lang.String>>, s.j] */
|
||||
public RequestDeduplicator(Executor executor) {
|
||||
this.executor = executor;
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: private */
|
||||
public /* synthetic */ Task lambda$getOrStartGetTokenRequest$0(String str, Task task) throws Exception {
|
||||
synchronized (this) {
|
||||
this.getTokenRequests.remove(str);
|
||||
}
|
||||
return task;
|
||||
}
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
public synchronized Task<String> getOrStartGetTokenRequest(final String str, GetTokenRequest getTokenRequest) {
|
||||
Task<String> task = this.getTokenRequests.get(str);
|
||||
if (task != null) {
|
||||
if (Log.isLoggable(Constants.TAG, 3)) {
|
||||
Log.d(Constants.TAG, "Joining ongoing request for: " + str);
|
||||
}
|
||||
return task;
|
||||
}
|
||||
if (Log.isLoggable(Constants.TAG, 3)) {
|
||||
Log.d(Constants.TAG, "Making new request for: " + str);
|
||||
}
|
||||
Task continueWithTask = getTokenRequest.start().continueWithTask(this.executor, new Continuation() { // from class: com.google.firebase.messaging.m
|
||||
@Override // com.google.android.gms.tasks.Continuation
|
||||
public final Object then(Task task2) {
|
||||
Task lambda$getOrStartGetTokenRequest$0;
|
||||
lambda$getOrStartGetTokenRequest$0 = RequestDeduplicator.this.lambda$getOrStartGetTokenRequest$0(str, task2);
|
||||
return lambda$getOrStartGetTokenRequest$0;
|
||||
}
|
||||
});
|
||||
this.getTokenRequests.put(str, continueWithTask);
|
||||
return continueWithTask;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
package com.google.firebase.messaging;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
/* loaded from: classes3.dex */
|
||||
public final class SendException extends Exception {
|
||||
public static final int ERROR_INVALID_PARAMETERS = 1;
|
||||
public static final int ERROR_SIZE = 2;
|
||||
public static final int ERROR_TOO_MANY_MESSAGES = 4;
|
||||
public static final int ERROR_TTL_EXCEEDED = 3;
|
||||
public static final int ERROR_UNKNOWN = 0;
|
||||
private final int errorCode;
|
||||
|
||||
public SendException(String str) {
|
||||
super(str);
|
||||
this.errorCode = parseErrorCode(str);
|
||||
}
|
||||
|
||||
private int parseErrorCode(String str) {
|
||||
if (str == null) {
|
||||
return 0;
|
||||
}
|
||||
String lowerCase = str.toLowerCase(Locale.US);
|
||||
lowerCase.getClass();
|
||||
char c4 = 65535;
|
||||
switch (lowerCase.hashCode()) {
|
||||
case -1743242157:
|
||||
if (lowerCase.equals("service_not_available")) {
|
||||
c4 = 0;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case -1290953729:
|
||||
if (lowerCase.equals("toomanymessages")) {
|
||||
c4 = 1;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case -920906446:
|
||||
if (lowerCase.equals("invalid_parameters")) {
|
||||
c4 = 2;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case -617027085:
|
||||
if (lowerCase.equals("messagetoobig")) {
|
||||
c4 = 3;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case -95047692:
|
||||
if (lowerCase.equals("missing_to")) {
|
||||
c4 = 4;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
switch (c4) {
|
||||
case 0:
|
||||
return 3;
|
||||
case 1:
|
||||
return 4;
|
||||
case 2:
|
||||
case 4:
|
||||
return 1;
|
||||
case 3:
|
||||
return 2;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
public int getErrorCode() {
|
||||
return this.errorCode;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,147 @@
|
||||
package com.google.firebase.messaging;
|
||||
|
||||
import android.content.ComponentName;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.ResolveInfo;
|
||||
import android.content.pm.ServiceInfo;
|
||||
import android.util.Log;
|
||||
import com.google.android.gms.common.annotation.KeepForSdk;
|
||||
import com.google.firebase.sessions.settings.RemoteSettings;
|
||||
import java.util.ArrayDeque;
|
||||
import java.util.Queue;
|
||||
|
||||
@KeepForSdk
|
||||
/* loaded from: classes3.dex */
|
||||
public class ServiceStarter {
|
||||
static final String ACTION_MESSAGING_EVENT = "com.google.firebase.MESSAGING_EVENT";
|
||||
static final int ERROR_ILLEGAL_STATE_EXCEPTION = 402;
|
||||
static final int ERROR_ILLEGAL_STATE_EXCEPTION_FALLBACK_TO_BIND = 403;
|
||||
static final int ERROR_NOT_FOUND = 404;
|
||||
static final int ERROR_SECURITY_EXCEPTION = 401;
|
||||
|
||||
@KeepForSdk
|
||||
public static final int ERROR_UNKNOWN = 500;
|
||||
private static final String EXTRA_WRAPPED_INTENT = "wrapped_intent";
|
||||
private static final String PERMISSIONS_MISSING_HINT = "this should normally be included by the manifest merger, but may needed to be manually added to your manifest";
|
||||
public static final int SUCCESS = -1;
|
||||
private static ServiceStarter instance;
|
||||
private String firebaseMessagingServiceClassName = null;
|
||||
private Boolean hasWakeLockPermission = null;
|
||||
private Boolean hasAccessNetworkStatePermission = null;
|
||||
private final Queue<Intent> messagingEvents = new ArrayDeque();
|
||||
|
||||
private ServiceStarter() {
|
||||
}
|
||||
|
||||
private int doStartService(Context context, Intent intent) {
|
||||
ComponentName startService;
|
||||
String resolveServiceClassName = resolveServiceClassName(context, intent);
|
||||
if (resolveServiceClassName != null) {
|
||||
if (Log.isLoggable(Constants.TAG, 3)) {
|
||||
Log.d(Constants.TAG, "Restricting intent to a specific service: ".concat(resolveServiceClassName));
|
||||
}
|
||||
intent.setClassName(context.getPackageName(), resolveServiceClassName);
|
||||
}
|
||||
try {
|
||||
if (hasWakeLockPermission(context)) {
|
||||
startService = WakeLockHolder.startWakefulService(context, intent);
|
||||
} else {
|
||||
startService = context.startService(intent);
|
||||
Log.d(Constants.TAG, "Missing wake lock permission, service start may be delayed");
|
||||
}
|
||||
if (startService != null) {
|
||||
return -1;
|
||||
}
|
||||
Log.e(Constants.TAG, "Error while delivering the message: ServiceIntent not found.");
|
||||
return ERROR_NOT_FOUND;
|
||||
} catch (IllegalStateException e4) {
|
||||
Log.e(Constants.TAG, "Failed to start service while in background: " + e4);
|
||||
return ERROR_ILLEGAL_STATE_EXCEPTION;
|
||||
} catch (SecurityException e5) {
|
||||
Log.e(Constants.TAG, "Error while delivering the message to the serviceIntent", e5);
|
||||
return ERROR_SECURITY_EXCEPTION;
|
||||
}
|
||||
}
|
||||
|
||||
public static synchronized ServiceStarter getInstance() {
|
||||
ServiceStarter serviceStarter;
|
||||
synchronized (ServiceStarter.class) {
|
||||
try {
|
||||
if (instance == null) {
|
||||
instance = new ServiceStarter();
|
||||
}
|
||||
serviceStarter = instance;
|
||||
} catch (Throwable th) {
|
||||
throw th;
|
||||
}
|
||||
}
|
||||
return serviceStarter;
|
||||
}
|
||||
|
||||
private synchronized String resolveServiceClassName(Context context, Intent intent) {
|
||||
ServiceInfo serviceInfo;
|
||||
String str;
|
||||
try {
|
||||
String str2 = this.firebaseMessagingServiceClassName;
|
||||
if (str2 != null) {
|
||||
return str2;
|
||||
}
|
||||
ResolveInfo resolveService = context.getPackageManager().resolveService(intent, 0);
|
||||
if (resolveService != null && (serviceInfo = resolveService.serviceInfo) != null) {
|
||||
if (context.getPackageName().equals(serviceInfo.packageName) && (str = serviceInfo.name) != null) {
|
||||
if (str.startsWith(".")) {
|
||||
this.firebaseMessagingServiceClassName = context.getPackageName() + serviceInfo.name;
|
||||
} else {
|
||||
this.firebaseMessagingServiceClassName = serviceInfo.name;
|
||||
}
|
||||
return this.firebaseMessagingServiceClassName;
|
||||
}
|
||||
Log.e(Constants.TAG, "Error resolving target intent service, skipping classname enforcement. Resolved service was: " + serviceInfo.packageName + RemoteSettings.FORWARD_SLASH_STRING + serviceInfo.name);
|
||||
return null;
|
||||
}
|
||||
Log.e(Constants.TAG, "Failed to resolve target intent service, skipping classname enforcement");
|
||||
return null;
|
||||
} catch (Throwable th) {
|
||||
throw th;
|
||||
}
|
||||
}
|
||||
|
||||
public static void setForTesting(ServiceStarter serviceStarter) {
|
||||
instance = serviceStarter;
|
||||
}
|
||||
|
||||
public Intent getMessagingEvent() {
|
||||
return this.messagingEvents.poll();
|
||||
}
|
||||
|
||||
public boolean hasAccessNetworkStatePermission(Context context) {
|
||||
if (this.hasAccessNetworkStatePermission == null) {
|
||||
this.hasAccessNetworkStatePermission = Boolean.valueOf(context.checkCallingOrSelfPermission("android.permission.ACCESS_NETWORK_STATE") == 0);
|
||||
}
|
||||
if (!this.hasWakeLockPermission.booleanValue() && Log.isLoggable(Constants.TAG, 3)) {
|
||||
Log.d(Constants.TAG, "Missing Permission: android.permission.ACCESS_NETWORK_STATE this should normally be included by the manifest merger, but may needed to be manually added to your manifest");
|
||||
}
|
||||
return this.hasAccessNetworkStatePermission.booleanValue();
|
||||
}
|
||||
|
||||
public boolean hasWakeLockPermission(Context context) {
|
||||
if (this.hasWakeLockPermission == null) {
|
||||
this.hasWakeLockPermission = Boolean.valueOf(context.checkCallingOrSelfPermission("android.permission.WAKE_LOCK") == 0);
|
||||
}
|
||||
if (!this.hasWakeLockPermission.booleanValue() && Log.isLoggable(Constants.TAG, 3)) {
|
||||
Log.d(Constants.TAG, "Missing Permission: android.permission.WAKE_LOCK this should normally be included by the manifest merger, but may needed to be manually added to your manifest");
|
||||
}
|
||||
return this.hasWakeLockPermission.booleanValue();
|
||||
}
|
||||
|
||||
public int startMessagingService(Context context, Intent intent) {
|
||||
if (Log.isLoggable(Constants.TAG, 3)) {
|
||||
Log.d(Constants.TAG, "Starting service");
|
||||
}
|
||||
this.messagingEvents.offer(intent);
|
||||
Intent intent2 = new Intent(ACTION_MESSAGING_EVENT);
|
||||
intent2.setPackage(context.getPackageName());
|
||||
return doStartService(context, intent2);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,174 @@
|
||||
package com.google.firebase.messaging;
|
||||
|
||||
import android.content.SharedPreferences;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import java.util.ArrayDeque;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.Executor;
|
||||
|
||||
/* loaded from: classes3.dex */
|
||||
final class SharedPreferencesQueue {
|
||||
private final String itemSeparator;
|
||||
private final String queueName;
|
||||
private final SharedPreferences sharedPreferences;
|
||||
private final Executor syncExecutor;
|
||||
final ArrayDeque<String> internalQueue = new ArrayDeque<>();
|
||||
private boolean bulkOperation = false;
|
||||
|
||||
private SharedPreferencesQueue(SharedPreferences sharedPreferences, String str, String str2, Executor executor) {
|
||||
this.sharedPreferences = sharedPreferences;
|
||||
this.queueName = str;
|
||||
this.itemSeparator = str2;
|
||||
this.syncExecutor = executor;
|
||||
}
|
||||
|
||||
private String checkAndSyncState(String str) {
|
||||
checkAndSyncState(str != null);
|
||||
return str;
|
||||
}
|
||||
|
||||
public static SharedPreferencesQueue createInstance(SharedPreferences sharedPreferences, String str, String str2, Executor executor) {
|
||||
SharedPreferencesQueue sharedPreferencesQueue = new SharedPreferencesQueue(sharedPreferences, str, str2, executor);
|
||||
sharedPreferencesQueue.initQueue();
|
||||
return sharedPreferencesQueue;
|
||||
}
|
||||
|
||||
private void initQueue() {
|
||||
synchronized (this.internalQueue) {
|
||||
try {
|
||||
this.internalQueue.clear();
|
||||
String string = this.sharedPreferences.getString(this.queueName, "");
|
||||
if (!TextUtils.isEmpty(string) && string.contains(this.itemSeparator)) {
|
||||
String[] split = string.split(this.itemSeparator, -1);
|
||||
if (split.length == 0) {
|
||||
Log.e(Constants.TAG, "Corrupted queue. Please check the queue contents and item separator provided");
|
||||
}
|
||||
for (String str : split) {
|
||||
if (!TextUtils.isEmpty(str)) {
|
||||
this.internalQueue.add(str);
|
||||
}
|
||||
}
|
||||
}
|
||||
} finally {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: private */
|
||||
public void syncState() {
|
||||
synchronized (this.internalQueue) {
|
||||
this.sharedPreferences.edit().putString(this.queueName, serialize()).commit();
|
||||
}
|
||||
}
|
||||
|
||||
private void syncStateAsync() {
|
||||
this.syncExecutor.execute(new n(this, 0));
|
||||
}
|
||||
|
||||
public boolean add(String str) {
|
||||
boolean checkAndSyncState;
|
||||
if (TextUtils.isEmpty(str) || str.contains(this.itemSeparator)) {
|
||||
return false;
|
||||
}
|
||||
synchronized (this.internalQueue) {
|
||||
checkAndSyncState = checkAndSyncState(this.internalQueue.add(str));
|
||||
}
|
||||
return checkAndSyncState;
|
||||
}
|
||||
|
||||
public void beginTransaction() {
|
||||
this.bulkOperation = true;
|
||||
}
|
||||
|
||||
public void beginTransactionSync() {
|
||||
synchronized (this.internalQueue) {
|
||||
beginTransaction();
|
||||
}
|
||||
}
|
||||
|
||||
public void clear() {
|
||||
synchronized (this.internalQueue) {
|
||||
this.internalQueue.clear();
|
||||
checkAndSyncState(true);
|
||||
}
|
||||
}
|
||||
|
||||
public void commitTransaction() {
|
||||
this.bulkOperation = false;
|
||||
syncStateAsync();
|
||||
}
|
||||
|
||||
public void commitTransactionSync() {
|
||||
synchronized (this.internalQueue) {
|
||||
commitTransaction();
|
||||
}
|
||||
}
|
||||
|
||||
public String peek() {
|
||||
String peek;
|
||||
synchronized (this.internalQueue) {
|
||||
peek = this.internalQueue.peek();
|
||||
}
|
||||
return peek;
|
||||
}
|
||||
|
||||
public boolean remove(Object obj) {
|
||||
boolean checkAndSyncState;
|
||||
synchronized (this.internalQueue) {
|
||||
checkAndSyncState = checkAndSyncState(this.internalQueue.remove(obj));
|
||||
}
|
||||
return checkAndSyncState;
|
||||
}
|
||||
|
||||
public String serialize() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
Iterator<String> it = this.internalQueue.iterator();
|
||||
while (it.hasNext()) {
|
||||
sb.append(it.next());
|
||||
sb.append(this.itemSeparator);
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public String serializeSync() {
|
||||
String serialize;
|
||||
synchronized (this.internalQueue) {
|
||||
serialize = serialize();
|
||||
}
|
||||
return serialize;
|
||||
}
|
||||
|
||||
public int size() {
|
||||
int size;
|
||||
synchronized (this.internalQueue) {
|
||||
size = this.internalQueue.size();
|
||||
}
|
||||
return size;
|
||||
}
|
||||
|
||||
public List<String> toList() {
|
||||
ArrayList arrayList;
|
||||
synchronized (this.internalQueue) {
|
||||
arrayList = new ArrayList(this.internalQueue);
|
||||
}
|
||||
return arrayList;
|
||||
}
|
||||
|
||||
private boolean checkAndSyncState(boolean z3) {
|
||||
if (z3 && !this.bulkOperation) {
|
||||
syncStateAsync();
|
||||
}
|
||||
return z3;
|
||||
}
|
||||
|
||||
public String remove() {
|
||||
String checkAndSyncState;
|
||||
synchronized (this.internalQueue) {
|
||||
checkAndSyncState = checkAndSyncState(this.internalQueue.remove());
|
||||
}
|
||||
return checkAndSyncState;
|
||||
}
|
||||
}
|
||||
127
apk_decompiled/sources/com/google/firebase/messaging/Store.java
Normal file
127
apk_decompiled/sources/com/google/firebase/messaging/Store.java
Normal file
@@ -0,0 +1,127 @@
|
||||
package com.google.firebase.messaging;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: package-private */
|
||||
/* loaded from: classes3.dex */
|
||||
public class Store {
|
||||
static final String NO_BACKUP_FILE = "com.google.android.gms.appid-no-backup";
|
||||
static final String PREFERENCES = "com.google.android.gms.appid";
|
||||
private static final String SCOPE_ALL = "*";
|
||||
private static final String STORE_KEY_TOKEN = "|T|";
|
||||
final SharedPreferences store;
|
||||
|
||||
/* loaded from: classes3.dex */
|
||||
public static class Token {
|
||||
private static final String KEY_APP_VERSION = "appVersion";
|
||||
private static final String KEY_TIMESTAMP = "timestamp";
|
||||
private static final String KEY_TOKEN = "token";
|
||||
private static final long REFRESH_PERIOD_MILLIS = TimeUnit.DAYS.toMillis(7);
|
||||
final String appVersion;
|
||||
final long timestamp;
|
||||
final String token;
|
||||
|
||||
private Token(String str, String str2, long j4) {
|
||||
this.token = str;
|
||||
this.appVersion = str2;
|
||||
this.timestamp = j4;
|
||||
}
|
||||
|
||||
public static String encode(String str, String str2, long j4) {
|
||||
try {
|
||||
JSONObject jSONObject = new JSONObject();
|
||||
jSONObject.put("token", str);
|
||||
jSONObject.put("appVersion", str2);
|
||||
jSONObject.put(KEY_TIMESTAMP, j4);
|
||||
return jSONObject.toString();
|
||||
} catch (JSONException e4) {
|
||||
Log.w(Constants.TAG, "Failed to encode token: " + e4);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public static Token parse(String str) {
|
||||
if (TextUtils.isEmpty(str)) {
|
||||
return null;
|
||||
}
|
||||
if (!str.startsWith("{")) {
|
||||
return new Token(str, null, 0L);
|
||||
}
|
||||
try {
|
||||
JSONObject jSONObject = new JSONObject(str);
|
||||
return new Token(jSONObject.getString("token"), jSONObject.getString("appVersion"), jSONObject.getLong(KEY_TIMESTAMP));
|
||||
} catch (JSONException e4) {
|
||||
Log.w(Constants.TAG, "Failed to parse token: " + e4);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public boolean needsRefresh(String str) {
|
||||
return System.currentTimeMillis() > this.timestamp + REFRESH_PERIOD_MILLIS || !str.equals(this.appVersion);
|
||||
}
|
||||
}
|
||||
|
||||
public Store(Context context) {
|
||||
this.store = context.getSharedPreferences(PREFERENCES, 0);
|
||||
checkForRestore(context, NO_BACKUP_FILE);
|
||||
}
|
||||
|
||||
private void checkForRestore(Context context, String str) {
|
||||
File file = new File(D.h.getNoBackupFilesDir(context), str);
|
||||
if (file.exists()) {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
if (!file.createNewFile() || isEmpty()) {
|
||||
return;
|
||||
}
|
||||
Log.i(Constants.TAG, "App restored, clearing state");
|
||||
deleteAll();
|
||||
} catch (IOException e4) {
|
||||
if (Log.isLoggable(Constants.TAG, 3)) {
|
||||
Log.d(Constants.TAG, "Error creating file in no backup dir: " + e4.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private String createTokenKey(String str, String str2) {
|
||||
return str + STORE_KEY_TOKEN + str2 + "|*";
|
||||
}
|
||||
|
||||
public synchronized void deleteAll() {
|
||||
this.store.edit().clear().commit();
|
||||
}
|
||||
|
||||
public synchronized void deleteToken(String str, String str2) {
|
||||
String createTokenKey = createTokenKey(str, str2);
|
||||
SharedPreferences.Editor edit = this.store.edit();
|
||||
edit.remove(createTokenKey);
|
||||
edit.commit();
|
||||
}
|
||||
|
||||
public synchronized Token getToken(String str, String str2) {
|
||||
return Token.parse(this.store.getString(createTokenKey(str, str2), null));
|
||||
}
|
||||
|
||||
public synchronized boolean isEmpty() {
|
||||
return this.store.getAll().isEmpty();
|
||||
}
|
||||
|
||||
public synchronized void saveToken(String str, String str2, String str3, String str4) {
|
||||
String encode = Token.encode(str3, str4, System.currentTimeMillis());
|
||||
if (encode == null) {
|
||||
return;
|
||||
}
|
||||
SharedPreferences.Editor edit = this.store.edit();
|
||||
edit.putString(createTokenKey(str, str2), encode);
|
||||
edit.commit();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,152 @@
|
||||
package com.google.firebase.messaging;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.IntentFilter;
|
||||
import android.net.ConnectivityManager;
|
||||
import android.net.NetworkInfo;
|
||||
import android.os.PowerManager;
|
||||
import android.util.Log;
|
||||
import com.google.android.gms.common.util.concurrent.NamedThreadFactory;
|
||||
import java.io.IOException;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.LinkedBlockingQueue;
|
||||
import java.util.concurrent.ThreadPoolExecutor;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: package-private */
|
||||
/* loaded from: classes3.dex */
|
||||
public class SyncTask implements Runnable {
|
||||
private final FirebaseMessaging firebaseMessaging;
|
||||
private final long nextDelaySeconds;
|
||||
|
||||
@SuppressLint({"ThreadPoolCreation"})
|
||||
ExecutorService processorExecutor = new ThreadPoolExecutor(0, 1, 30, TimeUnit.SECONDS, new LinkedBlockingQueue(), new NamedThreadFactory("firebase-iid-executor"));
|
||||
private final PowerManager.WakeLock syncWakeLock;
|
||||
|
||||
/* loaded from: classes3.dex */
|
||||
public static class ConnectivityChangeReceiver extends BroadcastReceiver {
|
||||
private SyncTask task;
|
||||
|
||||
public ConnectivityChangeReceiver(SyncTask syncTask) {
|
||||
this.task = syncTask;
|
||||
}
|
||||
|
||||
@Override // android.content.BroadcastReceiver
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
SyncTask syncTask = this.task;
|
||||
if (syncTask != null && syncTask.isDeviceConnected()) {
|
||||
if (SyncTask.isDebugLogEnabled()) {
|
||||
Log.d(Constants.TAG, "Connectivity changed. Starting background sync.");
|
||||
}
|
||||
this.task.firebaseMessaging.enqueueTaskWithDelaySeconds(this.task, 0L);
|
||||
this.task.getContext().unregisterReceiver(this);
|
||||
this.task = null;
|
||||
}
|
||||
}
|
||||
|
||||
public void registerReceiver() {
|
||||
if (SyncTask.isDebugLogEnabled()) {
|
||||
Log.d(Constants.TAG, "Connectivity change received registered");
|
||||
}
|
||||
this.task.getContext().registerReceiver(this, new IntentFilter("android.net.conn.CONNECTIVITY_CHANGE"));
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressLint({"InvalidWakeLockTag"})
|
||||
public SyncTask(FirebaseMessaging firebaseMessaging, long j4) {
|
||||
this.firebaseMessaging = firebaseMessaging;
|
||||
this.nextDelaySeconds = j4;
|
||||
PowerManager.WakeLock newWakeLock = ((PowerManager) getContext().getSystemService("power")).newWakeLock(1, "fiid-sync");
|
||||
this.syncWakeLock = newWakeLock;
|
||||
newWakeLock.setReferenceCounted(false);
|
||||
}
|
||||
|
||||
public static boolean isDebugLogEnabled() {
|
||||
return Log.isLoggable(Constants.TAG, 3);
|
||||
}
|
||||
|
||||
public Context getContext() {
|
||||
return this.firebaseMessaging.getApplicationContext();
|
||||
}
|
||||
|
||||
public boolean isDeviceConnected() {
|
||||
ConnectivityManager connectivityManager = (ConnectivityManager) getContext().getSystemService("connectivity");
|
||||
NetworkInfo activeNetworkInfo = connectivityManager != null ? connectivityManager.getActiveNetworkInfo() : null;
|
||||
return activeNetworkInfo != null && activeNetworkInfo.isConnected();
|
||||
}
|
||||
|
||||
public boolean maybeRefreshToken() throws IOException {
|
||||
try {
|
||||
if (this.firebaseMessaging.blockingGetToken() == null) {
|
||||
Log.e(Constants.TAG, "Token retrieval failed: null");
|
||||
return false;
|
||||
}
|
||||
if (!Log.isLoggable(Constants.TAG, 3)) {
|
||||
return true;
|
||||
}
|
||||
Log.d(Constants.TAG, "Token successfully retrieved");
|
||||
return true;
|
||||
} catch (IOException e4) {
|
||||
if (!GmsRpc.isErrorMessageForRetryableError(e4.getMessage())) {
|
||||
if (e4.getMessage() != null) {
|
||||
throw e4;
|
||||
}
|
||||
Log.w(Constants.TAG, "Token retrieval failed without exception message. Will retry token retrieval");
|
||||
return false;
|
||||
}
|
||||
Log.w(Constants.TAG, "Token retrieval failed: " + e4.getMessage() + ". Will retry token retrieval");
|
||||
return false;
|
||||
} catch (SecurityException unused) {
|
||||
Log.w(Constants.TAG, "Token retrieval failed with SecurityException. Will retry token retrieval");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override // java.lang.Runnable
|
||||
@SuppressLint({"WakelockTimeout"})
|
||||
public void run() {
|
||||
if (ServiceStarter.getInstance().hasWakeLockPermission(getContext())) {
|
||||
this.syncWakeLock.acquire();
|
||||
}
|
||||
try {
|
||||
try {
|
||||
this.firebaseMessaging.setSyncScheduledOrRunning(true);
|
||||
if (!this.firebaseMessaging.isGmsCorePresent()) {
|
||||
this.firebaseMessaging.setSyncScheduledOrRunning(false);
|
||||
if (!ServiceStarter.getInstance().hasWakeLockPermission(getContext())) {
|
||||
return;
|
||||
}
|
||||
} else if (!ServiceStarter.getInstance().hasAccessNetworkStatePermission(getContext()) || isDeviceConnected()) {
|
||||
if (maybeRefreshToken()) {
|
||||
this.firebaseMessaging.setSyncScheduledOrRunning(false);
|
||||
} else {
|
||||
this.firebaseMessaging.syncWithDelaySecondsInternal(this.nextDelaySeconds);
|
||||
}
|
||||
if (!ServiceStarter.getInstance().hasWakeLockPermission(getContext())) {
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
new ConnectivityChangeReceiver(this).registerReceiver();
|
||||
if (!ServiceStarter.getInstance().hasWakeLockPermission(getContext())) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
this.syncWakeLock.release();
|
||||
} catch (IOException e4) {
|
||||
Log.e(Constants.TAG, "Topic sync or token retrieval failed on hard failure exceptions: " + e4.getMessage() + ". Won't retry the operation.");
|
||||
this.firebaseMessaging.setSyncScheduledOrRunning(false);
|
||||
if (ServiceStarter.getInstance().hasWakeLockPermission(getContext())) {
|
||||
this.syncWakeLock.release();
|
||||
}
|
||||
}
|
||||
} catch (Throwable th) {
|
||||
if (ServiceStarter.getInstance().hasWakeLockPermission(getContext())) {
|
||||
this.syncWakeLock.release();
|
||||
}
|
||||
throw th;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
package com.google.firebase.messaging;
|
||||
|
||||
import C.w;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import com.google.android.gms.common.internal.Objects;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
/* loaded from: classes3.dex */
|
||||
final class TopicOperation {
|
||||
private static final String OLD_TOPIC_PREFIX = "/topics/";
|
||||
static final String OPERATION_PAIR_DIVIDER = "!";
|
||||
private static final String TOPIC_NAME_PATTERN = "[a-zA-Z0-9-_.~%]{1,900}";
|
||||
private static final Pattern TOPIC_NAME_REGEXP = Pattern.compile(TOPIC_NAME_PATTERN);
|
||||
private final String operation;
|
||||
private final String serializedString;
|
||||
private final String topic;
|
||||
|
||||
private TopicOperation(String str, String str2) {
|
||||
this.topic = normalizeTopicOrThrow(str2, str);
|
||||
this.operation = str;
|
||||
this.serializedString = str + OPERATION_PAIR_DIVIDER + str2;
|
||||
}
|
||||
|
||||
public static TopicOperation from(String str) {
|
||||
if (TextUtils.isEmpty(str)) {
|
||||
return null;
|
||||
}
|
||||
String[] split = str.split(OPERATION_PAIR_DIVIDER, -1);
|
||||
if (split.length != 2) {
|
||||
return null;
|
||||
}
|
||||
return new TopicOperation(split[0], split[1]);
|
||||
}
|
||||
|
||||
private static String normalizeTopicOrThrow(String str, String str2) {
|
||||
if (str != null && str.startsWith(OLD_TOPIC_PREFIX)) {
|
||||
Log.w(Constants.TAG, "Format /topics/topic-name is deprecated. Only 'topic-name' should be used in " + str2 + ".");
|
||||
str = str.substring(8);
|
||||
}
|
||||
if (str == null || !TOPIC_NAME_REGEXP.matcher(str).matches()) {
|
||||
throw new IllegalArgumentException(w.o("Invalid topic name: ", str, " does not match the allowed format [a-zA-Z0-9-_.~%]{1,900}."));
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
||||
public static TopicOperation subscribe(String str) {
|
||||
return new TopicOperation("S", str);
|
||||
}
|
||||
|
||||
public static TopicOperation unsubscribe(String str) {
|
||||
return new TopicOperation("U", str);
|
||||
}
|
||||
|
||||
public boolean equals(Object obj) {
|
||||
if (!(obj instanceof TopicOperation)) {
|
||||
return false;
|
||||
}
|
||||
TopicOperation topicOperation = (TopicOperation) obj;
|
||||
return this.topic.equals(topicOperation.topic) && this.operation.equals(topicOperation.operation);
|
||||
}
|
||||
|
||||
public String getOperation() {
|
||||
return this.operation;
|
||||
}
|
||||
|
||||
public String getTopic() {
|
||||
return this.topic;
|
||||
}
|
||||
|
||||
public int hashCode() {
|
||||
return Objects.hashCode(this.operation, this.topic);
|
||||
}
|
||||
|
||||
public String serialize() {
|
||||
return this.serializedString;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,95 @@
|
||||
package com.google.firebase.messaging;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
import android.util.Log;
|
||||
import java.lang.ref.WeakReference;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.NoSuchElementException;
|
||||
import java.util.concurrent.Executor;
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: package-private */
|
||||
/* loaded from: classes3.dex */
|
||||
public final class TopicsStore {
|
||||
private static final String DIVIDER_QUEUE_OPERATIONS = ",";
|
||||
static final String KEY_TOPIC_OPERATIONS_QUEUE = "topic_operation_queue";
|
||||
static final String PREFERENCES = "com.google.android.gms.appid";
|
||||
private static WeakReference<TopicsStore> topicsStoreWeakReference;
|
||||
private final SharedPreferences sharedPreferences;
|
||||
private final Executor syncExecutor;
|
||||
private SharedPreferencesQueue topicOperationsQueue;
|
||||
|
||||
private TopicsStore(SharedPreferences sharedPreferences, Executor executor) {
|
||||
this.syncExecutor = executor;
|
||||
this.sharedPreferences = sharedPreferences;
|
||||
}
|
||||
|
||||
public static synchronized void clearCaches() {
|
||||
synchronized (TopicsStore.class) {
|
||||
WeakReference<TopicsStore> weakReference = topicsStoreWeakReference;
|
||||
if (weakReference != null) {
|
||||
weakReference.clear();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static synchronized TopicsStore getInstance(Context context, Executor executor) {
|
||||
TopicsStore topicsStore;
|
||||
synchronized (TopicsStore.class) {
|
||||
try {
|
||||
WeakReference<TopicsStore> weakReference = topicsStoreWeakReference;
|
||||
topicsStore = weakReference != null ? weakReference.get() : null;
|
||||
if (topicsStore == null) {
|
||||
topicsStore = new TopicsStore(context.getSharedPreferences(PREFERENCES, 0), executor);
|
||||
topicsStore.initStore();
|
||||
topicsStoreWeakReference = new WeakReference<>(topicsStore);
|
||||
}
|
||||
} catch (Throwable th) {
|
||||
throw th;
|
||||
}
|
||||
}
|
||||
return topicsStore;
|
||||
}
|
||||
|
||||
private synchronized void initStore() {
|
||||
this.topicOperationsQueue = SharedPreferencesQueue.createInstance(this.sharedPreferences, KEY_TOPIC_OPERATIONS_QUEUE, DIVIDER_QUEUE_OPERATIONS, this.syncExecutor);
|
||||
}
|
||||
|
||||
public synchronized boolean addTopicOperation(TopicOperation topicOperation) {
|
||||
return this.topicOperationsQueue.add(topicOperation.serialize());
|
||||
}
|
||||
|
||||
public synchronized void clearTopicOperations() {
|
||||
this.topicOperationsQueue.clear();
|
||||
}
|
||||
|
||||
public synchronized TopicOperation getNextTopicOperation() {
|
||||
return TopicOperation.from(this.topicOperationsQueue.peek());
|
||||
}
|
||||
|
||||
public synchronized List<TopicOperation> getOperations() {
|
||||
ArrayList arrayList;
|
||||
List<String> list = this.topicOperationsQueue.toList();
|
||||
arrayList = new ArrayList(list.size());
|
||||
Iterator<String> it = list.iterator();
|
||||
while (it.hasNext()) {
|
||||
arrayList.add(TopicOperation.from(it.next()));
|
||||
}
|
||||
return arrayList;
|
||||
}
|
||||
|
||||
public synchronized TopicOperation pollTopicOperation() {
|
||||
try {
|
||||
} catch (NoSuchElementException unused) {
|
||||
Log.e(Constants.TAG, "Polling operation queue failed");
|
||||
return null;
|
||||
}
|
||||
return TopicOperation.from(this.topicOperationsQueue.remove());
|
||||
}
|
||||
|
||||
public synchronized boolean removeTopicOperation(TopicOperation topicOperation) {
|
||||
return this.topicOperationsQueue.remove(topicOperation.serialize());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,352 @@
|
||||
package com.google.firebase.messaging;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.Log;
|
||||
import com.google.android.gms.tasks.Task;
|
||||
import com.google.android.gms.tasks.TaskCompletionSource;
|
||||
import com.google.android.gms.tasks.Tasks;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayDeque;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.Callable;
|
||||
import java.util.concurrent.ExecutionException;
|
||||
import java.util.concurrent.ScheduledExecutorService;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.concurrent.TimeoutException;
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: package-private */
|
||||
/* loaded from: classes3.dex */
|
||||
public class TopicsSubscriber {
|
||||
static final String ERROR_INTERNAL_SERVER_ERROR = "INTERNAL_SERVER_ERROR";
|
||||
static final String ERROR_SERVICE_NOT_AVAILABLE = "SERVICE_NOT_AVAILABLE";
|
||||
private static final long MAX_DELAY_SEC = TimeUnit.HOURS.toSeconds(8);
|
||||
private static final long MIN_DELAY_SEC = 30;
|
||||
private static final long RPC_TIMEOUT_SEC = 30;
|
||||
private final Context context;
|
||||
private final FirebaseMessaging firebaseMessaging;
|
||||
private final Metadata metadata;
|
||||
private final GmsRpc rpc;
|
||||
private final TopicsStore store;
|
||||
private final ScheduledExecutorService syncExecutor;
|
||||
private final Map<String, ArrayDeque<TaskCompletionSource<Void>>> pendingOperations = new s.j(0);
|
||||
private boolean syncScheduledOrRunning = false;
|
||||
|
||||
/* JADX WARN: Type inference failed for: r0v0, types: [java.util.Map<java.lang.String, java.util.ArrayDeque<com.google.android.gms.tasks.TaskCompletionSource<java.lang.Void>>>, s.j] */
|
||||
private TopicsSubscriber(FirebaseMessaging firebaseMessaging, Metadata metadata, TopicsStore topicsStore, GmsRpc gmsRpc, Context context, ScheduledExecutorService scheduledExecutorService) {
|
||||
this.firebaseMessaging = firebaseMessaging;
|
||||
this.metadata = metadata;
|
||||
this.store = topicsStore;
|
||||
this.rpc = gmsRpc;
|
||||
this.context = context;
|
||||
this.syncExecutor = scheduledExecutorService;
|
||||
}
|
||||
|
||||
private void addToPendingOperations(TopicOperation topicOperation, TaskCompletionSource<Void> taskCompletionSource) {
|
||||
ArrayDeque<TaskCompletionSource<Void>> arrayDeque;
|
||||
synchronized (this.pendingOperations) {
|
||||
try {
|
||||
String serialize = topicOperation.serialize();
|
||||
if (this.pendingOperations.containsKey(serialize)) {
|
||||
arrayDeque = this.pendingOperations.get(serialize);
|
||||
} else {
|
||||
ArrayDeque<TaskCompletionSource<Void>> arrayDeque2 = new ArrayDeque<>();
|
||||
this.pendingOperations.put(serialize, arrayDeque2);
|
||||
arrayDeque = arrayDeque2;
|
||||
}
|
||||
arrayDeque.add(taskCompletionSource);
|
||||
} catch (Throwable th) {
|
||||
throw th;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static <T> void awaitTask(Task<T> task) throws IOException {
|
||||
try {
|
||||
Tasks.await(task, 30L, TimeUnit.SECONDS);
|
||||
} catch (InterruptedException | TimeoutException e4) {
|
||||
throw new IOException(ERROR_SERVICE_NOT_AVAILABLE, e4);
|
||||
} catch (ExecutionException e5) {
|
||||
Throwable cause = e5.getCause();
|
||||
if (cause instanceof IOException) {
|
||||
throw ((IOException) cause);
|
||||
}
|
||||
if (!(cause instanceof RuntimeException)) {
|
||||
throw new IOException(e5);
|
||||
}
|
||||
throw ((RuntimeException) cause);
|
||||
}
|
||||
}
|
||||
|
||||
private void blockingSubscribeToTopic(String str) throws IOException {
|
||||
awaitTask(this.rpc.subscribeToTopic(this.firebaseMessaging.blockingGetToken(), str));
|
||||
}
|
||||
|
||||
private void blockingUnsubscribeFromTopic(String str) throws IOException {
|
||||
awaitTask(this.rpc.unsubscribeFromTopic(this.firebaseMessaging.blockingGetToken(), str));
|
||||
}
|
||||
|
||||
public static Task<TopicsSubscriber> createInstance(final FirebaseMessaging firebaseMessaging, final Metadata metadata, final GmsRpc gmsRpc, final Context context, final ScheduledExecutorService scheduledExecutorService) {
|
||||
return Tasks.call(scheduledExecutorService, new Callable() { // from class: com.google.firebase.messaging.o
|
||||
@Override // java.util.concurrent.Callable
|
||||
public final Object call() {
|
||||
TopicsSubscriber lambda$createInstance$0;
|
||||
lambda$createInstance$0 = TopicsSubscriber.lambda$createInstance$0(context, scheduledExecutorService, firebaseMessaging, metadata, gmsRpc);
|
||||
return lambda$createInstance$0;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public static boolean isDebugLogEnabled() {
|
||||
return Log.isLoggable(Constants.TAG, 3);
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: private */
|
||||
public static /* synthetic */ TopicsSubscriber lambda$createInstance$0(Context context, ScheduledExecutorService scheduledExecutorService, FirebaseMessaging firebaseMessaging, Metadata metadata, GmsRpc gmsRpc) throws Exception {
|
||||
return new TopicsSubscriber(firebaseMessaging, metadata, TopicsStore.getInstance(context, scheduledExecutorService), gmsRpc, context, scheduledExecutorService);
|
||||
}
|
||||
|
||||
private void markCompletePendingOperation(TopicOperation topicOperation) {
|
||||
synchronized (this.pendingOperations) {
|
||||
try {
|
||||
String serialize = topicOperation.serialize();
|
||||
if (this.pendingOperations.containsKey(serialize)) {
|
||||
ArrayDeque<TaskCompletionSource<Void>> arrayDeque = this.pendingOperations.get(serialize);
|
||||
TaskCompletionSource<Void> poll = arrayDeque.poll();
|
||||
if (poll != null) {
|
||||
poll.setResult(null);
|
||||
}
|
||||
if (arrayDeque.isEmpty()) {
|
||||
this.pendingOperations.remove(serialize);
|
||||
}
|
||||
}
|
||||
} catch (Throwable th) {
|
||||
throw th;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void startSync() {
|
||||
if (isSyncScheduledOrRunning()) {
|
||||
return;
|
||||
}
|
||||
syncWithDelaySecondsInternal(0L);
|
||||
}
|
||||
|
||||
public TopicsStore getStore() {
|
||||
return this.store;
|
||||
}
|
||||
|
||||
public boolean hasPendingOperation() {
|
||||
return this.store.getNextTopicOperation() != null;
|
||||
}
|
||||
|
||||
public synchronized boolean isSyncScheduledOrRunning() {
|
||||
return this.syncScheduledOrRunning;
|
||||
}
|
||||
|
||||
/* JADX WARN: Removed duplicated region for block: B:11:0x0037 */
|
||||
/* JADX WARN: Removed duplicated region for block: B:20:0x0078 A[Catch: IOException -> 0x0025, TryCatch #0 {IOException -> 0x0025, blocks: (B:3:0x0009, B:12:0x0039, B:14:0x003f, B:17:0x0054, B:19:0x0061, B:20:0x0078, B:22:0x0085, B:23:0x001b, B:26:0x0028), top: B:2:0x0009 }] */
|
||||
/*
|
||||
Code decompiled incorrectly, please refer to instructions dump.
|
||||
To view partially-correct add '--show-bad-code' argument
|
||||
*/
|
||||
public boolean performTopicOperation(com.google.firebase.messaging.TopicOperation r10) throws java.io.IOException {
|
||||
/*
|
||||
r9 = this;
|
||||
java.lang.String r0 = "FirebaseMessaging"
|
||||
java.lang.String r1 = "Unknown topic operation"
|
||||
java.lang.String r2 = "Subscribe to topic: "
|
||||
java.lang.String r3 = "Unsubscribe from topic: "
|
||||
r4 = 0
|
||||
java.lang.String r5 = r10.getOperation() // Catch: java.io.IOException -> L25
|
||||
int r6 = r5.hashCode() // Catch: java.io.IOException -> L25
|
||||
r7 = 83
|
||||
r8 = 1
|
||||
if (r6 == r7) goto L28
|
||||
r7 = 85
|
||||
if (r6 == r7) goto L1b
|
||||
goto L32
|
||||
L1b:
|
||||
java.lang.String r6 = "U"
|
||||
boolean r5 = r5.equals(r6) // Catch: java.io.IOException -> L25
|
||||
if (r5 == 0) goto L32
|
||||
r5 = r8
|
||||
goto L33
|
||||
L25:
|
||||
r9 = move-exception
|
||||
goto L9c
|
||||
L28:
|
||||
java.lang.String r6 = "S"
|
||||
boolean r5 = r5.equals(r6) // Catch: java.io.IOException -> L25
|
||||
if (r5 == 0) goto L32
|
||||
r5 = r4
|
||||
goto L33
|
||||
L32:
|
||||
r5 = -1
|
||||
L33:
|
||||
java.lang.String r6 = " succeeded."
|
||||
if (r5 == 0) goto L78
|
||||
if (r5 == r8) goto L54
|
||||
boolean r9 = isDebugLogEnabled() // Catch: java.io.IOException -> L25
|
||||
if (r9 == 0) goto L9b
|
||||
java.lang.StringBuilder r9 = new java.lang.StringBuilder // Catch: java.io.IOException -> L25
|
||||
r9.<init>(r1) // Catch: java.io.IOException -> L25
|
||||
r9.append(r10) // Catch: java.io.IOException -> L25
|
||||
java.lang.String r10 = "."
|
||||
r9.append(r10) // Catch: java.io.IOException -> L25
|
||||
java.lang.String r9 = r9.toString() // Catch: java.io.IOException -> L25
|
||||
android.util.Log.d(r0, r9) // Catch: java.io.IOException -> L25
|
||||
goto L9b
|
||||
L54:
|
||||
java.lang.String r1 = r10.getTopic() // Catch: java.io.IOException -> L25
|
||||
r9.blockingUnsubscribeFromTopic(r1) // Catch: java.io.IOException -> L25
|
||||
boolean r9 = isDebugLogEnabled() // Catch: java.io.IOException -> L25
|
||||
if (r9 == 0) goto L9b
|
||||
java.lang.StringBuilder r9 = new java.lang.StringBuilder // Catch: java.io.IOException -> L25
|
||||
r9.<init>(r3) // Catch: java.io.IOException -> L25
|
||||
java.lang.String r10 = r10.getTopic() // Catch: java.io.IOException -> L25
|
||||
r9.append(r10) // Catch: java.io.IOException -> L25
|
||||
r9.append(r6) // Catch: java.io.IOException -> L25
|
||||
java.lang.String r9 = r9.toString() // Catch: java.io.IOException -> L25
|
||||
android.util.Log.d(r0, r9) // Catch: java.io.IOException -> L25
|
||||
goto L9b
|
||||
L78:
|
||||
java.lang.String r1 = r10.getTopic() // Catch: java.io.IOException -> L25
|
||||
r9.blockingSubscribeToTopic(r1) // Catch: java.io.IOException -> L25
|
||||
boolean r9 = isDebugLogEnabled() // Catch: java.io.IOException -> L25
|
||||
if (r9 == 0) goto L9b
|
||||
java.lang.StringBuilder r9 = new java.lang.StringBuilder // Catch: java.io.IOException -> L25
|
||||
r9.<init>(r2) // Catch: java.io.IOException -> L25
|
||||
java.lang.String r10 = r10.getTopic() // Catch: java.io.IOException -> L25
|
||||
r9.append(r10) // Catch: java.io.IOException -> L25
|
||||
r9.append(r6) // Catch: java.io.IOException -> L25
|
||||
java.lang.String r9 = r9.toString() // Catch: java.io.IOException -> L25
|
||||
android.util.Log.d(r0, r9) // Catch: java.io.IOException -> L25
|
||||
L9b:
|
||||
return r8
|
||||
L9c:
|
||||
java.lang.String r10 = "SERVICE_NOT_AVAILABLE"
|
||||
java.lang.String r1 = r9.getMessage()
|
||||
boolean r10 = r10.equals(r1)
|
||||
if (r10 != 0) goto Lc2
|
||||
java.lang.String r10 = "INTERNAL_SERVER_ERROR"
|
||||
java.lang.String r1 = r9.getMessage()
|
||||
boolean r10 = r10.equals(r1)
|
||||
if (r10 == 0) goto Lb5
|
||||
goto Lc2
|
||||
Lb5:
|
||||
java.lang.String r10 = r9.getMessage()
|
||||
if (r10 != 0) goto Lc1
|
||||
java.lang.String r9 = "Topic operation failed without exception message. Will retry Topic operation."
|
||||
android.util.Log.e(r0, r9)
|
||||
return r4
|
||||
Lc1:
|
||||
throw r9
|
||||
Lc2:
|
||||
java.lang.StringBuilder r10 = new java.lang.StringBuilder
|
||||
java.lang.String r1 = "Topic operation failed: "
|
||||
r10.<init>(r1)
|
||||
java.lang.String r9 = r9.getMessage()
|
||||
r10.append(r9)
|
||||
java.lang.String r9 = ". Will retry Topic operation."
|
||||
r10.append(r9)
|
||||
java.lang.String r9 = r10.toString()
|
||||
android.util.Log.e(r0, r9)
|
||||
return r4
|
||||
*/
|
||||
throw new UnsupportedOperationException("Method not decompiled: com.google.firebase.messaging.TopicsSubscriber.performTopicOperation(com.google.firebase.messaging.TopicOperation):boolean");
|
||||
}
|
||||
|
||||
public void scheduleSyncTaskWithDelaySeconds(Runnable runnable, long j4) {
|
||||
this.syncExecutor.schedule(runnable, j4, TimeUnit.SECONDS);
|
||||
}
|
||||
|
||||
public Task<Void> scheduleTopicOperation(TopicOperation topicOperation) {
|
||||
this.store.addTopicOperation(topicOperation);
|
||||
TaskCompletionSource<Void> taskCompletionSource = new TaskCompletionSource<>();
|
||||
addToPendingOperations(topicOperation, taskCompletionSource);
|
||||
return taskCompletionSource.getTask();
|
||||
}
|
||||
|
||||
public synchronized void setSyncScheduledOrRunning(boolean z3) {
|
||||
this.syncScheduledOrRunning = z3;
|
||||
}
|
||||
|
||||
public void startTopicsSyncIfNecessary() {
|
||||
if (hasPendingOperation()) {
|
||||
startSync();
|
||||
}
|
||||
}
|
||||
|
||||
public Task<Void> subscribeToTopic(String str) {
|
||||
Task<Void> scheduleTopicOperation = scheduleTopicOperation(TopicOperation.subscribe(str));
|
||||
startTopicsSyncIfNecessary();
|
||||
return scheduleTopicOperation;
|
||||
}
|
||||
|
||||
/* JADX WARN: Code restructure failed: missing block: B:14:0x000d, code lost:
|
||||
|
||||
if (isDebugLogEnabled() == false) goto L10;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:15:0x000f, code lost:
|
||||
|
||||
android.util.Log.d(com.google.firebase.messaging.Constants.TAG, "topic sync succeeded");
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:18:0x001b, code lost:
|
||||
|
||||
return true;
|
||||
*/
|
||||
/*
|
||||
Code decompiled incorrectly, please refer to instructions dump.
|
||||
To view partially-correct add '--show-bad-code' argument
|
||||
*/
|
||||
public boolean syncTopics() throws java.io.IOException {
|
||||
/*
|
||||
r2 = this;
|
||||
L0:
|
||||
monitor-enter(r2)
|
||||
com.google.firebase.messaging.TopicsStore r0 = r2.store // Catch: java.lang.Throwable -> L17
|
||||
com.google.firebase.messaging.TopicOperation r0 = r0.getNextTopicOperation() // Catch: java.lang.Throwable -> L17
|
||||
if (r0 != 0) goto L1c
|
||||
boolean r0 = isDebugLogEnabled() // Catch: java.lang.Throwable -> L17
|
||||
if (r0 == 0) goto L19
|
||||
java.lang.String r0 = "FirebaseMessaging"
|
||||
java.lang.String r1 = "topic sync succeeded"
|
||||
android.util.Log.d(r0, r1) // Catch: java.lang.Throwable -> L17
|
||||
goto L19
|
||||
L17:
|
||||
r0 = move-exception
|
||||
goto L2e
|
||||
L19:
|
||||
r0 = 1
|
||||
monitor-exit(r2) // Catch: java.lang.Throwable -> L17
|
||||
return r0
|
||||
L1c:
|
||||
monitor-exit(r2) // Catch: java.lang.Throwable -> L17
|
||||
boolean r1 = r2.performTopicOperation(r0)
|
||||
if (r1 != 0) goto L25
|
||||
r2 = 0
|
||||
return r2
|
||||
L25:
|
||||
com.google.firebase.messaging.TopicsStore r1 = r2.store
|
||||
r1.removeTopicOperation(r0)
|
||||
r2.markCompletePendingOperation(r0)
|
||||
goto L0
|
||||
L2e:
|
||||
monitor-exit(r2) // Catch: java.lang.Throwable -> L17
|
||||
throw r0
|
||||
*/
|
||||
throw new UnsupportedOperationException("Method not decompiled: com.google.firebase.messaging.TopicsSubscriber.syncTopics():boolean");
|
||||
}
|
||||
|
||||
public void syncWithDelaySecondsInternal(long j4) {
|
||||
scheduleSyncTaskWithDelaySeconds(new TopicsSyncTask(this, this.context, this.metadata, Math.min(Math.max(30L, 2 * j4), MAX_DELAY_SEC)), j4);
|
||||
setSyncScheduledOrRunning(true);
|
||||
}
|
||||
|
||||
public Task<Void> unsubscribeFromTopic(String str) {
|
||||
Task<Void> scheduleTopicOperation = scheduleTopicOperation(TopicOperation.unsubscribe(str));
|
||||
startTopicsSyncIfNecessary();
|
||||
return scheduleTopicOperation;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,198 @@
|
||||
package com.google.firebase.messaging;
|
||||
|
||||
import C.w;
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.IntentFilter;
|
||||
import android.net.ConnectivityManager;
|
||||
import android.net.NetworkInfo;
|
||||
import android.os.PowerManager;
|
||||
import android.util.Log;
|
||||
import java.io.IOException;
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: package-private */
|
||||
/* loaded from: classes3.dex */
|
||||
public class TopicsSyncTask implements Runnable {
|
||||
private static final Object TOPIC_SYNC_TASK_LOCK = new Object();
|
||||
private static Boolean hasAccessNetworkStatePermission;
|
||||
private static Boolean hasWakeLockPermission;
|
||||
private final Context context;
|
||||
private final Metadata metadata;
|
||||
private final long nextDelaySeconds;
|
||||
private final PowerManager.WakeLock syncWakeLock;
|
||||
private final TopicsSubscriber topicsSubscriber;
|
||||
|
||||
/* loaded from: classes3.dex */
|
||||
public class ConnectivityChangeReceiver extends BroadcastReceiver {
|
||||
private TopicsSyncTask task;
|
||||
|
||||
public ConnectivityChangeReceiver(TopicsSyncTask topicsSyncTask) {
|
||||
this.task = topicsSyncTask;
|
||||
}
|
||||
|
||||
@Override // android.content.BroadcastReceiver
|
||||
public synchronized void onReceive(Context context, Intent intent) {
|
||||
try {
|
||||
TopicsSyncTask topicsSyncTask = this.task;
|
||||
if (topicsSyncTask == null) {
|
||||
return;
|
||||
}
|
||||
if (topicsSyncTask.isDeviceConnected()) {
|
||||
if (TopicsSyncTask.access$100()) {
|
||||
Log.d(Constants.TAG, "Connectivity changed. Starting background sync.");
|
||||
}
|
||||
this.task.topicsSubscriber.scheduleSyncTaskWithDelaySeconds(this.task, 0L);
|
||||
context.unregisterReceiver(this);
|
||||
this.task = null;
|
||||
}
|
||||
} catch (Throwable th) {
|
||||
throw th;
|
||||
}
|
||||
}
|
||||
|
||||
public void registerReceiver() {
|
||||
if (TopicsSyncTask.access$100()) {
|
||||
Log.d(Constants.TAG, "Connectivity change received registered");
|
||||
}
|
||||
TopicsSyncTask.this.context.registerReceiver(this, new IntentFilter("android.net.conn.CONNECTIVITY_CHANGE"));
|
||||
}
|
||||
}
|
||||
|
||||
public TopicsSyncTask(TopicsSubscriber topicsSubscriber, Context context, Metadata metadata, long j4) {
|
||||
this.topicsSubscriber = topicsSubscriber;
|
||||
this.context = context;
|
||||
this.nextDelaySeconds = j4;
|
||||
this.metadata = metadata;
|
||||
this.syncWakeLock = ((PowerManager) context.getSystemService("power")).newWakeLock(1, Constants.FCM_WAKE_LOCK);
|
||||
}
|
||||
|
||||
public static /* synthetic */ boolean access$100() {
|
||||
return isLoggable();
|
||||
}
|
||||
|
||||
private static String createPermissionMissingLog(String str) {
|
||||
return w.o("Missing Permission: ", str, ". This permission should normally be included by the manifest merger, but may needed to be manually added to your manifest");
|
||||
}
|
||||
|
||||
private static boolean hasAccessNetworkStatePermission(Context context) {
|
||||
boolean booleanValue;
|
||||
synchronized (TOPIC_SYNC_TASK_LOCK) {
|
||||
try {
|
||||
Boolean bool = hasAccessNetworkStatePermission;
|
||||
Boolean valueOf = Boolean.valueOf(bool == null ? hasPermission(context, "android.permission.ACCESS_NETWORK_STATE", bool) : bool.booleanValue());
|
||||
hasAccessNetworkStatePermission = valueOf;
|
||||
booleanValue = valueOf.booleanValue();
|
||||
} catch (Throwable th) {
|
||||
throw th;
|
||||
}
|
||||
}
|
||||
return booleanValue;
|
||||
}
|
||||
|
||||
private static boolean hasPermission(Context context, String str, Boolean bool) {
|
||||
if (bool != null) {
|
||||
return bool.booleanValue();
|
||||
}
|
||||
boolean z3 = context.checkCallingOrSelfPermission(str) == 0;
|
||||
if (!z3 && Log.isLoggable(Constants.TAG, 3)) {
|
||||
Log.d(Constants.TAG, createPermissionMissingLog(str));
|
||||
}
|
||||
return z3;
|
||||
}
|
||||
|
||||
private static boolean hasWakeLockPermission(Context context) {
|
||||
boolean booleanValue;
|
||||
synchronized (TOPIC_SYNC_TASK_LOCK) {
|
||||
try {
|
||||
Boolean bool = hasWakeLockPermission;
|
||||
Boolean valueOf = Boolean.valueOf(bool == null ? hasPermission(context, "android.permission.WAKE_LOCK", bool) : bool.booleanValue());
|
||||
hasWakeLockPermission = valueOf;
|
||||
booleanValue = valueOf.booleanValue();
|
||||
} catch (Throwable th) {
|
||||
throw th;
|
||||
}
|
||||
}
|
||||
return booleanValue;
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: private */
|
||||
public synchronized boolean isDeviceConnected() {
|
||||
boolean z3;
|
||||
try {
|
||||
ConnectivityManager connectivityManager = (ConnectivityManager) this.context.getSystemService("connectivity");
|
||||
NetworkInfo activeNetworkInfo = connectivityManager != null ? connectivityManager.getActiveNetworkInfo() : null;
|
||||
if (activeNetworkInfo != null) {
|
||||
z3 = activeNetworkInfo.isConnected();
|
||||
}
|
||||
} catch (Throwable th) {
|
||||
throw th;
|
||||
}
|
||||
return z3;
|
||||
}
|
||||
|
||||
private static boolean isLoggable() {
|
||||
return Log.isLoggable(Constants.TAG, 3);
|
||||
}
|
||||
|
||||
@Override // java.lang.Runnable
|
||||
@SuppressLint({"Wakelock"})
|
||||
public void run() {
|
||||
PowerManager.WakeLock wakeLock;
|
||||
if (hasWakeLockPermission(this.context)) {
|
||||
this.syncWakeLock.acquire(Constants.WAKE_LOCK_ACQUIRE_TIMEOUT_MILLIS);
|
||||
}
|
||||
try {
|
||||
try {
|
||||
try {
|
||||
this.topicsSubscriber.setSyncScheduledOrRunning(true);
|
||||
if (!this.metadata.isGmscorePresent()) {
|
||||
this.topicsSubscriber.setSyncScheduledOrRunning(false);
|
||||
if (!hasWakeLockPermission(this.context)) {
|
||||
return;
|
||||
} else {
|
||||
wakeLock = this.syncWakeLock;
|
||||
}
|
||||
} else if (!hasAccessNetworkStatePermission(this.context) || isDeviceConnected()) {
|
||||
if (this.topicsSubscriber.syncTopics()) {
|
||||
this.topicsSubscriber.setSyncScheduledOrRunning(false);
|
||||
} else {
|
||||
this.topicsSubscriber.syncWithDelaySecondsInternal(this.nextDelaySeconds);
|
||||
}
|
||||
if (!hasWakeLockPermission(this.context)) {
|
||||
return;
|
||||
} else {
|
||||
wakeLock = this.syncWakeLock;
|
||||
}
|
||||
} else {
|
||||
new ConnectivityChangeReceiver(this).registerReceiver();
|
||||
if (!hasWakeLockPermission(this.context)) {
|
||||
return;
|
||||
} else {
|
||||
wakeLock = this.syncWakeLock;
|
||||
}
|
||||
}
|
||||
wakeLock.release();
|
||||
} catch (RuntimeException unused) {
|
||||
Log.i(Constants.TAG, "TopicsSyncTask's wakelock was already released due to timeout.");
|
||||
}
|
||||
} catch (IOException e4) {
|
||||
Log.e(Constants.TAG, "Failed to sync topics. Won't retry sync. " + e4.getMessage());
|
||||
this.topicsSubscriber.setSyncScheduledOrRunning(false);
|
||||
if (hasWakeLockPermission(this.context)) {
|
||||
this.syncWakeLock.release();
|
||||
}
|
||||
}
|
||||
} catch (Throwable th) {
|
||||
if (hasWakeLockPermission(this.context)) {
|
||||
try {
|
||||
this.syncWakeLock.release();
|
||||
} catch (RuntimeException unused2) {
|
||||
Log.i(Constants.TAG, "TopicsSyncTask's wakelock was already released due to timeout.");
|
||||
}
|
||||
}
|
||||
throw th;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,108 @@
|
||||
package com.google.firebase.messaging;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.ComponentName;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import com.google.android.gms.stats.WakeLock;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: package-private */
|
||||
/* loaded from: classes3.dex */
|
||||
public final class WakeLockHolder {
|
||||
private static final String EXTRA_WAKEFUL_INTENT = "com.google.firebase.iid.WakeLockHolder.wakefulintent";
|
||||
static final long WAKE_LOCK_ACQUIRE_TIMEOUT_MILLIS = TimeUnit.MINUTES.toMillis(1);
|
||||
private static final Object syncObject = new Object();
|
||||
private static WakeLock wakeLock;
|
||||
|
||||
public static void acquireWakeLock(Intent intent, long j4) {
|
||||
synchronized (syncObject) {
|
||||
try {
|
||||
if (wakeLock != null) {
|
||||
setAsWakefulIntent(intent, true);
|
||||
wakeLock.acquire(j4);
|
||||
}
|
||||
} catch (Throwable th) {
|
||||
throw th;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void checkAndInitWakeLock(Context context) {
|
||||
if (wakeLock == null) {
|
||||
WakeLock wakeLock2 = new WakeLock(context, 1, "wake:com.google.firebase.iid.WakeLockHolder");
|
||||
wakeLock = wakeLock2;
|
||||
wakeLock2.setReferenceCounted(true);
|
||||
}
|
||||
}
|
||||
|
||||
public static void completeWakefulIntent(Intent intent) {
|
||||
synchronized (syncObject) {
|
||||
try {
|
||||
if (wakeLock != null && isWakefulIntent(intent)) {
|
||||
setAsWakefulIntent(intent, false);
|
||||
wakeLock.release();
|
||||
}
|
||||
} catch (Throwable th) {
|
||||
throw th;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void initWakeLock(Context context) {
|
||||
synchronized (syncObject) {
|
||||
checkAndInitWakeLock(context);
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean isWakefulIntent(Intent intent) {
|
||||
return intent.getBooleanExtra(EXTRA_WAKEFUL_INTENT, false);
|
||||
}
|
||||
|
||||
public static void reset() {
|
||||
synchronized (syncObject) {
|
||||
wakeLock = null;
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressLint({"TaskMainThread"})
|
||||
public static void sendWakefulServiceIntent(Context context, WithinAppServiceConnection withinAppServiceConnection, Intent intent) {
|
||||
synchronized (syncObject) {
|
||||
try {
|
||||
checkAndInitWakeLock(context);
|
||||
boolean isWakefulIntent = isWakefulIntent(intent);
|
||||
setAsWakefulIntent(intent, true);
|
||||
if (!isWakefulIntent) {
|
||||
wakeLock.acquire(WAKE_LOCK_ACQUIRE_TIMEOUT_MILLIS);
|
||||
}
|
||||
withinAppServiceConnection.sendIntent(intent).addOnCompleteListener(new p(intent, 0));
|
||||
} catch (Throwable th) {
|
||||
throw th;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void setAsWakefulIntent(Intent intent, boolean z3) {
|
||||
intent.putExtra(EXTRA_WAKEFUL_INTENT, z3);
|
||||
}
|
||||
|
||||
public static ComponentName startWakefulService(Context context, Intent intent) {
|
||||
synchronized (syncObject) {
|
||||
try {
|
||||
checkAndInitWakeLock(context);
|
||||
boolean isWakefulIntent = isWakefulIntent(intent);
|
||||
setAsWakefulIntent(intent, true);
|
||||
ComponentName startService = context.startService(intent);
|
||||
if (startService == null) {
|
||||
return null;
|
||||
}
|
||||
if (!isWakefulIntent) {
|
||||
wakeLock.acquire(WAKE_LOCK_ACQUIRE_TIMEOUT_MILLIS);
|
||||
}
|
||||
return startService;
|
||||
} catch (Throwable th) {
|
||||
throw th;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package com.google.firebase.messaging;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.os.Binder;
|
||||
import android.os.Process;
|
||||
import android.util.Log;
|
||||
import com.google.android.gms.tasks.Task;
|
||||
import com.google.firebase.messaging.WithinAppServiceConnection;
|
||||
import n.ExecutorC0507a;
|
||||
|
||||
/* loaded from: classes3.dex */
|
||||
public class WithinAppServiceBinder extends Binder {
|
||||
private final IntentHandler intentHandler;
|
||||
|
||||
/* loaded from: classes3.dex */
|
||||
public interface IntentHandler {
|
||||
Task<Void> handle(Intent intent);
|
||||
}
|
||||
|
||||
public WithinAppServiceBinder(IntentHandler intentHandler) {
|
||||
this.intentHandler = intentHandler;
|
||||
}
|
||||
|
||||
public void send(WithinAppServiceConnection.BindRequest bindRequest) {
|
||||
if (Binder.getCallingUid() != Process.myUid()) {
|
||||
throw new SecurityException("Binding only allowed within app");
|
||||
}
|
||||
if (Log.isLoggable(Constants.TAG, 3)) {
|
||||
Log.d(Constants.TAG, "service received new intent via bind strategy");
|
||||
}
|
||||
this.intentHandler.handle(bindRequest.intent).addOnCompleteListener(new ExecutorC0507a(1), new p(bindRequest, 1));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,165 @@
|
||||
package com.google.firebase.messaging;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.ComponentName;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.ServiceConnection;
|
||||
import android.os.IBinder;
|
||||
import android.util.Log;
|
||||
import com.google.android.gms.common.stats.ConnectionTracker;
|
||||
import com.google.android.gms.common.util.concurrent.NamedThreadFactory;
|
||||
import com.google.android.gms.tasks.Task;
|
||||
import com.google.android.gms.tasks.TaskCompletionSource;
|
||||
import java.util.ArrayDeque;
|
||||
import java.util.Queue;
|
||||
import java.util.concurrent.ScheduledExecutorService;
|
||||
import java.util.concurrent.ScheduledThreadPoolExecutor;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: package-private */
|
||||
/* loaded from: classes3.dex */
|
||||
public class WithinAppServiceConnection implements ServiceConnection {
|
||||
private WithinAppServiceBinder binder;
|
||||
private boolean connectionInProgress;
|
||||
private final Intent connectionIntent;
|
||||
private final Context context;
|
||||
private final Queue<BindRequest> intentQueue;
|
||||
private final ScheduledExecutorService scheduledExecutorService;
|
||||
|
||||
/* loaded from: classes3.dex */
|
||||
public static class BindRequest {
|
||||
final Intent intent;
|
||||
private final TaskCompletionSource<Void> taskCompletionSource = new TaskCompletionSource<>();
|
||||
|
||||
public BindRequest(Intent intent) {
|
||||
this.intent = intent;
|
||||
}
|
||||
|
||||
public /* synthetic */ void lambda$arrangeTimeout$0() {
|
||||
Log.w(Constants.TAG, "Service took too long to process intent: " + this.intent.getAction() + " finishing.");
|
||||
finish();
|
||||
}
|
||||
|
||||
public void arrangeTimeout(ScheduledExecutorService scheduledExecutorService) {
|
||||
getTask().addOnCompleteListener(scheduledExecutorService, new p(scheduledExecutorService.schedule(new n(this, 1), 20L, TimeUnit.SECONDS), 2));
|
||||
}
|
||||
|
||||
public void finish() {
|
||||
this.taskCompletionSource.trySetResult(null);
|
||||
}
|
||||
|
||||
public Task<Void> getTask() {
|
||||
return this.taskCompletionSource.getTask();
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressLint({"ThreadPoolCreation"})
|
||||
public WithinAppServiceConnection(Context context, String str) {
|
||||
this(context, str, new ScheduledThreadPoolExecutor(0, new NamedThreadFactory("Firebase-FirebaseInstanceIdServiceConnection")));
|
||||
}
|
||||
|
||||
private void finishAllInQueue() {
|
||||
while (!this.intentQueue.isEmpty()) {
|
||||
this.intentQueue.poll().finish();
|
||||
}
|
||||
}
|
||||
|
||||
private synchronized void flushQueue() {
|
||||
try {
|
||||
if (Log.isLoggable(Constants.TAG, 3)) {
|
||||
Log.d(Constants.TAG, "flush queue called");
|
||||
}
|
||||
while (!this.intentQueue.isEmpty()) {
|
||||
if (Log.isLoggable(Constants.TAG, 3)) {
|
||||
Log.d(Constants.TAG, "found intent to be delivered");
|
||||
}
|
||||
WithinAppServiceBinder withinAppServiceBinder = this.binder;
|
||||
if (withinAppServiceBinder == null || !withinAppServiceBinder.isBinderAlive()) {
|
||||
startConnectionIfNeeded();
|
||||
return;
|
||||
}
|
||||
if (Log.isLoggable(Constants.TAG, 3)) {
|
||||
Log.d(Constants.TAG, "binder is alive, sending the intent.");
|
||||
}
|
||||
this.binder.send(this.intentQueue.poll());
|
||||
}
|
||||
} catch (Throwable th) {
|
||||
throw th;
|
||||
}
|
||||
}
|
||||
|
||||
private void startConnectionIfNeeded() {
|
||||
if (Log.isLoggable(Constants.TAG, 3)) {
|
||||
StringBuilder sb = new StringBuilder("binder is dead. start connection? ");
|
||||
sb.append(!this.connectionInProgress);
|
||||
Log.d(Constants.TAG, sb.toString());
|
||||
}
|
||||
if (this.connectionInProgress) {
|
||||
return;
|
||||
}
|
||||
this.connectionInProgress = true;
|
||||
try {
|
||||
} catch (SecurityException e4) {
|
||||
Log.e(Constants.TAG, "Exception while binding the service", e4);
|
||||
}
|
||||
if (ConnectionTracker.getInstance().bindService(this.context, this.connectionIntent, this, 65)) {
|
||||
return;
|
||||
}
|
||||
Log.e(Constants.TAG, "binding to the service failed");
|
||||
this.connectionInProgress = false;
|
||||
finishAllInQueue();
|
||||
}
|
||||
|
||||
@Override // android.content.ServiceConnection
|
||||
public synchronized void onServiceConnected(ComponentName componentName, IBinder iBinder) {
|
||||
try {
|
||||
if (Log.isLoggable(Constants.TAG, 3)) {
|
||||
Log.d(Constants.TAG, "onServiceConnected: " + componentName);
|
||||
}
|
||||
this.connectionInProgress = false;
|
||||
if (iBinder instanceof WithinAppServiceBinder) {
|
||||
this.binder = (WithinAppServiceBinder) iBinder;
|
||||
flushQueue();
|
||||
} else {
|
||||
Log.e(Constants.TAG, "Invalid service connection: " + iBinder);
|
||||
finishAllInQueue();
|
||||
}
|
||||
} catch (Throwable th) {
|
||||
throw th;
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.content.ServiceConnection
|
||||
public void onServiceDisconnected(ComponentName componentName) {
|
||||
if (Log.isLoggable(Constants.TAG, 3)) {
|
||||
Log.d(Constants.TAG, "onServiceDisconnected: " + componentName);
|
||||
}
|
||||
flushQueue();
|
||||
}
|
||||
|
||||
public synchronized Task<Void> sendIntent(Intent intent) {
|
||||
BindRequest bindRequest;
|
||||
try {
|
||||
if (Log.isLoggable(Constants.TAG, 3)) {
|
||||
Log.d(Constants.TAG, "new intent queued in the bind-strategy delivery");
|
||||
}
|
||||
bindRequest = new BindRequest(intent);
|
||||
bindRequest.arrangeTimeout(this.scheduledExecutorService);
|
||||
this.intentQueue.add(bindRequest);
|
||||
flushQueue();
|
||||
} catch (Throwable th) {
|
||||
throw th;
|
||||
}
|
||||
return bindRequest.getTask();
|
||||
}
|
||||
|
||||
public WithinAppServiceConnection(Context context, String str, ScheduledExecutorService scheduledExecutorService) {
|
||||
this.intentQueue = new ArrayDeque();
|
||||
this.connectionInProgress = false;
|
||||
Context applicationContext = context.getApplicationContext();
|
||||
this.context = applicationContext;
|
||||
this.connectionIntent = new Intent(str).setPackage(applicationContext.getPackageName());
|
||||
this.scheduledExecutorService = scheduledExecutorService;
|
||||
}
|
||||
}
|
||||
36
apk_decompiled/sources/com/google/firebase/messaging/e.java
Normal file
36
apk_decompiled/sources/com/google/firebase/messaging/e.java
Normal file
@@ -0,0 +1,36 @@
|
||||
package com.google.firebase.messaging;
|
||||
|
||||
import com.google.android.gms.tasks.SuccessContinuation;
|
||||
import com.google.android.gms.tasks.Task;
|
||||
|
||||
/* loaded from: classes3.dex */
|
||||
public final /* synthetic */ class e implements SuccessContinuation {
|
||||
|
||||
/* renamed from: a, reason: collision with root package name */
|
||||
public final /* synthetic */ int f6005a;
|
||||
|
||||
/* renamed from: b, reason: collision with root package name */
|
||||
public final /* synthetic */ String f6006b;
|
||||
|
||||
public /* synthetic */ e(String str, int i) {
|
||||
this.f6005a = i;
|
||||
this.f6006b = str;
|
||||
}
|
||||
|
||||
@Override // com.google.android.gms.tasks.SuccessContinuation
|
||||
public final Task then(Object obj) {
|
||||
Task lambda$subscribeToTopic$7;
|
||||
Task lambda$unsubscribeFromTopic$8;
|
||||
int i = this.f6005a;
|
||||
String str = this.f6006b;
|
||||
TopicsSubscriber topicsSubscriber = (TopicsSubscriber) obj;
|
||||
switch (i) {
|
||||
case 0:
|
||||
lambda$subscribeToTopic$7 = FirebaseMessaging.lambda$subscribeToTopic$7(str, topicsSubscriber);
|
||||
return lambda$subscribeToTopic$7;
|
||||
default:
|
||||
lambda$unsubscribeFromTopic$8 = FirebaseMessaging.lambda$unsubscribeFromTopic$8(str, topicsSubscriber);
|
||||
return lambda$unsubscribeFromTopic$8;
|
||||
}
|
||||
}
|
||||
}
|
||||
39
apk_decompiled/sources/com/google/firebase/messaging/f.java
Normal file
39
apk_decompiled/sources/com/google/firebase/messaging/f.java
Normal file
@@ -0,0 +1,39 @@
|
||||
package com.google.firebase.messaging;
|
||||
|
||||
import com.google.android.gms.tasks.SuccessContinuation;
|
||||
import com.google.android.gms.tasks.Task;
|
||||
import com.google.firebase.messaging.RequestDeduplicator;
|
||||
import com.google.firebase.messaging.Store;
|
||||
|
||||
/* loaded from: classes3.dex */
|
||||
public final /* synthetic */ class f implements SuccessContinuation, RequestDeduplicator.GetTokenRequest {
|
||||
|
||||
/* renamed from: a, reason: collision with root package name */
|
||||
public final /* synthetic */ FirebaseMessaging f6007a;
|
||||
|
||||
/* renamed from: b, reason: collision with root package name */
|
||||
public final /* synthetic */ String f6008b;
|
||||
|
||||
/* renamed from: c, reason: collision with root package name */
|
||||
public final /* synthetic */ Store.Token f6009c;
|
||||
|
||||
public /* synthetic */ f(FirebaseMessaging firebaseMessaging, String str, Store.Token token) {
|
||||
this.f6007a = firebaseMessaging;
|
||||
this.f6008b = str;
|
||||
this.f6009c = token;
|
||||
}
|
||||
|
||||
@Override // com.google.firebase.messaging.RequestDeduplicator.GetTokenRequest
|
||||
public Task start() {
|
||||
Task lambda$blockingGetToken$10;
|
||||
lambda$blockingGetToken$10 = this.f6007a.lambda$blockingGetToken$10(this.f6008b, this.f6009c);
|
||||
return lambda$blockingGetToken$10;
|
||||
}
|
||||
|
||||
@Override // com.google.android.gms.tasks.SuccessContinuation
|
||||
public Task then(Object obj) {
|
||||
Task lambda$blockingGetToken$9;
|
||||
lambda$blockingGetToken$9 = this.f6007a.lambda$blockingGetToken$9(this.f6008b, this.f6009c, (String) obj);
|
||||
return lambda$blockingGetToken$9;
|
||||
}
|
||||
}
|
||||
40
apk_decompiled/sources/com/google/firebase/messaging/i.java
Normal file
40
apk_decompiled/sources/com/google/firebase/messaging/i.java
Normal file
@@ -0,0 +1,40 @@
|
||||
package com.google.firebase.messaging;
|
||||
|
||||
import com.google.android.gms.tasks.TaskCompletionSource;
|
||||
|
||||
/* loaded from: classes3.dex */
|
||||
public final /* synthetic */ class i implements Runnable {
|
||||
|
||||
/* renamed from: a, reason: collision with root package name */
|
||||
public final /* synthetic */ int f6013a;
|
||||
|
||||
/* renamed from: b, reason: collision with root package name */
|
||||
public final /* synthetic */ Object f6014b;
|
||||
|
||||
/* renamed from: c, reason: collision with root package name */
|
||||
public final /* synthetic */ TaskCompletionSource f6015c;
|
||||
|
||||
public /* synthetic */ i(Object obj, TaskCompletionSource taskCompletionSource, int i) {
|
||||
this.f6013a = i;
|
||||
this.f6014b = obj;
|
||||
this.f6015c = taskCompletionSource;
|
||||
}
|
||||
|
||||
@Override // java.lang.Runnable
|
||||
public final void run() {
|
||||
switch (this.f6013a) {
|
||||
case 0:
|
||||
FirebaseMessaging.a((FirebaseMessaging) this.f6014b, this.f6015c);
|
||||
return;
|
||||
case 1:
|
||||
FirebaseMessaging.c((FirebaseMessaging) this.f6014b, this.f6015c);
|
||||
return;
|
||||
case 2:
|
||||
FirebaseMessaging.d((FirebaseMessaging) this.f6014b, this.f6015c);
|
||||
return;
|
||||
default:
|
||||
ImageDownload.d((ImageDownload) this.f6014b, this.f6015c);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
26
apk_decompiled/sources/com/google/firebase/messaging/k.java
Normal file
26
apk_decompiled/sources/com/google/firebase/messaging/k.java
Normal file
@@ -0,0 +1,26 @@
|
||||
package com.google.firebase.messaging;
|
||||
|
||||
import com.google.android.gms.tasks.Continuation;
|
||||
import com.google.android.gms.tasks.Task;
|
||||
import com.google.firebase.iid.internal.FirebaseInstanceIdInternal;
|
||||
|
||||
/* loaded from: classes3.dex */
|
||||
public final /* synthetic */ class k implements Continuation, FirebaseInstanceIdInternal.NewTokenListener {
|
||||
|
||||
/* renamed from: a, reason: collision with root package name */
|
||||
public final /* synthetic */ Object f6017a;
|
||||
|
||||
public /* synthetic */ k(Object obj) {
|
||||
this.f6017a = obj;
|
||||
}
|
||||
|
||||
@Override // com.google.firebase.iid.internal.FirebaseInstanceIdInternal.NewTokenListener
|
||||
public void onNewToken(String str) {
|
||||
((FirebaseMessaging) this.f6017a).lambda$new$0(str);
|
||||
}
|
||||
|
||||
@Override // com.google.android.gms.tasks.Continuation
|
||||
public Object then(Task task) {
|
||||
return GmsRpc.a((GmsRpc) this.f6017a, task);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package com.google.firebase.messaging.ktx;
|
||||
|
||||
/* loaded from: classes3.dex */
|
||||
public final class BuildConfig {
|
||||
public static final String BUILD_TYPE = "release";
|
||||
public static final boolean DEBUG = false;
|
||||
public static final String LIBRARY_PACKAGE_NAME = "com.google.firebase.messaging.ktx";
|
||||
public static final String VERSION_NAME = "unspecified";
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.google.firebase.messaging.ktx;
|
||||
|
||||
import com.google.firebase.components.Component;
|
||||
import com.google.firebase.components.ComponentRegistrar;
|
||||
import java.util.List;
|
||||
import kotlin.Deprecated;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.ReplaceWith;
|
||||
import kotlin.collections.CollectionsKt;
|
||||
|
||||
@Deprecated(message = "Migrate to use the KTX API from the main module: https://firebase.google.com/docs/android/kotlin-migration.", replaceWith = @ReplaceWith(expression = "", imports = {}))
|
||||
@Metadata(d1 = {"\u0000\u0016\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010 \n\u0002\u0018\u0002\n\u0000\b\u0007\u0018\u00002\u00020\u0001B\u0005¢\u0006\u0002\u0010\u0002J\u0012\u0010\u0003\u001a\f\u0012\b\u0012\u0006\u0012\u0002\b\u00030\u00050\u0004H\u0016¨\u0006\u0006"}, d2 = {"Lcom/google/firebase/messaging/ktx/FirebaseMessagingKtxRegistrar;", "Lcom/google/firebase/components/ComponentRegistrar;", "()V", "getComponents", "", "Lcom/google/firebase/components/Component;", "com.google.firebase-firebase-messaging"}, k = 1, mv = {1, 7, 1}, xi = 48)
|
||||
/* loaded from: classes3.dex */
|
||||
public final class FirebaseMessagingKtxRegistrar implements ComponentRegistrar {
|
||||
@Override // com.google.firebase.components.ComponentRegistrar
|
||||
public List<Component<?>> getComponents() {
|
||||
return CollectionsKt.emptyList();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.google.firebase.messaging.ktx;
|
||||
|
||||
import androidx.annotation.Keep;
|
||||
import com.google.firebase.components.Component;
|
||||
import com.google.firebase.components.ComponentRegistrar;
|
||||
import com.google.firebase.platforminfo.LibraryVersionComponent;
|
||||
import java.util.List;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.collections.CollectionsKt;
|
||||
|
||||
@Keep
|
||||
@Metadata(d1 = {"\u0000\u0016\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010 \n\u0002\u0018\u0002\n\u0000\b\u0007\u0018\u00002\u00020\u0001B\u0005¢\u0006\u0002\u0010\u0002J\u0012\u0010\u0003\u001a\f\u0012\b\u0012\u0006\u0012\u0002\b\u00030\u00050\u0004H\u0016¨\u0006\u0006"}, d2 = {"Lcom/google/firebase/messaging/ktx/FirebaseMessagingLegacyRegistrar;", "Lcom/google/firebase/components/ComponentRegistrar;", "()V", "getComponents", "", "Lcom/google/firebase/components/Component;", "com.google.firebase-firebase-messaging-ktx"}, k = 1, mv = {1, 7, 1}, xi = 48)
|
||||
/* loaded from: classes3.dex */
|
||||
public final class FirebaseMessagingLegacyRegistrar implements ComponentRegistrar {
|
||||
@Override // com.google.firebase.components.ComponentRegistrar
|
||||
public List<Component<?>> getComponents() {
|
||||
return CollectionsKt.listOf(LibraryVersionComponent.create(LoggingKt.LIBRARY_NAME, com.google.firebase.messaging.BuildConfig.VERSION_NAME));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package com.google.firebase.messaging.ktx;
|
||||
|
||||
import kotlin.Metadata;
|
||||
|
||||
@Metadata(d1 = {"\u0000\b\n\u0000\n\u0002\u0010\u000e\n\u0000\"\u000e\u0010\u0000\u001a\u00020\u0001X\u0080T¢\u0006\u0002\n\u0000¨\u0006\u0002"}, d2 = {"LIBRARY_NAME", "", "com.google.firebase-firebase-messaging-ktx"}, k = 2, mv = {1, 7, 1}, xi = 48)
|
||||
/* loaded from: classes3.dex */
|
||||
public final class LoggingKt {
|
||||
public static final String LIBRARY_NAME = "fire-fcm-ktx";
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package com.google.firebase.messaging.ktx;
|
||||
|
||||
import com.google.firebase.ktx.Firebase;
|
||||
import com.google.firebase.messaging.FirebaseMessaging;
|
||||
import com.google.firebase.messaging.RemoteMessage;
|
||||
import kotlin.Deprecated;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.ReplaceWith;
|
||||
import kotlin.Unit;
|
||||
import kotlin.jvm.functions.Function1;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
|
||||
@Metadata(d1 = {"\u0000,\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u000e\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0010\u0002\n\u0002\u0018\u0002\n\u0000\u001a/\u0010\u0005\u001a\u00020\u00062\u0006\u0010\u0007\u001a\u00020\b2\u0019\b\u0004\u0010\t\u001a\u0013\u0012\u0004\u0012\u00020\u000b\u0012\u0004\u0012\u00020\f0\n¢\u0006\u0002\b\rH\u0087\bø\u0001\u0000\"\u0015\u0010\u0000\u001a\u00020\u0001*\u00020\u00028F¢\u0006\u0006\u001a\u0004\b\u0003\u0010\u0004\u0082\u0002\u0007\n\u0005\b\u009920\u0001¨\u0006\u000e"}, d2 = {"messaging", "Lcom/google/firebase/messaging/FirebaseMessaging;", "Lcom/google/firebase/ktx/Firebase;", "getMessaging", "(Lcom/google/firebase/ktx/Firebase;)Lcom/google/firebase/messaging/FirebaseMessaging;", "remoteMessage", "Lcom/google/firebase/messaging/RemoteMessage;", "to", "", "init", "Lkotlin/Function1;", "Lcom/google/firebase/messaging/RemoteMessage$Builder;", "", "Lkotlin/ExtensionFunctionType;", "com.google.firebase-firebase-messaging"}, k = 2, mv = {1, 7, 1}, xi = 48)
|
||||
/* loaded from: classes3.dex */
|
||||
public final class MessagingKt {
|
||||
public static final FirebaseMessaging getMessaging(Firebase firebase) {
|
||||
Intrinsics.checkNotNullParameter(firebase, "<this>");
|
||||
FirebaseMessaging firebaseMessaging = FirebaseMessaging.getInstance();
|
||||
Intrinsics.checkNotNullExpressionValue(firebaseMessaging, "getInstance()");
|
||||
return firebaseMessaging;
|
||||
}
|
||||
|
||||
@Deprecated(message = "Migrate to use the KTX API from the main module: https://firebase.google.com/docs/android/kotlin-migration.", replaceWith = @ReplaceWith(expression = "", imports = {}))
|
||||
public static final RemoteMessage remoteMessage(String to, Function1<? super RemoteMessage.Builder, Unit> init) {
|
||||
Intrinsics.checkNotNullParameter(to, "to");
|
||||
Intrinsics.checkNotNullParameter(init, "init");
|
||||
RemoteMessage.Builder builder = new RemoteMessage.Builder(to);
|
||||
init.invoke(builder);
|
||||
RemoteMessage build = builder.build();
|
||||
Intrinsics.checkNotNullExpressionValue(build, "builder.build()");
|
||||
return build;
|
||||
}
|
||||
}
|
||||
362
apk_decompiled/sources/com/google/firebase/messaging/ktx/R.java
Normal file
362
apk_decompiled/sources/com/google/firebase/messaging/ktx/R.java
Normal file
@@ -0,0 +1,362 @@
|
||||
package com.google.firebase.messaging.ktx;
|
||||
|
||||
/* loaded from: classes3.dex */
|
||||
public final class R {
|
||||
|
||||
/* loaded from: classes3.dex */
|
||||
public static final class attr {
|
||||
public static final int alpha = 0x7f030031;
|
||||
public static final int buttonSize = 0x7f0300a5;
|
||||
public static final int circleCrop = 0x7f0300e9;
|
||||
public static final int colorScheme = 0x7f030135;
|
||||
public static final int coordinatorLayoutStyle = 0x7f03016c;
|
||||
public static final int font = 0x7f03022d;
|
||||
public static final int fontProviderAuthority = 0x7f03022f;
|
||||
public static final int fontProviderCerts = 0x7f030230;
|
||||
public static final int fontProviderFetchStrategy = 0x7f030231;
|
||||
public static final int fontProviderFetchTimeout = 0x7f030232;
|
||||
public static final int fontProviderPackage = 0x7f030233;
|
||||
public static final int fontProviderQuery = 0x7f030234;
|
||||
public static final int fontStyle = 0x7f030236;
|
||||
public static final int fontVariationSettings = 0x7f030237;
|
||||
public static final int fontWeight = 0x7f030238;
|
||||
public static final int imageAspectRatio = 0x7f030271;
|
||||
public static final int imageAspectRatioAdjust = 0x7f030272;
|
||||
public static final int keylines = 0x7f0302b5;
|
||||
public static final int layout_anchor = 0x7f0302c6;
|
||||
public static final int layout_anchorGravity = 0x7f0302c7;
|
||||
public static final int layout_behavior = 0x7f0302c9;
|
||||
public static final int layout_dodgeInsetEdges = 0x7f0302fa;
|
||||
public static final int layout_insetEdge = 0x7f030305;
|
||||
public static final int layout_keyline = 0x7f030306;
|
||||
public static final int scopeUris = 0x7f03041a;
|
||||
public static final int statusBarBackground = 0x7f030488;
|
||||
public static final int ttcIndex = 0x7f030559;
|
||||
|
||||
private attr() {
|
||||
}
|
||||
}
|
||||
|
||||
/* loaded from: classes3.dex */
|
||||
public static final class color {
|
||||
public static final int common_google_signin_btn_text_dark = 0x7f050045;
|
||||
public static final int common_google_signin_btn_text_dark_default = 0x7f050046;
|
||||
public static final int common_google_signin_btn_text_dark_disabled = 0x7f050047;
|
||||
public static final int common_google_signin_btn_text_dark_focused = 0x7f050048;
|
||||
public static final int common_google_signin_btn_text_dark_pressed = 0x7f050049;
|
||||
public static final int common_google_signin_btn_text_light = 0x7f05004a;
|
||||
public static final int common_google_signin_btn_text_light_default = 0x7f05004b;
|
||||
public static final int common_google_signin_btn_text_light_disabled = 0x7f05004c;
|
||||
public static final int common_google_signin_btn_text_light_focused = 0x7f05004d;
|
||||
public static final int common_google_signin_btn_text_light_pressed = 0x7f05004e;
|
||||
public static final int common_google_signin_btn_tint = 0x7f05004f;
|
||||
public static final int notification_action_color_filter = 0x7f050315;
|
||||
public static final int notification_icon_bg_color = 0x7f050316;
|
||||
public static final int ripple_material_light = 0x7f050322;
|
||||
public static final int secondary_text_default_material_light = 0x7f050324;
|
||||
|
||||
private color() {
|
||||
}
|
||||
}
|
||||
|
||||
/* loaded from: classes3.dex */
|
||||
public static final class dimen {
|
||||
public static final int compat_button_inset_horizontal_material = 0x7f06006d;
|
||||
public static final int compat_button_inset_vertical_material = 0x7f06006e;
|
||||
public static final int compat_button_padding_horizontal_material = 0x7f06006f;
|
||||
public static final int compat_button_padding_vertical_material = 0x7f060070;
|
||||
public static final int compat_control_corner_material = 0x7f060071;
|
||||
public static final int compat_notification_large_icon_max_height = 0x7f060072;
|
||||
public static final int compat_notification_large_icon_max_width = 0x7f060073;
|
||||
public static final int notification_action_icon_size = 0x7f060385;
|
||||
public static final int notification_action_text_size = 0x7f060386;
|
||||
public static final int notification_big_circle_margin = 0x7f060387;
|
||||
public static final int notification_content_margin_start = 0x7f060388;
|
||||
public static final int notification_large_icon_height = 0x7f06038d;
|
||||
public static final int notification_large_icon_width = 0x7f06038e;
|
||||
public static final int notification_main_column_padding_top = 0x7f06038f;
|
||||
public static final int notification_media_narrow_margin = 0x7f060391;
|
||||
public static final int notification_right_icon_size = 0x7f060393;
|
||||
public static final int notification_right_side_padding_top = 0x7f060394;
|
||||
public static final int notification_small_icon_background_padding = 0x7f060395;
|
||||
public static final int notification_small_icon_size_as_large = 0x7f060396;
|
||||
public static final int notification_subtext_size = 0x7f060397;
|
||||
public static final int notification_top_pad = 0x7f06039b;
|
||||
public static final int notification_top_pad_large_text = 0x7f06039c;
|
||||
|
||||
private dimen() {
|
||||
}
|
||||
}
|
||||
|
||||
/* loaded from: classes3.dex */
|
||||
public static final class drawable {
|
||||
public static final int common_full_open_on_phone = 0x7f07008b;
|
||||
public static final int common_google_signin_btn_icon_dark = 0x7f07008c;
|
||||
public static final int common_google_signin_btn_icon_dark_focused = 0x7f07008d;
|
||||
public static final int common_google_signin_btn_icon_dark_normal = 0x7f07008e;
|
||||
public static final int common_google_signin_btn_icon_dark_normal_background = 0x7f07008f;
|
||||
public static final int common_google_signin_btn_icon_disabled = 0x7f070090;
|
||||
public static final int common_google_signin_btn_icon_light = 0x7f070091;
|
||||
public static final int common_google_signin_btn_icon_light_focused = 0x7f070092;
|
||||
public static final int common_google_signin_btn_icon_light_normal = 0x7f070093;
|
||||
public static final int common_google_signin_btn_icon_light_normal_background = 0x7f070094;
|
||||
public static final int common_google_signin_btn_text_dark = 0x7f070095;
|
||||
public static final int common_google_signin_btn_text_dark_focused = 0x7f070096;
|
||||
public static final int common_google_signin_btn_text_dark_normal = 0x7f070097;
|
||||
public static final int common_google_signin_btn_text_dark_normal_background = 0x7f070098;
|
||||
public static final int common_google_signin_btn_text_disabled = 0x7f070099;
|
||||
public static final int common_google_signin_btn_text_light = 0x7f07009a;
|
||||
public static final int common_google_signin_btn_text_light_focused = 0x7f07009b;
|
||||
public static final int common_google_signin_btn_text_light_normal = 0x7f07009c;
|
||||
public static final int common_google_signin_btn_text_light_normal_background = 0x7f07009d;
|
||||
public static final int googleg_disabled_color_18 = 0x7f0700ac;
|
||||
public static final int googleg_standard_color_18 = 0x7f0700ad;
|
||||
public static final int notification_action_background = 0x7f070181;
|
||||
public static final int notification_bg = 0x7f070182;
|
||||
public static final int notification_bg_low = 0x7f070183;
|
||||
public static final int notification_bg_low_normal = 0x7f070184;
|
||||
public static final int notification_bg_low_pressed = 0x7f070185;
|
||||
public static final int notification_bg_normal = 0x7f070186;
|
||||
public static final int notification_bg_normal_pressed = 0x7f070187;
|
||||
public static final int notification_icon_background = 0x7f070188;
|
||||
public static final int notification_template_icon_bg = 0x7f07018a;
|
||||
public static final int notification_template_icon_low_bg = 0x7f07018b;
|
||||
public static final int notification_tile_bg = 0x7f07018c;
|
||||
public static final int notify_panel_notification_icon_bg = 0x7f07018d;
|
||||
|
||||
private drawable() {
|
||||
}
|
||||
}
|
||||
|
||||
/* loaded from: classes3.dex */
|
||||
public static final class id {
|
||||
public static final int accessibility_action_clickable_span = 0x7f090013;
|
||||
public static final int accessibility_custom_action_0 = 0x7f090014;
|
||||
public static final int accessibility_custom_action_1 = 0x7f090015;
|
||||
public static final int accessibility_custom_action_10 = 0x7f090016;
|
||||
public static final int accessibility_custom_action_11 = 0x7f090017;
|
||||
public static final int accessibility_custom_action_12 = 0x7f090018;
|
||||
public static final int accessibility_custom_action_13 = 0x7f090019;
|
||||
public static final int accessibility_custom_action_14 = 0x7f09001a;
|
||||
public static final int accessibility_custom_action_15 = 0x7f09001b;
|
||||
public static final int accessibility_custom_action_16 = 0x7f09001c;
|
||||
public static final int accessibility_custom_action_17 = 0x7f09001d;
|
||||
public static final int accessibility_custom_action_18 = 0x7f09001e;
|
||||
public static final int accessibility_custom_action_19 = 0x7f09001f;
|
||||
public static final int accessibility_custom_action_2 = 0x7f090020;
|
||||
public static final int accessibility_custom_action_20 = 0x7f090021;
|
||||
public static final int accessibility_custom_action_21 = 0x7f090022;
|
||||
public static final int accessibility_custom_action_22 = 0x7f090023;
|
||||
public static final int accessibility_custom_action_23 = 0x7f090024;
|
||||
public static final int accessibility_custom_action_24 = 0x7f090025;
|
||||
public static final int accessibility_custom_action_25 = 0x7f090026;
|
||||
public static final int accessibility_custom_action_26 = 0x7f090027;
|
||||
public static final int accessibility_custom_action_27 = 0x7f090028;
|
||||
public static final int accessibility_custom_action_28 = 0x7f090029;
|
||||
public static final int accessibility_custom_action_29 = 0x7f09002a;
|
||||
public static final int accessibility_custom_action_3 = 0x7f09002b;
|
||||
public static final int accessibility_custom_action_30 = 0x7f09002c;
|
||||
public static final int accessibility_custom_action_31 = 0x7f09002d;
|
||||
public static final int accessibility_custom_action_4 = 0x7f09002e;
|
||||
public static final int accessibility_custom_action_5 = 0x7f09002f;
|
||||
public static final int accessibility_custom_action_6 = 0x7f090030;
|
||||
public static final int accessibility_custom_action_7 = 0x7f090031;
|
||||
public static final int accessibility_custom_action_8 = 0x7f090032;
|
||||
public static final int accessibility_custom_action_9 = 0x7f090033;
|
||||
public static final int action_container = 0x7f090045;
|
||||
public static final int action_divider = 0x7f090048;
|
||||
public static final int action_image = 0x7f09004a;
|
||||
public static final int action_text = 0x7f090051;
|
||||
public static final int actions = 0x7f090052;
|
||||
public static final int adjust_height = 0x7f090058;
|
||||
public static final int adjust_width = 0x7f090059;
|
||||
public static final int async = 0x7f090071;
|
||||
public static final int auto = 0x7f090072;
|
||||
public static final int blocking = 0x7f090082;
|
||||
public static final int bottom = 0x7f090083;
|
||||
public static final int chronometer = 0x7f0900a9;
|
||||
public static final int dark = 0x7f0900ea;
|
||||
public static final int dialog_button = 0x7f09010b;
|
||||
public static final int end = 0x7f090133;
|
||||
public static final int forever = 0x7f090152;
|
||||
public static final int icon = 0x7f090195;
|
||||
public static final int icon_group = 0x7f090196;
|
||||
public static final int icon_only = 0x7f090198;
|
||||
public static final int info = 0x7f0901a9;
|
||||
public static final int italic = 0x7f0901be;
|
||||
public static final int left = 0x7f0901e2;
|
||||
public static final int light = 0x7f0901e7;
|
||||
public static final int line1 = 0x7f0901e9;
|
||||
public static final int line3 = 0x7f0901ea;
|
||||
public static final int none = 0x7f090264;
|
||||
public static final int normal = 0x7f090265;
|
||||
public static final int notification_background = 0x7f090269;
|
||||
public static final int notification_main_column = 0x7f09026a;
|
||||
public static final int notification_main_column_container = 0x7f09026b;
|
||||
public static final int right = 0x7f0902cd;
|
||||
public static final int right_icon = 0x7f0902cf;
|
||||
public static final int right_side = 0x7f0902d0;
|
||||
public static final int standard = 0x7f090321;
|
||||
public static final int start = 0x7f090322;
|
||||
public static final int tag_accessibility_actions = 0x7f09035c;
|
||||
public static final int tag_accessibility_clickable_spans = 0x7f09035d;
|
||||
public static final int tag_accessibility_heading = 0x7f09035e;
|
||||
public static final int tag_accessibility_pane_title = 0x7f09035f;
|
||||
public static final int tag_screen_reader_focusable = 0x7f090363;
|
||||
public static final int tag_transition_group = 0x7f090365;
|
||||
public static final int tag_unhandled_key_event_manager = 0x7f090366;
|
||||
public static final int tag_unhandled_key_listeners = 0x7f090367;
|
||||
public static final int text = 0x7f09036d;
|
||||
public static final int text2 = 0x7f09036e;
|
||||
public static final int time = 0x7f09038e;
|
||||
public static final int title = 0x7f090393;
|
||||
public static final int top = 0x7f0903ac;
|
||||
public static final int wide = 0x7f090401;
|
||||
|
||||
private id() {
|
||||
}
|
||||
}
|
||||
|
||||
/* loaded from: classes3.dex */
|
||||
public static final class integer {
|
||||
public static final int google_play_services_version = 0x7f0a0009;
|
||||
public static final int status_bar_notification_info_maxnum = 0x7f0a0045;
|
||||
|
||||
private integer() {
|
||||
}
|
||||
}
|
||||
|
||||
/* loaded from: classes3.dex */
|
||||
public static final class layout {
|
||||
public static final int custom_dialog = 0x7f0c0026;
|
||||
public static final int notification_action = 0x7f0c00a8;
|
||||
public static final int notification_action_tombstone = 0x7f0c00a9;
|
||||
public static final int notification_template_custom_big = 0x7f0c00aa;
|
||||
public static final int notification_template_icon_group = 0x7f0c00ab;
|
||||
public static final int notification_template_part_chronometer = 0x7f0c00ac;
|
||||
public static final int notification_template_part_time = 0x7f0c00ad;
|
||||
|
||||
private layout() {
|
||||
}
|
||||
}
|
||||
|
||||
/* loaded from: classes3.dex */
|
||||
public static final class raw {
|
||||
public static final int firebase_common_keep = 0x7f120000;
|
||||
|
||||
private raw() {
|
||||
}
|
||||
}
|
||||
|
||||
/* loaded from: classes3.dex */
|
||||
public static final class string {
|
||||
public static final int common_google_play_services_enable_button = 0x7f1300b4;
|
||||
public static final int common_google_play_services_enable_text = 0x7f1300b5;
|
||||
public static final int common_google_play_services_enable_title = 0x7f1300b6;
|
||||
public static final int common_google_play_services_install_button = 0x7f1300b7;
|
||||
public static final int common_google_play_services_install_text = 0x7f1300b8;
|
||||
public static final int common_google_play_services_install_title = 0x7f1300b9;
|
||||
public static final int common_google_play_services_notification_channel_name = 0x7f1300ba;
|
||||
public static final int common_google_play_services_notification_ticker = 0x7f1300bb;
|
||||
public static final int common_google_play_services_unknown_issue = 0x7f1300bc;
|
||||
public static final int common_google_play_services_unsupported_text = 0x7f1300bd;
|
||||
public static final int common_google_play_services_update_button = 0x7f1300be;
|
||||
public static final int common_google_play_services_update_text = 0x7f1300bf;
|
||||
public static final int common_google_play_services_update_title = 0x7f1300c0;
|
||||
public static final int common_google_play_services_updating_text = 0x7f1300c1;
|
||||
public static final int common_google_play_services_wear_update_text = 0x7f1300c2;
|
||||
public static final int common_open_on_phone = 0x7f1300c4;
|
||||
public static final int common_signin_button_text = 0x7f1300c5;
|
||||
public static final int common_signin_button_text_long = 0x7f1300c6;
|
||||
public static final int fcm_fallback_notification_channel_label = 0x7f130134;
|
||||
public static final int status_bar_notification_info_overflow = 0x7f13023b;
|
||||
|
||||
private string() {
|
||||
}
|
||||
}
|
||||
|
||||
/* loaded from: classes3.dex */
|
||||
public static final class style {
|
||||
public static final int TextAppearance_Compat_Notification = 0x7f1401fb;
|
||||
public static final int TextAppearance_Compat_Notification_Info = 0x7f1401fc;
|
||||
public static final int TextAppearance_Compat_Notification_Line2 = 0x7f1401fd;
|
||||
public static final int TextAppearance_Compat_Notification_Time = 0x7f1401fe;
|
||||
public static final int TextAppearance_Compat_Notification_Title = 0x7f1401ff;
|
||||
public static final int Widget_Compat_NotificationActionContainer = 0x7f1403a1;
|
||||
public static final int Widget_Compat_NotificationActionText = 0x7f1403a2;
|
||||
public static final int Widget_Support_CoordinatorLayout = 0x7f1404d7;
|
||||
|
||||
private style() {
|
||||
}
|
||||
}
|
||||
|
||||
/* loaded from: classes3.dex */
|
||||
public static final class styleable {
|
||||
public static final int ColorStateListItem_alpha = 0x00000003;
|
||||
public static final int ColorStateListItem_android_alpha = 0x00000001;
|
||||
public static final int ColorStateListItem_android_color = 0x00000000;
|
||||
public static final int ColorStateListItem_android_lStar = 0x00000002;
|
||||
public static final int ColorStateListItem_lStar = 0x00000004;
|
||||
public static final int CoordinatorLayout_Layout_android_layout_gravity = 0x00000000;
|
||||
public static final int CoordinatorLayout_Layout_layout_anchor = 0x00000001;
|
||||
public static final int CoordinatorLayout_Layout_layout_anchorGravity = 0x00000002;
|
||||
public static final int CoordinatorLayout_Layout_layout_behavior = 0x00000003;
|
||||
public static final int CoordinatorLayout_Layout_layout_dodgeInsetEdges = 0x00000004;
|
||||
public static final int CoordinatorLayout_Layout_layout_insetEdge = 0x00000005;
|
||||
public static final int CoordinatorLayout_Layout_layout_keyline = 0x00000006;
|
||||
public static final int CoordinatorLayout_keylines = 0x00000000;
|
||||
public static final int CoordinatorLayout_statusBarBackground = 0x00000001;
|
||||
public static final int FontFamilyFont_android_font = 0x00000000;
|
||||
public static final int FontFamilyFont_android_fontStyle = 0x00000002;
|
||||
public static final int FontFamilyFont_android_fontVariationSettings = 0x00000004;
|
||||
public static final int FontFamilyFont_android_fontWeight = 0x00000001;
|
||||
public static final int FontFamilyFont_android_ttcIndex = 0x00000003;
|
||||
public static final int FontFamilyFont_font = 0x00000005;
|
||||
public static final int FontFamilyFont_fontStyle = 0x00000006;
|
||||
public static final int FontFamilyFont_fontVariationSettings = 0x00000007;
|
||||
public static final int FontFamilyFont_fontWeight = 0x00000008;
|
||||
public static final int FontFamilyFont_ttcIndex = 0x00000009;
|
||||
public static final int FontFamily_fontProviderAuthority = 0x00000000;
|
||||
public static final int FontFamily_fontProviderCerts = 0x00000001;
|
||||
public static final int FontFamily_fontProviderFetchStrategy = 0x00000002;
|
||||
public static final int FontFamily_fontProviderFetchTimeout = 0x00000003;
|
||||
public static final int FontFamily_fontProviderPackage = 0x00000004;
|
||||
public static final int FontFamily_fontProviderQuery = 0x00000005;
|
||||
public static final int FontFamily_fontProviderSystemFontFamily = 0x00000006;
|
||||
public static final int GradientColorItem_android_color = 0x00000000;
|
||||
public static final int GradientColorItem_android_offset = 0x00000001;
|
||||
public static final int GradientColor_android_centerColor = 0x00000007;
|
||||
public static final int GradientColor_android_centerX = 0x00000003;
|
||||
public static final int GradientColor_android_centerY = 0x00000004;
|
||||
public static final int GradientColor_android_endColor = 0x00000001;
|
||||
public static final int GradientColor_android_endX = 0x0000000a;
|
||||
public static final int GradientColor_android_endY = 0x0000000b;
|
||||
public static final int GradientColor_android_gradientRadius = 0x00000005;
|
||||
public static final int GradientColor_android_startColor = 0x00000000;
|
||||
public static final int GradientColor_android_startX = 0x00000008;
|
||||
public static final int GradientColor_android_startY = 0x00000009;
|
||||
public static final int GradientColor_android_tileMode = 0x00000006;
|
||||
public static final int GradientColor_android_type = 0x00000002;
|
||||
public static final int LoadingImageView_circleCrop = 0x00000000;
|
||||
public static final int LoadingImageView_imageAspectRatio = 0x00000001;
|
||||
public static final int LoadingImageView_imageAspectRatioAdjust = 0x00000002;
|
||||
public static final int SignInButton_buttonSize = 0x00000000;
|
||||
public static final int SignInButton_colorScheme = 0x00000001;
|
||||
public static final int SignInButton_scopeUris = 0x00000002;
|
||||
public static final int[] ColorStateListItem = {android.R.attr.color, android.R.attr.alpha, 16844359, com.adif.elcanomovil.R.attr.alpha, com.adif.elcanomovil.R.attr.lStar};
|
||||
public static final int[] CoordinatorLayout = {com.adif.elcanomovil.R.attr.keylines, com.adif.elcanomovil.R.attr.statusBarBackground};
|
||||
public static final int[] CoordinatorLayout_Layout = {android.R.attr.layout_gravity, com.adif.elcanomovil.R.attr.layout_anchor, com.adif.elcanomovil.R.attr.layout_anchorGravity, com.adif.elcanomovil.R.attr.layout_behavior, com.adif.elcanomovil.R.attr.layout_dodgeInsetEdges, com.adif.elcanomovil.R.attr.layout_insetEdge, com.adif.elcanomovil.R.attr.layout_keyline};
|
||||
public static final int[] FontFamily = {com.adif.elcanomovil.R.attr.fontProviderAuthority, com.adif.elcanomovil.R.attr.fontProviderCerts, com.adif.elcanomovil.R.attr.fontProviderFetchStrategy, com.adif.elcanomovil.R.attr.fontProviderFetchTimeout, com.adif.elcanomovil.R.attr.fontProviderPackage, com.adif.elcanomovil.R.attr.fontProviderQuery, com.adif.elcanomovil.R.attr.fontProviderSystemFontFamily};
|
||||
public static final int[] FontFamilyFont = {android.R.attr.font, android.R.attr.fontWeight, android.R.attr.fontStyle, android.R.attr.ttcIndex, android.R.attr.fontVariationSettings, com.adif.elcanomovil.R.attr.font, com.adif.elcanomovil.R.attr.fontStyle, com.adif.elcanomovil.R.attr.fontVariationSettings, com.adif.elcanomovil.R.attr.fontWeight, com.adif.elcanomovil.R.attr.ttcIndex};
|
||||
public static final int[] GradientColor = {android.R.attr.startColor, android.R.attr.endColor, android.R.attr.type, android.R.attr.centerX, android.R.attr.centerY, android.R.attr.gradientRadius, android.R.attr.tileMode, android.R.attr.centerColor, android.R.attr.startX, android.R.attr.startY, android.R.attr.endX, android.R.attr.endY};
|
||||
public static final int[] GradientColorItem = {android.R.attr.color, android.R.attr.offset};
|
||||
public static final int[] LoadingImageView = {com.adif.elcanomovil.R.attr.circleCrop, com.adif.elcanomovil.R.attr.imageAspectRatio, com.adif.elcanomovil.R.attr.imageAspectRatioAdjust};
|
||||
public static final int[] SignInButton = {com.adif.elcanomovil.R.attr.buttonSize, com.adif.elcanomovil.R.attr.colorScheme, com.adif.elcanomovil.R.attr.scopeUris};
|
||||
|
||||
private styleable() {
|
||||
}
|
||||
}
|
||||
|
||||
private R() {
|
||||
}
|
||||
}
|
||||
32
apk_decompiled/sources/com/google/firebase/messaging/n.java
Normal file
32
apk_decompiled/sources/com/google/firebase/messaging/n.java
Normal file
@@ -0,0 +1,32 @@
|
||||
package com.google.firebase.messaging;
|
||||
|
||||
import com.google.firebase.messaging.WithinAppServiceConnection;
|
||||
|
||||
/* loaded from: classes3.dex */
|
||||
public final /* synthetic */ class n implements Runnable {
|
||||
|
||||
/* renamed from: a, reason: collision with root package name */
|
||||
public final /* synthetic */ int f6023a;
|
||||
|
||||
/* renamed from: b, reason: collision with root package name */
|
||||
public final /* synthetic */ Object f6024b;
|
||||
|
||||
public /* synthetic */ n(Object obj, int i) {
|
||||
this.f6023a = i;
|
||||
this.f6024b = obj;
|
||||
}
|
||||
|
||||
@Override // java.lang.Runnable
|
||||
public final void run() {
|
||||
int i = this.f6023a;
|
||||
Object obj = this.f6024b;
|
||||
switch (i) {
|
||||
case 0:
|
||||
((SharedPreferencesQueue) obj).syncState();
|
||||
return;
|
||||
default:
|
||||
WithinAppServiceConnection.BindRequest.b((WithinAppServiceConnection.BindRequest) obj);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
39
apk_decompiled/sources/com/google/firebase/messaging/p.java
Normal file
39
apk_decompiled/sources/com/google/firebase/messaging/p.java
Normal file
@@ -0,0 +1,39 @@
|
||||
package com.google.firebase.messaging;
|
||||
|
||||
import android.content.Intent;
|
||||
import com.google.android.gms.tasks.OnCompleteListener;
|
||||
import com.google.android.gms.tasks.Task;
|
||||
import com.google.firebase.messaging.WithinAppServiceConnection;
|
||||
import java.util.concurrent.ScheduledFuture;
|
||||
|
||||
/* loaded from: classes3.dex */
|
||||
public final /* synthetic */ class p implements OnCompleteListener {
|
||||
|
||||
/* renamed from: a, reason: collision with root package name */
|
||||
public final /* synthetic */ int f6030a;
|
||||
|
||||
/* renamed from: b, reason: collision with root package name */
|
||||
public final /* synthetic */ Object f6031b;
|
||||
|
||||
public /* synthetic */ p(Object obj, int i) {
|
||||
this.f6030a = i;
|
||||
this.f6031b = obj;
|
||||
}
|
||||
|
||||
@Override // com.google.android.gms.tasks.OnCompleteListener
|
||||
public final void onComplete(Task task) {
|
||||
int i = this.f6030a;
|
||||
Object obj = this.f6031b;
|
||||
switch (i) {
|
||||
case 0:
|
||||
WakeLockHolder.completeWakefulIntent((Intent) obj);
|
||||
return;
|
||||
case 1:
|
||||
WithinAppServiceBinder.a((WithinAppServiceConnection.BindRequest) obj, task);
|
||||
return;
|
||||
default:
|
||||
((ScheduledFuture) obj).cancel(false);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,279 @@
|
||||
package com.google.firebase.messaging.reporting;
|
||||
|
||||
import com.google.firebase.encoders.proto.ProtoEnum;
|
||||
import com.google.firebase.encoders.proto.Protobuf;
|
||||
|
||||
/* loaded from: classes3.dex */
|
||||
public final class MessagingClientEvent {
|
||||
private static final MessagingClientEvent DEFAULT_INSTANCE = new Builder().build();
|
||||
private final String analytics_label_;
|
||||
private final long bulk_id_;
|
||||
private final long campaign_id_;
|
||||
private final String collapse_key_;
|
||||
private final String composer_label_;
|
||||
private final Event event_;
|
||||
private final String instance_id_;
|
||||
private final String message_id_;
|
||||
private final MessageType message_type_;
|
||||
private final String package_name_;
|
||||
private final int priority_;
|
||||
private final long project_number_;
|
||||
private final SDKPlatform sdk_platform_;
|
||||
private final String topic_;
|
||||
private final int ttl_;
|
||||
|
||||
/* loaded from: classes3.dex */
|
||||
public static final class Builder {
|
||||
private long project_number_ = 0;
|
||||
private String message_id_ = "";
|
||||
private String instance_id_ = "";
|
||||
private MessageType message_type_ = MessageType.UNKNOWN;
|
||||
private SDKPlatform sdk_platform_ = SDKPlatform.UNKNOWN_OS;
|
||||
private String package_name_ = "";
|
||||
private String collapse_key_ = "";
|
||||
private int priority_ = 0;
|
||||
private int ttl_ = 0;
|
||||
private String topic_ = "";
|
||||
private long bulk_id_ = 0;
|
||||
private Event event_ = Event.UNKNOWN_EVENT;
|
||||
private String analytics_label_ = "";
|
||||
private long campaign_id_ = 0;
|
||||
private String composer_label_ = "";
|
||||
|
||||
public MessagingClientEvent build() {
|
||||
return new MessagingClientEvent(this.project_number_, this.message_id_, this.instance_id_, this.message_type_, this.sdk_platform_, this.package_name_, this.collapse_key_, this.priority_, this.ttl_, this.topic_, this.bulk_id_, this.event_, this.analytics_label_, this.campaign_id_, this.composer_label_);
|
||||
}
|
||||
|
||||
public Builder setAnalyticsLabel(String str) {
|
||||
this.analytics_label_ = str;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setBulkId(long j4) {
|
||||
this.bulk_id_ = j4;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setCampaignId(long j4) {
|
||||
this.campaign_id_ = j4;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setCollapseKey(String str) {
|
||||
this.collapse_key_ = str;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setComposerLabel(String str) {
|
||||
this.composer_label_ = str;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setEvent(Event event) {
|
||||
this.event_ = event;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setInstanceId(String str) {
|
||||
this.instance_id_ = str;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setMessageId(String str) {
|
||||
this.message_id_ = str;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setMessageType(MessageType messageType) {
|
||||
this.message_type_ = messageType;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setPackageName(String str) {
|
||||
this.package_name_ = str;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setPriority(int i) {
|
||||
this.priority_ = i;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setProjectNumber(long j4) {
|
||||
this.project_number_ = j4;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setSdkPlatform(SDKPlatform sDKPlatform) {
|
||||
this.sdk_platform_ = sDKPlatform;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setTopic(String str) {
|
||||
this.topic_ = str;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setTtl(int i) {
|
||||
this.ttl_ = i;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
/* loaded from: classes3.dex */
|
||||
public enum Event implements ProtoEnum {
|
||||
UNKNOWN_EVENT(0),
|
||||
MESSAGE_DELIVERED(1),
|
||||
MESSAGE_OPEN(2);
|
||||
|
||||
private final int number_;
|
||||
|
||||
Event(int i) {
|
||||
this.number_ = i;
|
||||
}
|
||||
|
||||
@Override // com.google.firebase.encoders.proto.ProtoEnum
|
||||
public int getNumber() {
|
||||
return this.number_;
|
||||
}
|
||||
}
|
||||
|
||||
/* loaded from: classes3.dex */
|
||||
public enum MessageType implements ProtoEnum {
|
||||
UNKNOWN(0),
|
||||
DATA_MESSAGE(1),
|
||||
TOPIC(2),
|
||||
DISPLAY_NOTIFICATION(3);
|
||||
|
||||
private final int number_;
|
||||
|
||||
MessageType(int i) {
|
||||
this.number_ = i;
|
||||
}
|
||||
|
||||
@Override // com.google.firebase.encoders.proto.ProtoEnum
|
||||
public int getNumber() {
|
||||
return this.number_;
|
||||
}
|
||||
}
|
||||
|
||||
/* loaded from: classes3.dex */
|
||||
public enum SDKPlatform implements ProtoEnum {
|
||||
UNKNOWN_OS(0),
|
||||
ANDROID(1),
|
||||
IOS(2),
|
||||
WEB(3);
|
||||
|
||||
private final int number_;
|
||||
|
||||
SDKPlatform(int i) {
|
||||
this.number_ = i;
|
||||
}
|
||||
|
||||
@Override // com.google.firebase.encoders.proto.ProtoEnum
|
||||
public int getNumber() {
|
||||
return this.number_;
|
||||
}
|
||||
}
|
||||
|
||||
public MessagingClientEvent(long j4, String str, String str2, MessageType messageType, SDKPlatform sDKPlatform, String str3, String str4, int i, int i4, String str5, long j5, Event event, String str6, long j6, String str7) {
|
||||
this.project_number_ = j4;
|
||||
this.message_id_ = str;
|
||||
this.instance_id_ = str2;
|
||||
this.message_type_ = messageType;
|
||||
this.sdk_platform_ = sDKPlatform;
|
||||
this.package_name_ = str3;
|
||||
this.collapse_key_ = str4;
|
||||
this.priority_ = i;
|
||||
this.ttl_ = i4;
|
||||
this.topic_ = str5;
|
||||
this.bulk_id_ = j5;
|
||||
this.event_ = event;
|
||||
this.analytics_label_ = str6;
|
||||
this.campaign_id_ = j6;
|
||||
this.composer_label_ = str7;
|
||||
}
|
||||
|
||||
public static MessagingClientEvent getDefaultInstance() {
|
||||
return DEFAULT_INSTANCE;
|
||||
}
|
||||
|
||||
public static Builder newBuilder() {
|
||||
return new Builder();
|
||||
}
|
||||
|
||||
@Protobuf(tag = 13)
|
||||
public String getAnalyticsLabel() {
|
||||
return this.analytics_label_;
|
||||
}
|
||||
|
||||
@Protobuf(tag = 11)
|
||||
public long getBulkId() {
|
||||
return this.bulk_id_;
|
||||
}
|
||||
|
||||
@Protobuf(tag = 14)
|
||||
public long getCampaignId() {
|
||||
return this.campaign_id_;
|
||||
}
|
||||
|
||||
@Protobuf(tag = 7)
|
||||
public String getCollapseKey() {
|
||||
return this.collapse_key_;
|
||||
}
|
||||
|
||||
@Protobuf(tag = 15)
|
||||
public String getComposerLabel() {
|
||||
return this.composer_label_;
|
||||
}
|
||||
|
||||
@Protobuf(tag = 12)
|
||||
public Event getEvent() {
|
||||
return this.event_;
|
||||
}
|
||||
|
||||
@Protobuf(tag = 3)
|
||||
public String getInstanceId() {
|
||||
return this.instance_id_;
|
||||
}
|
||||
|
||||
@Protobuf(tag = 2)
|
||||
public String getMessageId() {
|
||||
return this.message_id_;
|
||||
}
|
||||
|
||||
@Protobuf(tag = 4)
|
||||
public MessageType getMessageType() {
|
||||
return this.message_type_;
|
||||
}
|
||||
|
||||
@Protobuf(tag = 6)
|
||||
public String getPackageName() {
|
||||
return this.package_name_;
|
||||
}
|
||||
|
||||
@Protobuf(tag = 8)
|
||||
public int getPriority() {
|
||||
return this.priority_;
|
||||
}
|
||||
|
||||
@Protobuf(tag = 1)
|
||||
public long getProjectNumber() {
|
||||
return this.project_number_;
|
||||
}
|
||||
|
||||
@Protobuf(tag = 5)
|
||||
public SDKPlatform getSdkPlatform() {
|
||||
return this.sdk_platform_;
|
||||
}
|
||||
|
||||
@Protobuf(tag = 10)
|
||||
public String getTopic() {
|
||||
return this.topic_;
|
||||
}
|
||||
|
||||
@Protobuf(tag = 9)
|
||||
public int getTtl() {
|
||||
return this.ttl_;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
package com.google.firebase.messaging.reporting;
|
||||
|
||||
import com.google.firebase.encoders.annotations.Encodable;
|
||||
import com.google.firebase.encoders.proto.Protobuf;
|
||||
import com.google.firebase.messaging.ProtoEncoderDoNotUse;
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStream;
|
||||
|
||||
/* loaded from: classes3.dex */
|
||||
public final class MessagingClientEventExtension {
|
||||
private static final MessagingClientEventExtension DEFAULT_INSTANCE = new Builder().build();
|
||||
private final MessagingClientEvent messaging_client_event_;
|
||||
|
||||
/* loaded from: classes3.dex */
|
||||
public static final class Builder {
|
||||
private MessagingClientEvent messaging_client_event_ = null;
|
||||
|
||||
public MessagingClientEventExtension build() {
|
||||
return new MessagingClientEventExtension(this.messaging_client_event_);
|
||||
}
|
||||
|
||||
public Builder setMessagingClientEvent(MessagingClientEvent messagingClientEvent) {
|
||||
this.messaging_client_event_ = messagingClientEvent;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
public MessagingClientEventExtension(MessagingClientEvent messagingClientEvent) {
|
||||
this.messaging_client_event_ = messagingClientEvent;
|
||||
}
|
||||
|
||||
public static MessagingClientEventExtension getDefaultInstance() {
|
||||
return DEFAULT_INSTANCE;
|
||||
}
|
||||
|
||||
public static Builder newBuilder() {
|
||||
return new Builder();
|
||||
}
|
||||
|
||||
@Encodable.Ignore
|
||||
public MessagingClientEvent getMessagingClientEvent() {
|
||||
MessagingClientEvent messagingClientEvent = this.messaging_client_event_;
|
||||
return messagingClientEvent == null ? MessagingClientEvent.getDefaultInstance() : messagingClientEvent;
|
||||
}
|
||||
|
||||
@Protobuf(tag = 1)
|
||||
@Encodable.Field(name = "messagingClientEvent")
|
||||
public MessagingClientEvent getMessagingClientEventInternal() {
|
||||
return this.messaging_client_event_;
|
||||
}
|
||||
|
||||
public byte[] toByteArray() {
|
||||
return ProtoEncoderDoNotUse.encode(this);
|
||||
}
|
||||
|
||||
public void writeTo(OutputStream outputStream) throws IOException {
|
||||
ProtoEncoderDoNotUse.encode(this, outputStream);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.google.firebase.messaging.threads;
|
||||
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.Future;
|
||||
import java.util.concurrent.ScheduledExecutorService;
|
||||
import java.util.concurrent.ThreadFactory;
|
||||
|
||||
/* loaded from: classes3.dex */
|
||||
public interface ExecutorFactory {
|
||||
void executeOneOff(String str, String str2, ThreadPriority threadPriority, Runnable runnable);
|
||||
|
||||
ScheduledExecutorService newScheduledThreadPool(int i, ThreadPriority threadPriority);
|
||||
|
||||
ScheduledExecutorService newScheduledThreadPool(int i, ThreadFactory threadFactory, ThreadPriority threadPriority);
|
||||
|
||||
ExecutorService newSingleThreadExecutor(ThreadPriority threadPriority);
|
||||
|
||||
ExecutorService newSingleThreadExecutor(ThreadFactory threadFactory, ThreadPriority threadPriority);
|
||||
|
||||
ExecutorService newThreadPool(int i, ThreadPriority threadPriority);
|
||||
|
||||
ExecutorService newThreadPool(int i, ThreadFactory threadFactory, ThreadPriority threadPriority);
|
||||
|
||||
ExecutorService newThreadPool(ThreadPriority threadPriority);
|
||||
|
||||
ExecutorService newThreadPool(ThreadFactory threadFactory, ThreadPriority threadPriority);
|
||||
|
||||
Future<?> submitOneOff(String str, String str2, ThreadPriority threadPriority, Runnable runnable);
|
||||
}
|
||||
@@ -0,0 +1,107 @@
|
||||
package com.google.firebase.messaging.threads;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.Executors;
|
||||
import java.util.concurrent.Future;
|
||||
import java.util.concurrent.FutureTask;
|
||||
import java.util.concurrent.LinkedBlockingQueue;
|
||||
import java.util.concurrent.ScheduledExecutorService;
|
||||
import java.util.concurrent.ThreadFactory;
|
||||
import java.util.concurrent.ThreadPoolExecutor;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
/* loaded from: classes3.dex */
|
||||
public class PoolableExecutors {
|
||||
private static final ExecutorFactory DEFAULT_INSTANCE;
|
||||
private static volatile ExecutorFactory instance;
|
||||
|
||||
/* loaded from: classes3.dex */
|
||||
public static class DefaultExecutorFactory implements ExecutorFactory {
|
||||
private static final long CORE_THREAD_TIMEOUT_SECS = 60;
|
||||
|
||||
private DefaultExecutorFactory() {
|
||||
}
|
||||
|
||||
@Override // com.google.firebase.messaging.threads.ExecutorFactory
|
||||
@SuppressLint({"ThreadPoolCreation"})
|
||||
public void executeOneOff(String str, String str2, ThreadPriority threadPriority, Runnable runnable) {
|
||||
new Thread(runnable, str2).start();
|
||||
}
|
||||
|
||||
@Override // com.google.firebase.messaging.threads.ExecutorFactory
|
||||
@SuppressLint({"ThreadPoolCreation"})
|
||||
public ScheduledExecutorService newScheduledThreadPool(int i, ThreadPriority threadPriority) {
|
||||
return Executors.unconfigurableScheduledExecutorService(Executors.newScheduledThreadPool(i));
|
||||
}
|
||||
|
||||
@Override // com.google.firebase.messaging.threads.ExecutorFactory
|
||||
public ExecutorService newSingleThreadExecutor(ThreadPriority threadPriority) {
|
||||
return newThreadPool(1, threadPriority);
|
||||
}
|
||||
|
||||
@Override // com.google.firebase.messaging.threads.ExecutorFactory
|
||||
@SuppressLint({"ThreadPoolCreation"})
|
||||
public ExecutorService newThreadPool(ThreadPriority threadPriority) {
|
||||
return Executors.unconfigurableExecutorService(Executors.newCachedThreadPool());
|
||||
}
|
||||
|
||||
@Override // com.google.firebase.messaging.threads.ExecutorFactory
|
||||
@SuppressLint({"ThreadPoolCreation"})
|
||||
public Future<?> submitOneOff(String str, String str2, ThreadPriority threadPriority, Runnable runnable) {
|
||||
FutureTask futureTask = new FutureTask(runnable, null);
|
||||
new Thread(futureTask, str2).start();
|
||||
return futureTask;
|
||||
}
|
||||
|
||||
@Override // com.google.firebase.messaging.threads.ExecutorFactory
|
||||
public ExecutorService newSingleThreadExecutor(ThreadFactory threadFactory, ThreadPriority threadPriority) {
|
||||
return newThreadPool(1, threadFactory, threadPriority);
|
||||
}
|
||||
|
||||
@Override // com.google.firebase.messaging.threads.ExecutorFactory
|
||||
@SuppressLint({"ThreadPoolCreation"})
|
||||
public ExecutorService newThreadPool(ThreadFactory threadFactory, ThreadPriority threadPriority) {
|
||||
return Executors.unconfigurableExecutorService(Executors.newCachedThreadPool(threadFactory));
|
||||
}
|
||||
|
||||
@Override // com.google.firebase.messaging.threads.ExecutorFactory
|
||||
@SuppressLint({"ThreadPoolCreation"})
|
||||
public ScheduledExecutorService newScheduledThreadPool(int i, ThreadFactory threadFactory, ThreadPriority threadPriority) {
|
||||
return Executors.unconfigurableScheduledExecutorService(Executors.newScheduledThreadPool(i, threadFactory));
|
||||
}
|
||||
|
||||
@Override // com.google.firebase.messaging.threads.ExecutorFactory
|
||||
public ExecutorService newThreadPool(int i, ThreadPriority threadPriority) {
|
||||
return newThreadPool(i, Executors.defaultThreadFactory(), threadPriority);
|
||||
}
|
||||
|
||||
@Override // com.google.firebase.messaging.threads.ExecutorFactory
|
||||
@SuppressLint({"ThreadPoolCreation"})
|
||||
public ExecutorService newThreadPool(int i, ThreadFactory threadFactory, ThreadPriority threadPriority) {
|
||||
ThreadPoolExecutor threadPoolExecutor = new ThreadPoolExecutor(i, i, 60L, TimeUnit.SECONDS, new LinkedBlockingQueue(), threadFactory);
|
||||
threadPoolExecutor.allowCoreThreadTimeOut(true);
|
||||
return Executors.unconfigurableExecutorService(threadPoolExecutor);
|
||||
}
|
||||
}
|
||||
|
||||
static {
|
||||
DefaultExecutorFactory defaultExecutorFactory = new DefaultExecutorFactory();
|
||||
DEFAULT_INSTANCE = defaultExecutorFactory;
|
||||
instance = defaultExecutorFactory;
|
||||
}
|
||||
|
||||
private PoolableExecutors() {
|
||||
}
|
||||
|
||||
public static ExecutorFactory factory() {
|
||||
return instance;
|
||||
}
|
||||
|
||||
public static void installExecutorFactory(ExecutorFactory executorFactory) {
|
||||
if (instance != DEFAULT_INSTANCE) {
|
||||
throw new IllegalStateException("Trying to install an ExecutorFactory twice!");
|
||||
}
|
||||
instance = executorFactory;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package com.google.firebase.messaging.threads;
|
||||
|
||||
/* loaded from: classes3.dex */
|
||||
public enum ThreadPriority {
|
||||
LOW_POWER,
|
||||
HIGH_SPEED
|
||||
}
|
||||
Reference in New Issue
Block a user