180 lines
7.1 KiB
Java
180 lines
7.1 KiB
Java
|
package com.google.firebase.iid;
|
||
|
|
||
|
import android.app.PendingIntent;
|
||
|
import android.content.Context;
|
||
|
import android.content.Intent;
|
||
|
import android.os.Bundle;
|
||
|
import android.os.Looper;
|
||
|
import android.os.Message;
|
||
|
import android.os.Messenger;
|
||
|
import android.os.Parcelable;
|
||
|
import com.google.android.gms.tasks.TaskCompletionSource;
|
||
|
import com.google.android.gms.tasks.Tasks;
|
||
|
import com.google.firebase.iid.zzj;
|
||
|
import com.huawei.hms.support.hianalytics.HiAnalyticsConstant;
|
||
|
import java.io.IOException;
|
||
|
import java.util.concurrent.ExecutionException;
|
||
|
import java.util.regex.Matcher;
|
||
|
import java.util.regex.Pattern;
|
||
|
import o.DFj;
|
||
|
|
||
|
/* loaded from: classes.dex */
|
||
|
final class zzau {
|
||
|
private static int zza;
|
||
|
private static PendingIntent zzb;
|
||
|
private final Context zzd;
|
||
|
private final zzao zze;
|
||
|
private Messenger zzg;
|
||
|
private zzj zzh;
|
||
|
private final DFj<String, TaskCompletionSource<Bundle>> zzc = new DFj<>();
|
||
|
private Messenger zzf = new Messenger(new zzax(this, Looper.getMainLooper()));
|
||
|
|
||
|
public zzau(Context context, zzao zzaoVar) {
|
||
|
this.zzd = context;
|
||
|
this.zze = zzaoVar;
|
||
|
}
|
||
|
|
||
|
/* JADX INFO: Access modifiers changed from: private */
|
||
|
public final void zza(Message message) {
|
||
|
if (message == null || !(message.obj instanceof Intent)) {
|
||
|
return;
|
||
|
}
|
||
|
Intent intent = (Intent) message.obj;
|
||
|
intent.setExtrasClassLoader(new zzj.zza());
|
||
|
if (intent.hasExtra("google.messenger")) {
|
||
|
Parcelable parcelableExtra = intent.getParcelableExtra("google.messenger");
|
||
|
if (parcelableExtra instanceof zzj) {
|
||
|
this.zzh = (zzj) parcelableExtra;
|
||
|
}
|
||
|
if (parcelableExtra instanceof Messenger) {
|
||
|
this.zzg = (Messenger) parcelableExtra;
|
||
|
}
|
||
|
}
|
||
|
Intent intent2 = (Intent) message.obj;
|
||
|
if ("com.google.android.c2dm.intent.REGISTRATION".equals(intent2.getAction())) {
|
||
|
String stringExtra = intent2.getStringExtra("registration_id");
|
||
|
if (stringExtra == null) {
|
||
|
stringExtra = intent2.getStringExtra("unregistered");
|
||
|
}
|
||
|
if (stringExtra == null) {
|
||
|
String stringExtra2 = intent2.getStringExtra("error");
|
||
|
if (stringExtra2 == null) {
|
||
|
intent2.getExtras();
|
||
|
return;
|
||
|
}
|
||
|
if (stringExtra2.startsWith(HiAnalyticsConstant.REPORT_VAL_SEPARATOR)) {
|
||
|
String[] split = stringExtra2.split("\\|");
|
||
|
if (split.length <= 2 || !"ID".equals(split[1])) {
|
||
|
return;
|
||
|
}
|
||
|
String str = split[2];
|
||
|
String str2 = split[3];
|
||
|
if (str2.startsWith(":")) {
|
||
|
str2 = str2.substring(1);
|
||
|
}
|
||
|
zza(str, intent2.putExtra("error", str2).getExtras());
|
||
|
return;
|
||
|
}
|
||
|
synchronized (this.zzc) {
|
||
|
for (int i = 0; i < this.zzc.size(); i++) {
|
||
|
zza((String) this.zzc.e[i << 1], intent2.getExtras());
|
||
|
}
|
||
|
}
|
||
|
return;
|
||
|
}
|
||
|
Matcher matcher = Pattern.compile("\\|ID\\|([^|]+)\\|:?+(.*)").matcher(stringExtra);
|
||
|
if (matcher.matches()) {
|
||
|
String group = matcher.group(1);
|
||
|
String group2 = matcher.group(2);
|
||
|
Bundle extras = intent2.getExtras();
|
||
|
extras.putString("registration_id", group2);
|
||
|
zza(group, extras);
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
private static void zza(Context context, Intent intent) {
|
||
|
synchronized (zzau.class) {
|
||
|
if (zzb == null) {
|
||
|
Intent intent2 = new Intent();
|
||
|
intent2.setPackage("com.google.example.invalidpackage");
|
||
|
zzb = PendingIntent.getBroadcast(context, 0, intent2, 0);
|
||
|
}
|
||
|
intent.putExtra("app", zzb);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
private final void zza(String str, Bundle bundle) {
|
||
|
synchronized (this.zzc) {
|
||
|
TaskCompletionSource<Bundle> remove = this.zzc.remove(str);
|
||
|
if (remove == null) {
|
||
|
return;
|
||
|
}
|
||
|
remove.setResult(bundle);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
/* JADX INFO: Access modifiers changed from: package-private */
|
||
|
public final Bundle zza(Bundle bundle) throws IOException {
|
||
|
if (this.zze.zze() >= 12000000) {
|
||
|
try {
|
||
|
return (Bundle) Tasks.await(zzab.zza(this.zzd).zzb(1, bundle));
|
||
|
} catch (InterruptedException | ExecutionException e) {
|
||
|
if ((e.getCause() instanceof zzam) && ((zzam) e.getCause()).zza() == 4) {
|
||
|
return zzb(bundle);
|
||
|
}
|
||
|
return null;
|
||
|
}
|
||
|
}
|
||
|
return zzb(bundle);
|
||
|
}
|
||
|
|
||
|
private final Bundle zzb(Bundle bundle) throws IOException {
|
||
|
Bundle zzc = zzc(bundle);
|
||
|
if (zzc == null || !zzc.containsKey("google.messenger")) {
|
||
|
return zzc;
|
||
|
}
|
||
|
Bundle zzc2 = zzc(bundle);
|
||
|
if (zzc2 == null || !zzc2.containsKey("google.messenger")) {
|
||
|
return zzc2;
|
||
|
}
|
||
|
return null;
|
||
|
}
|
||
|
|
||
|
private static String zza() {
|
||
|
String num;
|
||
|
synchronized (zzau.class) {
|
||
|
int i = zza;
|
||
|
zza = i + 1;
|
||
|
num = Integer.toString(i);
|
||
|
}
|
||
|
return num;
|
||
|
}
|
||
|
|
||
|
/* JADX WARN: Multi-variable type inference failed */
|
||
|
/* JADX WARN: Removed duplicated region for block: B:25:0x00b8 A[EXC_TOP_SPLITTER, SYNTHETIC] */
|
||
|
/* JADX WARN: Type inference failed for: r1v0, types: [com.google.android.gms.tasks.TaskCompletionSource, java.lang.Object] */
|
||
|
/* JADX WARN: Type inference failed for: r1v1 */
|
||
|
/* JADX WARN: Type inference failed for: r1v6, types: [java.util.concurrent.TimeUnit] */
|
||
|
/* JADX WARN: Type inference failed for: r1v8 */
|
||
|
/* JADX WARN: Type inference failed for: r2v3, types: [android.content.Intent, java.lang.Object] */
|
||
|
/* JADX WARN: Type inference failed for: r2v4 */
|
||
|
/* JADX WARN: Type inference failed for: r2v6 */
|
||
|
/* JADX WARN: Type inference failed for: r2v8, types: [android.content.Intent] */
|
||
|
/* JADX WARN: Type inference failed for: r7v20, types: [android.content.Context] */
|
||
|
/* JADX WARN: Type inference failed for: r7v21, types: [android.content.Context] */
|
||
|
/* JADX WARN: Unsupported multi-entry loop pattern (BACK_EDGE: B:20:0x009c -> B:21:0x00a7). Please report as a decompilation issue!!! */
|
||
|
/* JADX WARN: Unsupported multi-entry loop pattern (BACK_EDGE: B:49:0x00a2 -> B:21:0x00a7). Please report as a decompilation issue!!! */
|
||
|
/*
|
||
|
Code decompiled incorrectly, please refer to instructions dump.
|
||
|
To view partially-correct add '--show-bad-code' argument
|
||
|
*/
|
||
|
private final android.os.Bundle zzc(android.os.Bundle r7) throws java.io.IOException {
|
||
|
/*
|
||
|
Method dump skipped, instructions count: 235
|
||
|
To view this dump add '--comments-level debug' option
|
||
|
*/
|
||
|
throw new UnsupportedOperationException("Method not decompiled: com.google.firebase.iid.zzau.zzc(android.os.Bundle):android.os.Bundle");
|
||
|
}
|
||
|
}
|