what-the-bank/sources/com/google/firebase/messaging/FirebaseMessagingService.java

506 lines
22 KiB
Java
Raw Normal View History

2024-07-27 18:17:47 +07:00
package com.google.firebase.messaging;
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
import android.graphics.Color;
import android.media.AudioTrack;
import android.os.Bundle;
import android.os.Process;
import android.os.SystemClock;
import android.text.AndroidCharacter;
import android.text.TextUtils;
import android.util.Log;
import android.util.TypedValue;
import android.view.Gravity;
import android.view.KeyEvent;
import android.view.View;
import android.view.ViewConfiguration;
import android.widget.ExpandableListView;
import com.google.android.gms.common.util.concurrent.NamedThreadFactory;
import com.google.android.gms.maps.model.BitmapDescriptorFactory;
import com.google.android.gms.tasks.Task;
import com.google.android.gms.tasks.Tasks;
import com.google.firebase.iid.zzaw;
import java.lang.reflect.Method;
import java.util.ArrayDeque;
import java.util.Queue;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
import o.C1332aAy;
import o.FsM;
import o.KRW;
import o.dQY;
import o.xzZ;
import org.bouncycastle.crypto.tls.CipherSuite;
/* loaded from: classes2.dex */
public class FirebaseMessagingService extends zzf {
private static char[] a;
private static long b;
private static int c;
private static final Queue<String> zza;
private static final byte[] $$a = {118, -18, 54, 121};
private static final int $$b = CipherSuite.TLS_DH_anon_WITH_CAMELLIA_256_CBC_SHA256;
private static int $10 = 0;
private static int $11 = 1;
private static int e = 0;
private static void j(short s, byte b2, short s2, Object[] objArr) {
int i = 4 - (s2 * 4);
int i2 = 106 - s;
byte[] bArr = $$a;
int i3 = b2 * 4;
byte[] bArr2 = new byte[1 - i3];
int i4 = 0 - i3;
int i5 = -1;
if (bArr == null) {
i++;
i2 = i4 + i;
}
while (true) {
i5++;
bArr2[i5] = (byte) i2;
if (i5 == i4) {
objArr[0] = new String(bArr2, 0);
return;
} else {
int i6 = bArr[i];
i++;
i2 += i6;
}
}
}
@Override // com.google.firebase.messaging.zzf
protected final Intent zza(Intent intent) {
int i = 2 % 2;
int i2 = c + 41;
e = i2 % 128;
int i3 = i2 % 2;
zzaw zza2 = zzaw.zza();
if (i3 == 0) {
return zza2.zzb();
}
zza2.zzb();
throw null;
}
@Override // com.google.firebase.messaging.zzf
public final boolean zzb(Intent intent) {
int i = 2 % 2;
if (!"com.google.firebase.messaging.NOTIFICATION_OPEN".equals(intent.getAction())) {
return false;
}
PendingIntent pendingIntent = (PendingIntent) intent.getParcelableExtra("pending_intent");
if (pendingIntent != null) {
int i2 = e + 53;
c = i2 % 128;
int i3 = i2 % 2;
try {
pendingIntent.send();
} catch (PendingIntent.CanceledException unused) {
}
}
if (!(!zzr.zzd(intent))) {
int i4 = c + 105;
e = i4 % 128;
int i5 = i4 % 2;
zzr.zza(intent);
}
return true;
}
private static void i(int i, int i2, char c2, Object[] objArr) {
int i3 = 2 % 2;
dQY dqy = new dQY();
long[] jArr = new long[i2];
dqy.a = 0;
while (dqy.a < i2) {
int i4 = dqy.a;
try {
Object[] objArr2 = {Integer.valueOf(a[i + dqy.a])};
Object obj = xzZ.y.get(1095064095);
if (obj == null) {
Class cls = (Class) xzZ.c(308 - (ViewConfiguration.getLongPressTimeout() >> 16), TextUtils.getTrimmedLength("") + 5, (char) (Color.green(0) + 32797));
byte b2 = (byte) 0;
Object[] objArr3 = new Object[1];
j((byte) 8, b2, b2, objArr3);
obj = cls.getMethod((String) objArr3[0], Integer.TYPE);
xzZ.y.put(1095064095, obj);
}
Object[] objArr4 = {Long.valueOf(((Long) ((Method) obj).invoke(null, objArr2)).longValue()), Long.valueOf(dqy.a), Long.valueOf(b), Integer.valueOf(c2)};
Object obj2 = xzZ.y.get(-548438098);
if (obj2 == null) {
Class cls2 = (Class) xzZ.c(412 - (ViewConfiguration.getScrollBarSize() >> 8), AndroidCharacter.getMirror('0') - '+', (char) View.getDefaultSize(0, 0));
byte b3 = (byte) 0;
Object[] objArr5 = new Object[1];
j((byte) 7, b3, b3, objArr5);
obj2 = cls2.getMethod((String) objArr5[0], Long.TYPE, Long.TYPE, Long.TYPE, Integer.TYPE);
xzZ.y.put(-548438098, obj2);
}
jArr[i4] = ((Long) ((Method) obj2).invoke(null, objArr4)).longValue();
Object[] objArr6 = {dqy, dqy};
Object obj3 = xzZ.y.get(1071125919);
if (obj3 == null) {
Class cls3 = (Class) xzZ.c(407 - (TypedValue.complexToFraction(0, BitmapDescriptorFactory.HUE_RED, BitmapDescriptorFactory.HUE_RED) > BitmapDescriptorFactory.HUE_RED ? 1 : (TypedValue.complexToFraction(0, BitmapDescriptorFactory.HUE_RED, BitmapDescriptorFactory.HUE_RED) == BitmapDescriptorFactory.HUE_RED ? 0 : -1)), (ViewConfiguration.getEdgeSlop() >> 16) + 5, (char) (29234 - (ViewConfiguration.getKeyRepeatDelay() >> 16)));
byte b4 = (byte) 0;
byte b5 = b4;
Object[] objArr7 = new Object[1];
j(b4, b5, b5, objArr7);
obj3 = cls3.getMethod((String) objArr7[0], Object.class, Object.class);
xzZ.y.put(1071125919, obj3);
}
((Method) obj3).invoke(null, objArr6);
} catch (Throwable th) {
Throwable cause = th.getCause();
if (cause == null) {
throw th;
}
throw cause;
}
}
char[] cArr = new char[i2];
dqy.a = 0;
while (dqy.a < i2) {
int i5 = $11 + 105;
$10 = i5 % 128;
int i6 = i5 % 2;
cArr[dqy.a] = (char) jArr[dqy.a];
Object[] objArr8 = {dqy, dqy};
Object obj4 = xzZ.y.get(1071125919);
if (obj4 == null) {
Class cls4 = (Class) xzZ.c((SystemClock.elapsedRealtime() > 0L ? 1 : (SystemClock.elapsedRealtime() == 0L ? 0 : -1)) + 406, (Process.myPid() >> 22) + 5, (char) (29234 - TextUtils.indexOf("", "")));
byte b6 = (byte) 0;
byte b7 = b6;
Object[] objArr9 = new Object[1];
j(b6, b7, b7, objArr9);
obj4 = cls4.getMethod((String) objArr9[0], Object.class, Object.class);
xzZ.y.put(1071125919, obj4);
}
((Method) obj4).invoke(null, objArr8);
}
String str = new String(cArr);
int i7 = $11 + 83;
$10 = i7 % 128;
int i8 = i7 % 2;
objArr[0] = str;
}
/* JADX WARN: Can't fix incorrect switch cases order, some code will duplicate */
@Override // com.google.firebase.messaging.zzf
public final void zzc(Intent intent) {
Task<Void> zza2;
char c2;
int i = 2 % 2;
String action = intent.getAction();
Object obj = null;
if (!"com.google.android.c2dm.intent.RECEIVE".equals(action)) {
int i2 = e + 63;
c = i2 % 128;
if (i2 % 2 == 0) {
"com.google.firebase.messaging.RECEIVE_DIRECT_BOOT".equals(action);
obj.hashCode();
throw null;
}
if (!"com.google.firebase.messaging.RECEIVE_DIRECT_BOOT".equals(action)) {
if (!"com.google.firebase.messaging.NOTIFICATION_DISMISS".equals(action)) {
if ("com.google.firebase.messaging.NEW_TOKEN".equals(action)) {
onNewToken(intent.getStringExtra("token"));
return;
} else {
intent.getAction();
return;
}
}
if (zzr.zzd(intent)) {
int i3 = e + 81;
c = i3 % 128;
if (i3 % 2 != 0) {
zzr.zzb(intent);
return;
} else {
zzr.zzb(intent);
throw null;
}
}
return;
}
}
String stringExtra = intent.getStringExtra("google.message_id");
if (TextUtils.isEmpty(stringExtra)) {
zza2 = Tasks.forResult(null);
} else {
Bundle bundle = new Bundle();
bundle.putString("google.message_id", stringExtra);
zza2 = com.google.firebase.iid.zzab.zza(this).zza(2, bundle);
}
try {
if (!TextUtils.isEmpty(stringExtra)) {
Queue<String> queue = zza;
if (queue.contains(stringExtra)) {
Log.isLoggable("FirebaseMessaging", 3);
Tasks.await(zza2, TimeUnit.SECONDS.toMillis(1L), TimeUnit.MILLISECONDS);
return;
}
if (queue.size() >= 10) {
int i4 = c + 111;
e = i4 % 128;
int i5 = i4 % 2;
queue.remove();
int i6 = e + 109;
c = i6 % 128;
int i7 = i6 % 2;
}
queue.add(stringExtra);
}
Tasks.await(zza2, TimeUnit.SECONDS.toMillis(1L), TimeUnit.MILLISECONDS);
return;
} catch (InterruptedException | ExecutionException | TimeoutException unused) {
return;
}
String stringExtra2 = intent.getStringExtra("message_type");
if (stringExtra2 == null) {
stringExtra2 = "gcm";
}
stringExtra2.hashCode();
switch (stringExtra2.hashCode()) {
case -2062414158:
if (stringExtra2.equals("deleted_messages")) {
c2 = 0;
break;
}
c2 = 65535;
break;
case 102161:
if (stringExtra2.equals("gcm")) {
c2 = 1;
break;
}
c2 = 65535;
break;
case 814694033:
if (stringExtra2.equals("send_error")) {
c2 = 2;
break;
}
c2 = 65535;
break;
case 814800675:
if (stringExtra2.equals("send_event")) {
int i8 = c + 93;
e = i8 % 128;
if (i8 % 2 == 0) {
c2 = 3;
break;
} else {
c2 = 4;
break;
}
}
c2 = 65535;
break;
default:
c2 = 65535;
break;
}
if (c2 == 0) {
onDeletedMessages();
} else if (c2 == 1) {
if (zzr.zzd(intent)) {
zzr.zza(intent, (KRW<String>) null);
}
if (zzr.zze(intent)) {
int i9 = c + 81;
e = i9 % 128;
int i10 = i9 % 2;
FsM fsM = FirebaseMessaging.zza;
if (fsM != null) {
zzr.zza(intent, (KRW<String>) fsM.getTransport("FCM_CLIENT_EVENT_LOGGING", String.class, new C1332aAy("json"), zzp.zza));
}
}
Bundle extras = intent.getExtras();
if (extras == null) {
extras = new Bundle();
int i11 = e + 13;
c = i11 % 128;
int i12 = i11 % 2;
}
extras.remove("androidx.contentpager.content.wakelockid");
if (zzt.zza(extras)) {
zzt zztVar = new zzt(extras);
ExecutorService newSingleThreadExecutor = Executors.newSingleThreadExecutor(new NamedThreadFactory("Firebase-Messaging-Network-Io"));
try {
if (!new zzc(this, zztVar, newSingleThreadExecutor).zza()) {
newSingleThreadExecutor.shutdown();
if (zzr.zzd(intent)) {
zzr.zzc(intent);
}
}
} finally {
newSingleThreadExecutor.shutdown();
}
}
onMessageReceived(new RemoteMessage(extras));
} else if (c2 == 2) {
String stringExtra3 = intent.getStringExtra("google.message_id");
if (stringExtra3 == null) {
stringExtra3 = intent.getStringExtra("message_id");
}
onSendError(stringExtra3, new SendException(intent.getStringExtra("error")));
} else if (c2 == 3) {
onMessageSent(intent.getStringExtra("google.message_id"));
}
}
static {
c = 1;
a();
zza = new ArrayDeque(10);
int i = e + 55;
c = i % 128;
int i2 = i % 2;
}
@Override // com.google.firebase.messaging.zzf, android.app.Service, android.content.ContextWrapper
public void attachBaseContext(Context context) {
Context context2;
int i = 2 % 2;
super.attachBaseContext(context);
Object[] objArr = new Object[1];
i(TextUtils.getOffsetAfter("", 0), ((Process.getThreadPriority(0) + 20) >> 6) + 18, (char) (ExpandableListView.getPackedPositionChild(0L) + 1), objArr);
Class<?> cls = Class.forName((String) objArr[0]);
Object[] objArr2 = new Object[1];
i((SystemClock.elapsedRealtime() > 0L ? 1 : (SystemClock.elapsedRealtime() == 0L ? 0 : -1)) + 17, (ViewConfiguration.getFadingEdgeLength() >> 16) + 5, (char) (ExpandableListView.getPackedPositionType(0L) + 2274), objArr2);
int intValue = ((Integer) cls.getDeclaredMethod((String) objArr2[0], new Class[0]).invoke(null, new Object[0])).intValue() % 100000;
if (intValue < 99000 || intValue > 99999) {
if (context != null) {
int i2 = c + 113;
e = i2 % 128;
if (i2 % 2 != 0) {
context2 = context.getApplicationContext();
int i3 = 60 / 0;
} else {
context2 = context.getApplicationContext();
}
} else {
context2 = context;
}
if (context2 != null) {
try {
Object obj = xzZ.y.get(125943855);
if (obj == null) {
obj = ((Class) xzZ.c(492 - (ViewConfiguration.getMaximumDrawingCacheSize() >> 24), 5 - Color.argb(0, 0, 0, 0), (char) Gravity.getAbsoluteGravity(0, 0))).getMethod("a", null);
xzZ.y.put(125943855, obj);
}
Object invoke = ((Method) obj).invoke(null, null);
Object[] objArr3 = new Object[1];
i(23 - ExpandableListView.getPackedPositionGroup(0L), 47 - Process.getGidForName(""), (char) (TextUtils.getOffsetAfter("", 0) + 19773), objArr3);
String str = (String) objArr3[0];
Object[] objArr4 = new Object[1];
i((ViewConfiguration.getLongPressTimeout() >> 16) + 71, 64 - Color.red(0), (char) ((ExpandableListView.getPackedPositionForChild(0, 0) > 0L ? 1 : (ExpandableListView.getPackedPositionForChild(0, 0) == 0L ? 0 : -1)) + 24225), objArr4);
String str2 = (String) objArr4[0];
Object[] objArr5 = new Object[1];
i(135 - Color.red(0), TextUtils.lastIndexOf("", '0') + 65, (char) (ViewConfiguration.getLongPressTimeout() >> 16), objArr5);
String str3 = (String) objArr5[0];
Object[] objArr6 = new Object[1];
i((ViewConfiguration.getMinimumFlingVelocity() >> 16) + 199, Color.green(0) + 74, (char) ((ViewConfiguration.getMinimumFlingVelocity() >> 16) + 19934), objArr6);
String str4 = (String) objArr6[0];
Object[] objArr7 = new Object[1];
i((AudioTrack.getMaxVolume() > BitmapDescriptorFactory.HUE_RED ? 1 : (AudioTrack.getMaxVolume() == BitmapDescriptorFactory.HUE_RED ? 0 : -1)) + 272, 6 - (ViewConfiguration.getGlobalActionKeyTimeout() > 0L ? 1 : (ViewConfiguration.getGlobalActionKeyTimeout() == 0L ? 0 : -1)), (char) (Process.myTid() >> 22), objArr7);
String str5 = (String) objArr7[0];
Object[] objArr8 = new Object[1];
i((SystemClock.uptimeMillis() > 0L ? 1 : (SystemClock.uptimeMillis() == 0L ? 0 : -1)) + 277, 36 - (AudioTrack.getMinVolume() > BitmapDescriptorFactory.HUE_RED ? 1 : (AudioTrack.getMinVolume() == BitmapDescriptorFactory.HUE_RED ? 0 : -1)), (char) (TextUtils.indexOf((CharSequence) "", '0') + 10383), objArr8);
Object[] objArr9 = {context2, str, str2, str3, str4, true, str5, (String) objArr8[0]};
Object obj2 = xzZ.y.get(1656189573);
if (obj2 == null) {
obj2 = ((Class) xzZ.c(487 - ExpandableListView.getPackedPositionType(0L), 5 - KeyEvent.keyCodeFromString(""), (char) View.MeasureSpec.getSize(0))).getMethod("e", Context.class, String.class, String.class, String.class, String.class, Boolean.TYPE, String.class, String.class);
xzZ.y.put(1656189573, obj2);
}
((Method) obj2).invoke(invoke, objArr9);
} catch (Throwable th) {
Throwable cause = th.getCause();
if (cause == null) {
throw th;
}
throw cause;
}
}
}
int i4 = c + 65;
e = i4 % 128;
int i5 = i4 % 2;
}
static void a() {
a = new char[]{36787, 64736, 26894, 54708, 17101, 53111, 15262, 43128, 5469, 33181, 3684, 31606, 59376, 21521, 49337, 19923, 47713, 9917, 34653, 62485, 25053, 56653, 18980, 49886, 45444, 9315, 39065, 4012, 33344, 30369, 58634, 22637, 52458, 17221, 13946, 43660, 6433, 36308, 179, 63309, 27584, 56997, 19715, 49644, 46167, 11110, 40850, 4649, 33061, 30164, 59502, 23708, 54202, 17987, 15098, 43358, 7174, 37103, 1866, 64121, 28358, 56613, 20873, 50365, 47975, 12238, 41646, 4444, 34299, 30722, 61247, 53527, 41548, 14332, 35587, 7220, 37340, 25966, 63183, 19447, 57211, 20696, 9648, 47376, 2792, 40525, 4903, 58500, 30810, 52539, 24212, 53793, 42952, 14587, 35842, 481, 37560, 26138, 64421, 20304, 49191, 21898, 10606, 47813, 3993, 33663, 5255, 59831, 32006, 52920, 16916, 55076, 43180, 15371, 45360, 663, 38511, 27596, 64756, 28758, 50646, 22252, 10769, 49057, 13126, 33839, 6612, 60778, 32365, 62363, 18302, 55508, 44540, 8539, 45747, 36787, 64694, 26970, 54773, 17091, 53037, 15263, 43059, 5376, 33239, 3705, 31555, 59360, 21578, 49386, 19854, 47731, 9900, 37836, '6', 36051, 63854, 26125, 53924, 24337, 52246, 14572, 42243, 4602, 40584, 2851, 30610, 58470, 20844, 56715, 19059, 46871, 9132, 36939, 7399, 35207, 63070, 25343, 61333, 23652, 51357, 13676, 41555, 12016, 39723, 2072, 29886, 57684, 28135, 55946, 18288, 46018, 8399, 44396, 6535, 34423, 62214, 32761, 60481, 49764, 45348, 9408, 39016, 3855, 33530, 30219, 58791, 22687, 52313, 17397, 13973, 43583, 6607, 36201, 5, 63401, 27490, 56855, 19889, 49501, 46316, 11142, 40745, 4802, 33179, 30074, 59596, 23668, 54034, 18081, 14921, 43512, 7347, 36949, 2027, 64136, 28270, 56771, 20861, 50189, 48066, 12144, 41483, 4525, 34133, 30949, 61338, 25385, 54974, 17815, 14647, 44241, 8239, 38661, 2744, 65093, 27999, 57533, 21590, 52219, 48773, 12855, 41436, 5411, 34854, 32646, 62263, 26137, 54710, 18753, 15590, 45976, 10051, 36843, 64672, 26962, 54760, 17042, 42809, 54369, 16854, 64892, 27208, 59305, 4928, 33000, 15761, 43350, 9972, 21453, 53102, 31965, 59488, 25866, 37549, 3697, 47881, 10473, 41998, 53685, 20183, 64053, 30670, 58563, 4150, 36233, 14715, 46677, 9207, 24397, 52456, 31157, 62805, 25261};
b = 3736149491671760014L;
}
@Override // com.google.firebase.messaging.zzf, android.app.Service
public void onCreate() {
int i = 2 % 2;
int i2 = c + 49;
e = i2 % 128;
int i3 = i2 % 2;
super.onCreate();
int i4 = c + 47;
e = i4 % 128;
if (i4 % 2 == 0) {
return;
}
Object obj = null;
obj.hashCode();
throw null;
}
public void onSendError(String str, Exception exc) {
int i = 2 % 2;
int i2 = c + 7;
e = i2 % 128;
if (i2 % 2 == 0) {
return;
}
Object obj = null;
obj.hashCode();
throw null;
}
public void onNewToken(String str) {
int i = 2 % 2;
int i2 = c + 77;
e = i2 % 128;
if (i2 % 2 != 0) {
int i3 = 80 / 0;
}
}
public void onMessageSent(String str) {
int i = 2 % 2;
int i2 = e + 105;
c = i2 % 128;
if (i2 % 2 == 0) {
throw null;
}
}
public void onMessageReceived(RemoteMessage remoteMessage) {
int i = 2 % 2;
int i2 = c + 97;
e = i2 % 128;
if (i2 % 2 != 0) {
throw null;
}
}
public void onDeletedMessages() {
int i = 2 % 2;
int i2 = e + 43;
c = i2 % 128;
int i3 = i2 % 2;
}
}