Initial commit
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
package com.google.firebase;
|
||||
|
||||
/* compiled from: com.google.firebase:firebase-common@@16.0.2 */
|
||||
/* loaded from: classes.dex */
|
||||
public final class DataCollectionDefaultChange {
|
||||
public final boolean a;
|
||||
}
|
@@ -0,0 +1,8 @@
|
||||
package com.google.firebase;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class FirebaseApiNotAvailableException extends FirebaseException {
|
||||
public FirebaseApiNotAvailableException(String str) {
|
||||
super(str);
|
||||
}
|
||||
}
|
334
sources/com/google/firebase/FirebaseApp.java
Normal file
334
sources/com/google/firebase/FirebaseApp.java
Normal file
@@ -0,0 +1,334 @@
|
||||
package com.google.firebase;
|
||||
|
||||
import android.annotation.TargetApi;
|
||||
import android.app.Application;
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.IntentFilter;
|
||||
import android.content.SharedPreferences;
|
||||
import android.content.pm.ApplicationInfo;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import android.util.Log;
|
||||
import androidx.collection.ArrayMap;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import com.google.android.gms.common.api.internal.BackgroundDetector;
|
||||
import com.google.android.gms.common.internal.Objects;
|
||||
import com.google.android.gms.common.internal.Preconditions;
|
||||
import com.google.android.gms.common.util.PlatformVersion;
|
||||
import com.google.android.gms.common.util.ProcessUtils;
|
||||
import com.google.firebase.components.Component;
|
||||
import com.google.firebase.components.zzf;
|
||||
import com.ubtrobot.jimu.robotapi.PeripheralType;
|
||||
import com.unity3d.ads.metadata.MediationMetaData;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
import java.lang.reflect.Modifier;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.CopyOnWriteArrayList;
|
||||
import java.util.concurrent.Executor;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
import java.util.concurrent.atomic.AtomicReference;
|
||||
|
||||
/* compiled from: com.google.firebase:firebase-common@@16.0.2 */
|
||||
/* loaded from: classes.dex */
|
||||
public class FirebaseApp {
|
||||
private static final List<String> j = Arrays.asList("com.google.firebase.auth.FirebaseAuth", "com.google.firebase.iid.FirebaseInstanceId");
|
||||
private static final List<String> k = Collections.singletonList("com.google.firebase.crash.FirebaseCrash");
|
||||
private static final List<String> l = Arrays.asList("com.google.android.gms.measurement.AppMeasurement");
|
||||
private static final List<String> m = Arrays.asList(new String[0]);
|
||||
private static final Set<String> n = Collections.emptySet();
|
||||
private static final Object o = new Object();
|
||||
private static final Executor p = new zzb(0);
|
||||
static final Map<String, FirebaseApp> q = new ArrayMap();
|
||||
private final Context a;
|
||||
private final String b;
|
||||
private final FirebaseOptions c;
|
||||
private final zzf d;
|
||||
private final SharedPreferences e;
|
||||
private final AtomicBoolean f = new AtomicBoolean(false);
|
||||
private final AtomicBoolean g = new AtomicBoolean();
|
||||
private final AtomicBoolean h;
|
||||
private final List<BackgroundStateChangeListener> i;
|
||||
|
||||
/* compiled from: com.google.firebase:firebase-common@@16.0.2 */
|
||||
public interface BackgroundStateChangeListener {
|
||||
void a(boolean z);
|
||||
}
|
||||
|
||||
/* compiled from: com.google.firebase:firebase-common@@16.0.2 */
|
||||
@Deprecated
|
||||
public interface IdTokenListenersCountChangedListener {
|
||||
}
|
||||
|
||||
/* compiled from: com.google.firebase:firebase-common@@16.0.2 */
|
||||
static class zzb implements Executor {
|
||||
private static final Handler a = new Handler(Looper.getMainLooper());
|
||||
|
||||
private zzb() {
|
||||
}
|
||||
|
||||
@Override // java.util.concurrent.Executor
|
||||
public final void execute(Runnable runnable) {
|
||||
a.post(runnable);
|
||||
}
|
||||
|
||||
/* synthetic */ zzb(byte b) {
|
||||
this();
|
||||
}
|
||||
}
|
||||
|
||||
/* compiled from: com.google.firebase:firebase-common@@16.0.2 */
|
||||
@TargetApi(24)
|
||||
static class zzc extends BroadcastReceiver {
|
||||
private static AtomicReference<zzc> b = new AtomicReference<>();
|
||||
private final Context a;
|
||||
|
||||
private zzc(Context context) {
|
||||
this.a = context;
|
||||
}
|
||||
|
||||
static /* synthetic */ void a(Context context) {
|
||||
if (b.get() == null) {
|
||||
zzc zzcVar = new zzc(context);
|
||||
if (b.compareAndSet(null, zzcVar)) {
|
||||
context.registerReceiver(zzcVar, new IntentFilter("android.intent.action.USER_UNLOCKED"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.content.BroadcastReceiver
|
||||
public final void onReceive(Context context, Intent intent) {
|
||||
synchronized (FirebaseApp.o) {
|
||||
Iterator<FirebaseApp> it = FirebaseApp.q.values().iterator();
|
||||
while (it.hasNext()) {
|
||||
it.next().j();
|
||||
}
|
||||
}
|
||||
this.a.unregisterReceiver(this);
|
||||
}
|
||||
}
|
||||
|
||||
private FirebaseApp(Context context, String str, FirebaseOptions firebaseOptions) {
|
||||
new CopyOnWriteArrayList();
|
||||
this.i = new CopyOnWriteArrayList();
|
||||
new CopyOnWriteArrayList();
|
||||
Preconditions.a(context);
|
||||
this.a = context;
|
||||
Preconditions.b(str);
|
||||
this.b = str;
|
||||
Preconditions.a(firebaseOptions);
|
||||
this.c = firebaseOptions;
|
||||
new com.google.firebase.internal.zza();
|
||||
this.e = context.getSharedPreferences("com.google.firebase.common.prefs", 0);
|
||||
this.h = new AtomicBoolean(h());
|
||||
this.d = new zzf(p, Component.AnonymousClass1.a(context).a(), Component.a(context, Context.class, new Class[0]), Component.a(this, FirebaseApp.class, new Class[0]), Component.a(firebaseOptions, FirebaseOptions.class, new Class[0]));
|
||||
}
|
||||
|
||||
public static FirebaseApp f() {
|
||||
FirebaseApp firebaseApp;
|
||||
synchronized (o) {
|
||||
firebaseApp = q.get("[DEFAULT]");
|
||||
if (firebaseApp == null) {
|
||||
throw new IllegalStateException("Default FirebaseApp is not initialized in this process " + ProcessUtils.a() + ". Make sure to call FirebaseApp.initializeApp(Context) first.");
|
||||
}
|
||||
}
|
||||
return firebaseApp;
|
||||
}
|
||||
|
||||
private boolean h() {
|
||||
ApplicationInfo applicationInfo;
|
||||
if (this.e.contains("firebase_data_collection_default_enabled")) {
|
||||
return this.e.getBoolean("firebase_data_collection_default_enabled", true);
|
||||
}
|
||||
try {
|
||||
PackageManager packageManager = this.a.getPackageManager();
|
||||
if (packageManager != null && (applicationInfo = packageManager.getApplicationInfo(this.a.getPackageName(), PeripheralType.SERVO)) != null && applicationInfo.metaData != null && applicationInfo.metaData.containsKey("firebase_data_collection_default_enabled")) {
|
||||
return applicationInfo.metaData.getBoolean("firebase_data_collection_default_enabled");
|
||||
}
|
||||
} catch (PackageManager.NameNotFoundException unused) {
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private void i() {
|
||||
Preconditions.b(!this.g.get(), "FirebaseApp was deleted");
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: private */
|
||||
public void j() {
|
||||
boolean c = ContextCompat.c(this.a);
|
||||
if (c) {
|
||||
zzc.a(this.a);
|
||||
} else {
|
||||
this.d.a(e());
|
||||
}
|
||||
a(FirebaseApp.class, this, j, c);
|
||||
if (e()) {
|
||||
a(FirebaseApp.class, this, k, c);
|
||||
a(Context.class, this.a, l, c);
|
||||
}
|
||||
}
|
||||
|
||||
public FirebaseOptions c() {
|
||||
i();
|
||||
return this.c;
|
||||
}
|
||||
|
||||
public boolean d() {
|
||||
i();
|
||||
return this.h.get();
|
||||
}
|
||||
|
||||
public boolean e() {
|
||||
return "[DEFAULT]".equals(b());
|
||||
}
|
||||
|
||||
public boolean equals(Object obj) {
|
||||
if (obj instanceof FirebaseApp) {
|
||||
return this.b.equals(((FirebaseApp) obj).b());
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public int hashCode() {
|
||||
return this.b.hashCode();
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
Objects.ToStringHelper a = Objects.a(this);
|
||||
a.a(MediationMetaData.KEY_NAME, this.b);
|
||||
a.a("options", this.c);
|
||||
return a.toString();
|
||||
}
|
||||
|
||||
public String b() {
|
||||
i();
|
||||
return this.b;
|
||||
}
|
||||
|
||||
public Context a() {
|
||||
i();
|
||||
return this.a;
|
||||
}
|
||||
|
||||
/* compiled from: com.google.firebase:firebase-common@@16.0.2 */
|
||||
@TargetApi(14)
|
||||
static class zza implements BackgroundDetector.BackgroundStateChangeListener {
|
||||
private static AtomicReference<zza> a = new AtomicReference<>();
|
||||
|
||||
private zza() {
|
||||
}
|
||||
|
||||
@Override // com.google.android.gms.common.api.internal.BackgroundDetector.BackgroundStateChangeListener
|
||||
public final void a(boolean z) {
|
||||
synchronized (FirebaseApp.o) {
|
||||
Iterator it = new ArrayList(FirebaseApp.q.values()).iterator();
|
||||
while (it.hasNext()) {
|
||||
FirebaseApp firebaseApp = (FirebaseApp) it.next();
|
||||
if (firebaseApp.f.get()) {
|
||||
firebaseApp.a(z);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static /* synthetic */ void a(Context context) {
|
||||
if (PlatformVersion.a() && (context.getApplicationContext() instanceof Application)) {
|
||||
Application application = (Application) context.getApplicationContext();
|
||||
if (a.get() == null) {
|
||||
zza zzaVar = new zza();
|
||||
if (a.compareAndSet(null, zzaVar)) {
|
||||
BackgroundDetector.a(application);
|
||||
BackgroundDetector.b().a(zzaVar);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static FirebaseApp a(Context context) {
|
||||
synchronized (o) {
|
||||
if (q.containsKey("[DEFAULT]")) {
|
||||
return f();
|
||||
}
|
||||
FirebaseOptions a = FirebaseOptions.a(context);
|
||||
if (a == null) {
|
||||
Log.d("FirebaseApp", "Default FirebaseApp failed to initialize because no default options were found. This usually means that com.google.gms:google-services was not applied to your gradle project.");
|
||||
return null;
|
||||
}
|
||||
return a(context, a);
|
||||
}
|
||||
}
|
||||
|
||||
public static FirebaseApp a(Context context, FirebaseOptions firebaseOptions) {
|
||||
return a(context, firebaseOptions, "[DEFAULT]");
|
||||
}
|
||||
|
||||
public static FirebaseApp a(Context context, FirebaseOptions firebaseOptions, String str) {
|
||||
FirebaseApp firebaseApp;
|
||||
zza.a(context);
|
||||
String trim = str.trim();
|
||||
if (context.getApplicationContext() != null) {
|
||||
context = context.getApplicationContext();
|
||||
}
|
||||
synchronized (o) {
|
||||
Preconditions.b(!q.containsKey(trim), "FirebaseApp name " + trim + " already exists!");
|
||||
Preconditions.a(context, "Application context cannot be null.");
|
||||
firebaseApp = new FirebaseApp(context, trim, firebaseOptions);
|
||||
q.put(trim, firebaseApp);
|
||||
}
|
||||
firebaseApp.j();
|
||||
return firebaseApp;
|
||||
}
|
||||
|
||||
public <T> T a(Class<T> cls) {
|
||||
i();
|
||||
return (T) this.d.a(cls);
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: private */
|
||||
public void a(boolean z) {
|
||||
Log.d("FirebaseApp", "Notifying background state change listeners.");
|
||||
Iterator<BackgroundStateChangeListener> it = this.i.iterator();
|
||||
while (it.hasNext()) {
|
||||
it.next().a(z);
|
||||
}
|
||||
}
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
private static <T> void a(Class<T> cls, T t, Iterable<String> iterable, boolean z) {
|
||||
for (String str : iterable) {
|
||||
if (z) {
|
||||
try {
|
||||
} catch (ClassNotFoundException unused) {
|
||||
if (n.contains(str)) {
|
||||
throw new IllegalStateException(str + " is missing, but is required. Check if it has been removed by Proguard.");
|
||||
}
|
||||
Log.d("FirebaseApp", str + " is not linked. Skipping initialization.");
|
||||
} catch (IllegalAccessException e) {
|
||||
Log.wtf("FirebaseApp", "Failed to initialize " + str, e);
|
||||
} catch (NoSuchMethodException unused2) {
|
||||
throw new IllegalStateException(str + "#getInstance has been removed by Proguard. Add keep rule to prevent it.");
|
||||
} catch (InvocationTargetException e2) {
|
||||
Log.wtf("FirebaseApp", "Firebase API initialization failure.", e2);
|
||||
}
|
||||
if (m.contains(str)) {
|
||||
}
|
||||
}
|
||||
Method method = Class.forName(str).getMethod("getInstance", cls);
|
||||
int modifiers = method.getModifiers();
|
||||
if (Modifier.isPublic(modifiers) && Modifier.isStatic(modifiers)) {
|
||||
method.invoke(null, t);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
22
sources/com/google/firebase/FirebaseException.java
Normal file
22
sources/com/google/firebase/FirebaseException.java
Normal file
@@ -0,0 +1,22 @@
|
||||
package com.google.firebase;
|
||||
|
||||
import com.google.android.gms.common.internal.Preconditions;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class FirebaseException extends Exception {
|
||||
@Deprecated
|
||||
protected FirebaseException() {
|
||||
}
|
||||
|
||||
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
|
||||
public FirebaseException(String str) {
|
||||
super(str);
|
||||
Preconditions.a(str, (Object) "Detail message must not be empty");
|
||||
}
|
||||
|
||||
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
|
||||
public FirebaseException(String str, Throwable th) {
|
||||
super(str, th);
|
||||
Preconditions.a(str, (Object) "Detail message must not be empty");
|
||||
}
|
||||
}
|
@@ -0,0 +1,9 @@
|
||||
package com.google.firebase;
|
||||
|
||||
/* compiled from: com.google.firebase:firebase-common@@16.0.2 */
|
||||
/* loaded from: classes.dex */
|
||||
public class FirebaseNetworkException extends FirebaseException {
|
||||
public FirebaseNetworkException(String str) {
|
||||
super(str);
|
||||
}
|
||||
}
|
71
sources/com/google/firebase/FirebaseOptions.java
Normal file
71
sources/com/google/firebase/FirebaseOptions.java
Normal file
@@ -0,0 +1,71 @@
|
||||
package com.google.firebase;
|
||||
|
||||
import android.content.Context;
|
||||
import android.text.TextUtils;
|
||||
import com.google.android.gms.common.internal.Objects;
|
||||
import com.google.android.gms.common.internal.Preconditions;
|
||||
import com.google.android.gms.common.internal.StringResourceValueReader;
|
||||
import com.google.android.gms.common.util.Strings;
|
||||
|
||||
/* compiled from: com.google.firebase:firebase-common@@16.0.2 */
|
||||
/* loaded from: classes.dex */
|
||||
public final class FirebaseOptions {
|
||||
private final String a;
|
||||
private final String b;
|
||||
private final String c;
|
||||
private final String d;
|
||||
private final String e;
|
||||
private final String f;
|
||||
private final String g;
|
||||
|
||||
private FirebaseOptions(String str, String str2, String str3, String str4, String str5, String str6, String str7) {
|
||||
Preconditions.b(!Strings.a(str), "ApplicationId must be set.");
|
||||
this.b = str;
|
||||
this.a = str2;
|
||||
this.c = str3;
|
||||
this.d = str4;
|
||||
this.e = str5;
|
||||
this.f = str6;
|
||||
this.g = str7;
|
||||
}
|
||||
|
||||
public static FirebaseOptions a(Context context) {
|
||||
StringResourceValueReader stringResourceValueReader = new StringResourceValueReader(context);
|
||||
String a = stringResourceValueReader.a("google_app_id");
|
||||
if (TextUtils.isEmpty(a)) {
|
||||
return null;
|
||||
}
|
||||
return new FirebaseOptions(a, stringResourceValueReader.a("google_api_key"), stringResourceValueReader.a("firebase_database_url"), stringResourceValueReader.a("ga_trackingId"), stringResourceValueReader.a("gcm_defaultSenderId"), stringResourceValueReader.a("google_storage_bucket"), stringResourceValueReader.a("project_id"));
|
||||
}
|
||||
|
||||
public final String b() {
|
||||
return this.e;
|
||||
}
|
||||
|
||||
public final boolean equals(Object obj) {
|
||||
if (!(obj instanceof FirebaseOptions)) {
|
||||
return false;
|
||||
}
|
||||
FirebaseOptions firebaseOptions = (FirebaseOptions) obj;
|
||||
return Objects.a(this.b, firebaseOptions.b) && Objects.a(this.a, firebaseOptions.a) && Objects.a(this.c, firebaseOptions.c) && Objects.a(this.d, firebaseOptions.d) && Objects.a(this.e, firebaseOptions.e) && Objects.a(this.f, firebaseOptions.f) && Objects.a(this.g, firebaseOptions.g);
|
||||
}
|
||||
|
||||
public final int hashCode() {
|
||||
return Objects.a(this.b, this.a, this.c, this.d, this.e, this.f, this.g);
|
||||
}
|
||||
|
||||
public final String toString() {
|
||||
Objects.ToStringHelper a = Objects.a(this);
|
||||
a.a("applicationId", this.b);
|
||||
a.a("apiKey", this.a);
|
||||
a.a("databaseUrl", this.c);
|
||||
a.a("gcmSenderId", this.e);
|
||||
a.a("storageBucket", this.f);
|
||||
a.a("projectId", this.g);
|
||||
return a.toString();
|
||||
}
|
||||
|
||||
public final String a() {
|
||||
return this.b;
|
||||
}
|
||||
}
|
@@ -0,0 +1,9 @@
|
||||
package com.google.firebase;
|
||||
|
||||
/* compiled from: com.google.firebase:firebase-common@@16.0.2 */
|
||||
/* loaded from: classes.dex */
|
||||
public class FirebaseTooManyRequestsException extends FirebaseException {
|
||||
public FirebaseTooManyRequestsException(String str) {
|
||||
super(str);
|
||||
}
|
||||
}
|
56
sources/com/google/firebase/analytics/FirebaseAnalytics.java
Normal file
56
sources/com/google/firebase/analytics/FirebaseAnalytics.java
Normal file
@@ -0,0 +1,56 @@
|
||||
package com.google.firebase.analytics;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import androidx.annotation.Keep;
|
||||
import com.google.android.gms.common.internal.Preconditions;
|
||||
import com.google.android.gms.measurement.internal.zzan;
|
||||
import com.google.android.gms.measurement.internal.zzbw;
|
||||
import com.google.android.gms.measurement.internal.zzn;
|
||||
import com.google.firebase.iid.FirebaseInstanceId;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class FirebaseAnalytics {
|
||||
private static volatile FirebaseAnalytics b;
|
||||
private final zzbw a;
|
||||
|
||||
private FirebaseAnalytics(zzbw zzbwVar) {
|
||||
Preconditions.a(zzbwVar);
|
||||
this.a = zzbwVar;
|
||||
}
|
||||
|
||||
@Keep
|
||||
public static FirebaseAnalytics getInstance(Context context) {
|
||||
if (b == null) {
|
||||
synchronized (FirebaseAnalytics.class) {
|
||||
if (b == null) {
|
||||
b = new FirebaseAnalytics(zzbw.a(context, (zzan) null));
|
||||
}
|
||||
}
|
||||
}
|
||||
return b;
|
||||
}
|
||||
|
||||
public final void a(String str, Bundle bundle) {
|
||||
this.a.y().a(str, bundle);
|
||||
}
|
||||
|
||||
@Keep
|
||||
public final String getFirebaseInstanceId() {
|
||||
return FirebaseInstanceId.j().a();
|
||||
}
|
||||
|
||||
@Keep
|
||||
public final void setCurrentScreen(Activity activity, String str, String str2) {
|
||||
if (zzn.a()) {
|
||||
this.a.n().a(activity, str, str2);
|
||||
} else {
|
||||
this.a.e().w().a("setCurrentScreen must be called from the main thread");
|
||||
}
|
||||
}
|
||||
|
||||
public final void a(boolean z) {
|
||||
this.a.y().a(z);
|
||||
}
|
||||
}
|
@@ -0,0 +1,5 @@
|
||||
package com.google.firebase.analytics.connector;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public interface AnalyticsConnector {
|
||||
}
|
@@ -0,0 +1,52 @@
|
||||
package com.google.firebase.analytics.connector;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import com.google.android.gms.common.internal.Preconditions;
|
||||
import com.google.android.gms.measurement.AppMeasurement;
|
||||
import com.google.android.gms.measurement.internal.zzan;
|
||||
import com.google.android.gms.measurement.internal.zzbw;
|
||||
import com.google.firebase.DataCollectionDefaultChange;
|
||||
import com.google.firebase.FirebaseApp;
|
||||
import com.google.firebase.events.Event;
|
||||
import com.google.firebase.events.Subscriber;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class AnalyticsConnectorImpl implements AnalyticsConnector {
|
||||
private static volatile AnalyticsConnector b;
|
||||
private final AppMeasurement a;
|
||||
|
||||
private AnalyticsConnectorImpl(AppMeasurement appMeasurement) {
|
||||
Preconditions.a(appMeasurement);
|
||||
this.a = appMeasurement;
|
||||
new ConcurrentHashMap();
|
||||
}
|
||||
|
||||
public static AnalyticsConnector a(FirebaseApp firebaseApp, Context context, Subscriber subscriber) {
|
||||
Preconditions.a(firebaseApp);
|
||||
Preconditions.a(context);
|
||||
Preconditions.a(subscriber);
|
||||
Preconditions.a(context.getApplicationContext());
|
||||
if (b == null) {
|
||||
synchronized (AnalyticsConnectorImpl.class) {
|
||||
if (b == null) {
|
||||
Bundle bundle = new Bundle(1);
|
||||
if (firebaseApp.e()) {
|
||||
subscriber.a(DataCollectionDefaultChange.class, zza.a, zzb.a);
|
||||
bundle.putBoolean("dataCollectionDefaultEnabled", firebaseApp.d());
|
||||
}
|
||||
b = new AnalyticsConnectorImpl(zzbw.a(context, zzan.a(bundle)).y());
|
||||
}
|
||||
}
|
||||
}
|
||||
return b;
|
||||
}
|
||||
|
||||
static final /* synthetic */ void a(Event event) {
|
||||
boolean z = ((DataCollectionDefaultChange) event.a()).a;
|
||||
synchronized (AnalyticsConnectorImpl.class) {
|
||||
((AnalyticsConnectorImpl) b).a.b(z);
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,30 @@
|
||||
package com.google.firebase.analytics.connector.internal;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import androidx.annotation.Keep;
|
||||
import com.google.firebase.FirebaseApp;
|
||||
import com.google.firebase.analytics.connector.AnalyticsConnector;
|
||||
import com.google.firebase.components.Component;
|
||||
import com.google.firebase.components.ComponentRegistrar;
|
||||
import com.google.firebase.components.Dependency;
|
||||
import com.google.firebase.events.Subscriber;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
@Keep
|
||||
/* loaded from: classes.dex */
|
||||
public class AnalyticsConnectorRegistrar implements ComponentRegistrar {
|
||||
@Override // com.google.firebase.components.ComponentRegistrar
|
||||
@Keep
|
||||
@SuppressLint({"MissingPermission"})
|
||||
public List<Component<?>> getComponents() {
|
||||
Component.Builder a = Component.a(AnalyticsConnector.class);
|
||||
a.a(Dependency.a(FirebaseApp.class));
|
||||
a.a(Dependency.a(Context.class));
|
||||
a.a(Dependency.a(Subscriber.class));
|
||||
a.a(zzb.a);
|
||||
a.c();
|
||||
return Collections.singletonList(a.b());
|
||||
}
|
||||
}
|
@@ -0,0 +1,21 @@
|
||||
package com.google.firebase.analytics.connector.internal;
|
||||
|
||||
import android.content.Context;
|
||||
import com.google.firebase.FirebaseApp;
|
||||
import com.google.firebase.analytics.connector.AnalyticsConnectorImpl;
|
||||
import com.google.firebase.components.ComponentContainer;
|
||||
import com.google.firebase.components.ComponentFactory;
|
||||
import com.google.firebase.events.Subscriber;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
final /* synthetic */ class zzb implements ComponentFactory {
|
||||
static final ComponentFactory a = new zzb();
|
||||
|
||||
private zzb() {
|
||||
}
|
||||
|
||||
@Override // com.google.firebase.components.ComponentFactory
|
||||
public final Object a(ComponentContainer componentContainer) {
|
||||
return AnalyticsConnectorImpl.a((FirebaseApp) componentContainer.a(FirebaseApp.class), (Context) componentContainer.a(Context.class), (Subscriber) componentContainer.a(Subscriber.class));
|
||||
}
|
||||
}
|
16
sources/com/google/firebase/analytics/connector/zza.java
Normal file
16
sources/com/google/firebase/analytics/connector/zza.java
Normal file
@@ -0,0 +1,16 @@
|
||||
package com.google.firebase.analytics.connector;
|
||||
|
||||
import java.util.concurrent.Executor;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
final /* synthetic */ class zza implements Executor {
|
||||
static final Executor a = new zza();
|
||||
|
||||
private zza() {
|
||||
}
|
||||
|
||||
@Override // java.util.concurrent.Executor
|
||||
public final void execute(Runnable runnable) {
|
||||
runnable.run();
|
||||
}
|
||||
}
|
17
sources/com/google/firebase/analytics/connector/zzb.java
Normal file
17
sources/com/google/firebase/analytics/connector/zzb.java
Normal file
@@ -0,0 +1,17 @@
|
||||
package com.google.firebase.analytics.connector;
|
||||
|
||||
import com.google.firebase.events.Event;
|
||||
import com.google.firebase.events.EventHandler;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
final /* synthetic */ class zzb implements EventHandler {
|
||||
static final EventHandler a = new zzb();
|
||||
|
||||
private zzb() {
|
||||
}
|
||||
|
||||
@Override // com.google.firebase.events.EventHandler
|
||||
public final void a(Event event) {
|
||||
AnalyticsConnectorImpl.a(event);
|
||||
}
|
||||
}
|
20
sources/com/google/firebase/auth/FirebaseAuthException.java
Normal file
20
sources/com/google/firebase/auth/FirebaseAuthException.java
Normal file
@@ -0,0 +1,20 @@
|
||||
package com.google.firebase.auth;
|
||||
|
||||
import com.google.android.gms.common.internal.Preconditions;
|
||||
import com.google.firebase.FirebaseException;
|
||||
|
||||
/* compiled from: com.google.firebase:firebase-common@@16.0.2 */
|
||||
/* loaded from: classes.dex */
|
||||
public class FirebaseAuthException extends FirebaseException {
|
||||
private final String zza;
|
||||
|
||||
public FirebaseAuthException(String str, String str2) {
|
||||
super(str2);
|
||||
Preconditions.b(str);
|
||||
this.zza = str;
|
||||
}
|
||||
|
||||
public String getErrorCode() {
|
||||
return this.zza;
|
||||
}
|
||||
}
|
243
sources/com/google/firebase/components/Component.java
Normal file
243
sources/com/google/firebase/components/Component.java
Normal file
@@ -0,0 +1,243 @@
|
||||
package com.google.firebase.components;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.Log;
|
||||
import com.google.android.gms.common.internal.Preconditions;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
/* compiled from: com.google.firebase:firebase-common@@16.0.2 */
|
||||
/* loaded from: classes.dex */
|
||||
public final class Component<T> {
|
||||
private final Set<Class<? super T>> a;
|
||||
private final Set<Dependency> b;
|
||||
private final int c;
|
||||
private final ComponentFactory<T> d;
|
||||
private final Set<Class<?>> e;
|
||||
|
||||
/* compiled from: com.google.firebase:firebase-common@@16.0.2 */
|
||||
/* renamed from: com.google.firebase.components.Component$1, reason: invalid class name */
|
||||
public static /* synthetic */ class AnonymousClass1<T> {
|
||||
private final T a;
|
||||
private final zze<T> b;
|
||||
|
||||
private AnonymousClass1(T t, zze<T> zzeVar) {
|
||||
this.a = t;
|
||||
this.b = zzeVar;
|
||||
}
|
||||
|
||||
public static AnonymousClass1<Context> a(Context context) {
|
||||
return new AnonymousClass1<>(context, new zzd((byte) 0));
|
||||
}
|
||||
|
||||
private static List<ComponentRegistrar> b(List<String> list) {
|
||||
ArrayList arrayList = new ArrayList();
|
||||
for (String str : list) {
|
||||
try {
|
||||
Class<?> cls = Class.forName(str);
|
||||
if (ComponentRegistrar.class.isAssignableFrom(cls)) {
|
||||
arrayList.add((ComponentRegistrar) cls.getDeclaredConstructor(new Class[0]).newInstance(new Object[0]));
|
||||
} else {
|
||||
Log.w("ComponentDiscovery", String.format("Class %s is not an instance of %s", str, "com.google.firebase.components.ComponentRegistrar"));
|
||||
}
|
||||
} catch (ClassNotFoundException e) {
|
||||
Log.w("ComponentDiscovery", String.format("Class %s is not an found.", str), e);
|
||||
} catch (IllegalAccessException e2) {
|
||||
Log.w("ComponentDiscovery", String.format("Could not instantiate %s.", str), e2);
|
||||
} catch (InstantiationException e3) {
|
||||
Log.w("ComponentDiscovery", String.format("Could not instantiate %s.", str), e3);
|
||||
} catch (NoSuchMethodException e4) {
|
||||
Log.w("ComponentDiscovery", String.format("Could not instantiate %s", str), e4);
|
||||
} catch (InvocationTargetException e5) {
|
||||
Log.w("ComponentDiscovery", String.format("Could not instantiate %s", str), e5);
|
||||
}
|
||||
}
|
||||
return arrayList;
|
||||
}
|
||||
|
||||
public List<ComponentRegistrar> a() {
|
||||
return b(this.b.a(this.a));
|
||||
}
|
||||
|
||||
static List<Component<?>> a(List<Component<?>> list) {
|
||||
zzg zzgVar;
|
||||
HashMap hashMap = new HashMap(list.size());
|
||||
for (Component<?> component : list) {
|
||||
zzg zzgVar2 = new zzg(component);
|
||||
for (Class<? super Object> cls : component.a()) {
|
||||
if (hashMap.put(cls, zzgVar2) != null) {
|
||||
throw new IllegalArgumentException(String.format("Multiple components provide %s.", cls));
|
||||
}
|
||||
}
|
||||
}
|
||||
for (zzg zzgVar3 : hashMap.values()) {
|
||||
for (Dependency dependency : zzgVar3.b().b()) {
|
||||
if (dependency.c() && (zzgVar = (zzg) hashMap.get(dependency.a())) != null) {
|
||||
zzgVar3.a(zzgVar);
|
||||
zzgVar.b(zzgVar3);
|
||||
}
|
||||
}
|
||||
}
|
||||
HashSet<zzg> hashSet = new HashSet(hashMap.values());
|
||||
Set<zzg> a = a(hashSet);
|
||||
ArrayList arrayList = new ArrayList();
|
||||
while (!a.isEmpty()) {
|
||||
zzg next = a.iterator().next();
|
||||
a.remove(next);
|
||||
arrayList.add(next.b());
|
||||
for (zzg zzgVar4 : next.a()) {
|
||||
zzgVar4.c(next);
|
||||
if (zzgVar4.c()) {
|
||||
a.add(zzgVar4);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (arrayList.size() == list.size()) {
|
||||
Collections.reverse(arrayList);
|
||||
return arrayList;
|
||||
}
|
||||
ArrayList arrayList2 = new ArrayList();
|
||||
for (zzg zzgVar5 : hashSet) {
|
||||
if (!zzgVar5.c() && !zzgVar5.d()) {
|
||||
arrayList2.add(zzgVar5.b());
|
||||
}
|
||||
}
|
||||
throw new DependencyCycleException(arrayList2);
|
||||
}
|
||||
|
||||
private static Set<zzg> a(Set<zzg> set) {
|
||||
HashSet hashSet = new HashSet();
|
||||
for (zzg zzgVar : set) {
|
||||
if (zzgVar.c()) {
|
||||
hashSet.add(zzgVar);
|
||||
}
|
||||
}
|
||||
return hashSet;
|
||||
}
|
||||
}
|
||||
|
||||
/* compiled from: com.google.firebase:firebase-common@@16.0.2 */
|
||||
public static class Builder<T> {
|
||||
private final Set<Class<? super T>> a;
|
||||
private final Set<Dependency> b;
|
||||
private int c;
|
||||
private ComponentFactory<T> d;
|
||||
private Set<Class<?>> e;
|
||||
|
||||
/* synthetic */ Builder(Class cls, Class[] clsArr, byte b) {
|
||||
this(cls, clsArr);
|
||||
}
|
||||
|
||||
public Builder<T> a(Dependency dependency) {
|
||||
Preconditions.a(dependency, "Null dependency");
|
||||
Preconditions.a(!this.a.contains(dependency.a()), "Components are not allowed to depend on interfaces they themselves provide.");
|
||||
this.b.add(dependency);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Component<T> b() {
|
||||
Preconditions.b(this.d != null, "Missing required property: factory.");
|
||||
return new Component<>(new HashSet(this.a), new HashSet(this.b), this.c, this.d, this.e, (byte) 0);
|
||||
}
|
||||
|
||||
public Builder<T> c() {
|
||||
a(2);
|
||||
return this;
|
||||
}
|
||||
|
||||
private Builder(Class<T> cls, Class<? super T>... clsArr) {
|
||||
this.a = new HashSet();
|
||||
this.b = new HashSet();
|
||||
this.c = 0;
|
||||
this.e = new HashSet();
|
||||
Preconditions.a(cls, "Null interface");
|
||||
this.a.add(cls);
|
||||
for (Class<? super T> cls2 : clsArr) {
|
||||
Preconditions.a(cls2, "Null interface");
|
||||
}
|
||||
Collections.addAll(this.a, clsArr);
|
||||
}
|
||||
|
||||
public Builder<T> a() {
|
||||
a(1);
|
||||
return this;
|
||||
}
|
||||
|
||||
private Builder<T> a(int i) {
|
||||
Preconditions.b(this.c == 0, "Instantiation type has already been set.");
|
||||
this.c = i;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder<T> a(ComponentFactory<T> componentFactory) {
|
||||
Preconditions.a(componentFactory, "Null factory");
|
||||
this.d = componentFactory;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
/* synthetic */ Component(Set set, Set set2, int i, ComponentFactory componentFactory, Set set3, byte b) {
|
||||
this(set, set2, i, componentFactory, set3);
|
||||
}
|
||||
|
||||
static /* synthetic */ Object a(Object obj) {
|
||||
return obj;
|
||||
}
|
||||
|
||||
public final Set<Class<? super T>> a() {
|
||||
return this.a;
|
||||
}
|
||||
|
||||
public final Set<Dependency> b() {
|
||||
return this.b;
|
||||
}
|
||||
|
||||
public final ComponentFactory<T> c() {
|
||||
return this.d;
|
||||
}
|
||||
|
||||
public final Set<Class<?>> d() {
|
||||
return this.e;
|
||||
}
|
||||
|
||||
public final boolean e() {
|
||||
return this.c == 1;
|
||||
}
|
||||
|
||||
public final boolean f() {
|
||||
return this.c == 2;
|
||||
}
|
||||
|
||||
public final String toString() {
|
||||
return "Component<" + Arrays.toString(this.a.toArray()) + ">{" + this.c + ", deps=" + Arrays.toString(this.b.toArray()) + "}";
|
||||
}
|
||||
|
||||
private Component(Set<Class<? super T>> set, Set<Dependency> set2, int i, ComponentFactory<T> componentFactory, Set<Class<?>> set3) {
|
||||
this.a = Collections.unmodifiableSet(set);
|
||||
this.b = Collections.unmodifiableSet(set2);
|
||||
this.c = i;
|
||||
this.d = componentFactory;
|
||||
this.e = Collections.unmodifiableSet(set3);
|
||||
}
|
||||
|
||||
public static <T> Builder<T> a(Class<T> cls) {
|
||||
return new Builder<>(cls, new Class[0], (byte) 0);
|
||||
}
|
||||
|
||||
public static <T> Builder<T> a(Class<T> cls, Class<? super T>... clsArr) {
|
||||
return new Builder<>(cls, clsArr, (byte) 0);
|
||||
}
|
||||
|
||||
@SafeVarargs
|
||||
public static <T> Component<T> a(T t, Class<T> cls, Class<? super T>... clsArr) {
|
||||
Builder a = a(cls, clsArr);
|
||||
a.a(zzc.a(t));
|
||||
return a.b();
|
||||
}
|
||||
}
|
@@ -0,0 +1,11 @@
|
||||
package com.google.firebase.components;
|
||||
|
||||
import com.google.firebase.inject.Provider;
|
||||
|
||||
/* compiled from: com.google.firebase:firebase-common@@16.0.2 */
|
||||
/* loaded from: classes.dex */
|
||||
public interface ComponentContainer {
|
||||
<T> T a(Class<T> cls);
|
||||
|
||||
<T> Provider<T> b(Class<T> cls);
|
||||
}
|
@@ -0,0 +1,14 @@
|
||||
package com.google.firebase.components;
|
||||
|
||||
import android.app.Service;
|
||||
import android.content.Intent;
|
||||
import android.os.IBinder;
|
||||
|
||||
/* compiled from: com.google.firebase:firebase-common@@16.0.2 */
|
||||
/* loaded from: classes.dex */
|
||||
public class ComponentDiscoveryService extends Service {
|
||||
@Override // android.app.Service
|
||||
public IBinder onBind(Intent intent) {
|
||||
return null;
|
||||
}
|
||||
}
|
@@ -0,0 +1,7 @@
|
||||
package com.google.firebase.components;
|
||||
|
||||
/* compiled from: com.google.firebase:firebase-common@@16.0.2 */
|
||||
/* loaded from: classes.dex */
|
||||
public interface ComponentFactory<T> {
|
||||
T a(ComponentContainer componentContainer);
|
||||
}
|
@@ -0,0 +1,9 @@
|
||||
package com.google.firebase.components;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/* compiled from: com.google.firebase:firebase-common@@16.0.2 */
|
||||
/* loaded from: classes.dex */
|
||||
public interface ComponentRegistrar {
|
||||
List<Component<?>> getComponents();
|
||||
}
|
59
sources/com/google/firebase/components/Dependency.java
Normal file
59
sources/com/google/firebase/components/Dependency.java
Normal file
@@ -0,0 +1,59 @@
|
||||
package com.google.firebase.components;
|
||||
|
||||
import com.google.android.gms.common.internal.Preconditions;
|
||||
|
||||
/* compiled from: com.google.firebase:firebase-common@@16.0.2 */
|
||||
/* loaded from: classes.dex */
|
||||
public final class Dependency {
|
||||
private final Class<?> a;
|
||||
private final int b;
|
||||
private final int c;
|
||||
|
||||
private Dependency(Class<?> cls, int i, int i2) {
|
||||
Preconditions.a(cls, "Null dependency anInterface.");
|
||||
this.a = cls;
|
||||
this.b = i;
|
||||
this.c = i2;
|
||||
}
|
||||
|
||||
public static Dependency a(Class<?> cls) {
|
||||
return new Dependency(cls, 1, 0);
|
||||
}
|
||||
|
||||
public final boolean b() {
|
||||
return this.b == 1;
|
||||
}
|
||||
|
||||
public final boolean c() {
|
||||
return this.c == 0;
|
||||
}
|
||||
|
||||
public final boolean equals(Object obj) {
|
||||
if (obj instanceof Dependency) {
|
||||
Dependency dependency = (Dependency) obj;
|
||||
if (this.a == dependency.a && this.b == dependency.b && this.c == dependency.c) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public final int hashCode() {
|
||||
return ((((this.a.hashCode() ^ 1000003) * 1000003) ^ this.b) * 1000003) ^ this.c;
|
||||
}
|
||||
|
||||
public final String toString() {
|
||||
StringBuilder sb = new StringBuilder("Dependency{anInterface=");
|
||||
sb.append(this.a);
|
||||
sb.append(", required=");
|
||||
sb.append(this.b == 1);
|
||||
sb.append(", direct=");
|
||||
sb.append(this.c == 0);
|
||||
sb.append("}");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public final Class<?> a() {
|
||||
return this.a;
|
||||
}
|
||||
}
|
@@ -0,0 +1,19 @@
|
||||
package com.google.firebase.components;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/* compiled from: com.google.firebase:firebase-common@@16.0.2 */
|
||||
/* loaded from: classes.dex */
|
||||
public class DependencyCycleException extends DependencyException {
|
||||
private final List<Component<?>> zza;
|
||||
|
||||
public DependencyCycleException(List<Component<?>> list) {
|
||||
super("Dependency cycle detected: " + Arrays.toString(list.toArray()));
|
||||
this.zza = list;
|
||||
}
|
||||
|
||||
public List<Component<?>> getComponentsInCycle() {
|
||||
return this.zza;
|
||||
}
|
||||
}
|
@@ -0,0 +1,9 @@
|
||||
package com.google.firebase.components;
|
||||
|
||||
/* compiled from: com.google.firebase:firebase-common@@16.0.2 */
|
||||
/* loaded from: classes.dex */
|
||||
public class DependencyException extends RuntimeException {
|
||||
public DependencyException(String str) {
|
||||
super(str);
|
||||
}
|
||||
}
|
@@ -0,0 +1,9 @@
|
||||
package com.google.firebase.components;
|
||||
|
||||
/* compiled from: com.google.firebase:firebase-common@@16.0.2 */
|
||||
/* loaded from: classes.dex */
|
||||
public class MissingDependencyException extends DependencyException {
|
||||
public MissingDependencyException(String str) {
|
||||
super(str);
|
||||
}
|
||||
}
|
20
sources/com/google/firebase/components/zza.java
Normal file
20
sources/com/google/firebase/components/zza.java
Normal file
@@ -0,0 +1,20 @@
|
||||
package com.google.firebase.components;
|
||||
|
||||
import com.google.firebase.inject.Provider;
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: package-private */
|
||||
/* compiled from: com.google.firebase:firebase-common@@16.0.2 */
|
||||
/* loaded from: classes.dex */
|
||||
public abstract class zza implements ComponentContainer {
|
||||
zza() {
|
||||
}
|
||||
|
||||
@Override // com.google.firebase.components.ComponentContainer
|
||||
public <T> T a(Class<T> cls) {
|
||||
Provider<T> b = b(cls);
|
||||
if (b == null) {
|
||||
return null;
|
||||
}
|
||||
return b.get();
|
||||
}
|
||||
}
|
22
sources/com/google/firebase/components/zzc.java
Normal file
22
sources/com/google/firebase/components/zzc.java
Normal file
@@ -0,0 +1,22 @@
|
||||
package com.google.firebase.components;
|
||||
|
||||
/* compiled from: com.google.firebase:firebase-common@@16.0.2 */
|
||||
/* loaded from: classes.dex */
|
||||
final /* synthetic */ class zzc implements ComponentFactory {
|
||||
private final Object a;
|
||||
|
||||
private zzc(Object obj) {
|
||||
this.a = obj;
|
||||
}
|
||||
|
||||
public static ComponentFactory a(Object obj) {
|
||||
return new zzc(obj);
|
||||
}
|
||||
|
||||
@Override // com.google.firebase.components.ComponentFactory
|
||||
public final Object a(ComponentContainer componentContainer) {
|
||||
Object obj = this.a;
|
||||
Component.a(obj);
|
||||
return obj;
|
||||
}
|
||||
}
|
59
sources/com/google/firebase/components/zzd.java
Normal file
59
sources/com/google/firebase/components/zzd.java
Normal file
@@ -0,0 +1,59 @@
|
||||
package com.google.firebase.components;
|
||||
|
||||
import android.content.ComponentName;
|
||||
import android.content.Context;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.content.pm.ServiceInfo;
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
import com.ubtrobot.jimu.robotapi.PeripheralType;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
/* compiled from: com.google.firebase:firebase-common@@16.0.2 */
|
||||
/* loaded from: classes.dex */
|
||||
final class zzd implements zze<Context> {
|
||||
private zzd() {
|
||||
}
|
||||
|
||||
@Override // com.google.firebase.components.zze
|
||||
public final /* synthetic */ List a(Context context) {
|
||||
Bundle a2 = a2(context);
|
||||
if (a2 == null) {
|
||||
Log.w("ComponentDiscovery", "Could not retrieve metadata, returning empty list of registrars.");
|
||||
return Collections.emptyList();
|
||||
}
|
||||
ArrayList arrayList = new ArrayList();
|
||||
for (String str : a2.keySet()) {
|
||||
if ("com.google.firebase.components.ComponentRegistrar".equals(a2.get(str)) && str.startsWith("com.google.firebase.components:")) {
|
||||
arrayList.add(str.substring(31));
|
||||
}
|
||||
}
|
||||
return arrayList;
|
||||
}
|
||||
|
||||
/* synthetic */ zzd(byte b) {
|
||||
this();
|
||||
}
|
||||
|
||||
/* renamed from: a, reason: avoid collision after fix types in other method */
|
||||
private static Bundle a2(Context context) {
|
||||
try {
|
||||
PackageManager packageManager = context.getPackageManager();
|
||||
if (packageManager == null) {
|
||||
Log.w("ComponentDiscovery", "Context has no PackageManager.");
|
||||
return null;
|
||||
}
|
||||
ServiceInfo serviceInfo = packageManager.getServiceInfo(new ComponentName(context, (Class<?>) ComponentDiscoveryService.class), PeripheralType.SERVO);
|
||||
if (serviceInfo == null) {
|
||||
Log.w("ComponentDiscovery", "ComponentDiscoveryService has no service info.");
|
||||
return null;
|
||||
}
|
||||
return serviceInfo.metaData;
|
||||
} catch (PackageManager.NameNotFoundException unused) {
|
||||
Log.w("ComponentDiscovery", "Application info not found.");
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
9
sources/com/google/firebase/components/zze.java
Normal file
9
sources/com/google/firebase/components/zze.java
Normal file
@@ -0,0 +1,9 @@
|
||||
package com.google.firebase.components;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/* compiled from: com.google.firebase:firebase-common@@16.0.2 */
|
||||
/* loaded from: classes.dex */
|
||||
interface zze<T> {
|
||||
List<String> a(T t);
|
||||
}
|
72
sources/com/google/firebase/components/zzf.java
Normal file
72
sources/com/google/firebase/components/zzf.java
Normal file
@@ -0,0 +1,72 @@
|
||||
package com.google.firebase.components;
|
||||
|
||||
import com.google.android.gms.common.internal.Preconditions;
|
||||
import com.google.firebase.components.Component;
|
||||
import com.google.firebase.events.Publisher;
|
||||
import com.google.firebase.events.Subscriber;
|
||||
import com.google.firebase.inject.Provider;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.Executor;
|
||||
|
||||
/* compiled from: com.google.firebase:firebase-common@@16.0.2 */
|
||||
/* loaded from: classes.dex */
|
||||
public final class zzf extends zza {
|
||||
private final List<Component<?>> a;
|
||||
private final Map<Class<?>, zzj<?>> b = new HashMap();
|
||||
private final zzh c;
|
||||
|
||||
public zzf(Executor executor, Iterable<ComponentRegistrar> iterable, Component<?>... componentArr) {
|
||||
this.c = new zzh(executor);
|
||||
ArrayList arrayList = new ArrayList();
|
||||
arrayList.add(Component.a(this.c, zzh.class, Subscriber.class, Publisher.class));
|
||||
Iterator<ComponentRegistrar> it = iterable.iterator();
|
||||
while (it.hasNext()) {
|
||||
arrayList.addAll(it.next().getComponents());
|
||||
}
|
||||
Collections.addAll(arrayList, componentArr);
|
||||
this.a = Collections.unmodifiableList(Component.AnonymousClass1.a(arrayList));
|
||||
Iterator<Component<?>> it2 = this.a.iterator();
|
||||
while (it2.hasNext()) {
|
||||
a(it2.next());
|
||||
}
|
||||
a();
|
||||
}
|
||||
|
||||
@Override // com.google.firebase.components.ComponentContainer
|
||||
public final <T> Provider<T> b(Class<T> cls) {
|
||||
Preconditions.a(cls, "Null interface requested.");
|
||||
return this.b.get(cls);
|
||||
}
|
||||
|
||||
public final void a(boolean z) {
|
||||
for (Component<?> component : this.a) {
|
||||
if (component.e() || (component.f() && z)) {
|
||||
a(component.a().iterator().next());
|
||||
}
|
||||
}
|
||||
this.c.a();
|
||||
}
|
||||
|
||||
private <T> void a(Component<T> component) {
|
||||
zzj<?> zzjVar = new zzj<>(component.c(), new zzl(component, this));
|
||||
Iterator<Class<? super T>> it = component.a().iterator();
|
||||
while (it.hasNext()) {
|
||||
this.b.put(it.next(), zzjVar);
|
||||
}
|
||||
}
|
||||
|
||||
private void a() {
|
||||
for (Component<?> component : this.a) {
|
||||
for (Dependency dependency : component.b()) {
|
||||
if (dependency.b() && !this.b.containsKey(dependency.a())) {
|
||||
throw new MissingDependencyException(String.format("Unsatisfied dependency for component %s: %s", component, dependency.a()));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
44
sources/com/google/firebase/components/zzg.java
Normal file
44
sources/com/google/firebase/components/zzg.java
Normal file
@@ -0,0 +1,44 @@
|
||||
package com.google.firebase.components;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
/* compiled from: com.google.firebase:firebase-common@@16.0.2 */
|
||||
/* loaded from: classes.dex */
|
||||
final class zzg {
|
||||
private final Component<?> a;
|
||||
private final Set<zzg> b = new HashSet();
|
||||
private final Set<zzg> c = new HashSet();
|
||||
|
||||
zzg(Component<?> component) {
|
||||
this.a = component;
|
||||
}
|
||||
|
||||
final void a(zzg zzgVar) {
|
||||
this.b.add(zzgVar);
|
||||
}
|
||||
|
||||
final void b(zzg zzgVar) {
|
||||
this.c.add(zzgVar);
|
||||
}
|
||||
|
||||
final void c(zzg zzgVar) {
|
||||
this.c.remove(zzgVar);
|
||||
}
|
||||
|
||||
final boolean d() {
|
||||
return this.b.isEmpty();
|
||||
}
|
||||
|
||||
final Set<zzg> a() {
|
||||
return this.b;
|
||||
}
|
||||
|
||||
final Component<?> b() {
|
||||
return this.a;
|
||||
}
|
||||
|
||||
final boolean c() {
|
||||
return this.c.isEmpty();
|
||||
}
|
||||
}
|
83
sources/com/google/firebase/components/zzh.java
Normal file
83
sources/com/google/firebase/components/zzh.java
Normal file
@@ -0,0 +1,83 @@
|
||||
package com.google.firebase.components;
|
||||
|
||||
import com.google.android.gms.common.internal.Preconditions;
|
||||
import com.google.firebase.events.Event;
|
||||
import com.google.firebase.events.EventHandler;
|
||||
import com.google.firebase.events.Publisher;
|
||||
import com.google.firebase.events.Subscriber;
|
||||
import java.util.ArrayDeque;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
import java.util.Queue;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.Executor;
|
||||
|
||||
/* compiled from: com.google.firebase:firebase-common@@16.0.2 */
|
||||
/* loaded from: classes.dex */
|
||||
class zzh implements Publisher, Subscriber {
|
||||
private final Map<Class<?>, ConcurrentHashMap<EventHandler<Object>, Executor>> a = new HashMap();
|
||||
private Queue<Event<?>> b = new ArrayDeque();
|
||||
private final Executor c;
|
||||
|
||||
zzh(Executor executor) {
|
||||
this.c = executor;
|
||||
}
|
||||
|
||||
private synchronized Set<Map.Entry<EventHandler<Object>, Executor>> b(Event<?> event) {
|
||||
ConcurrentHashMap<EventHandler<Object>, Executor> concurrentHashMap = this.a.get(event.b());
|
||||
if (concurrentHashMap == null) {
|
||||
return Collections.emptySet();
|
||||
}
|
||||
return concurrentHashMap.entrySet();
|
||||
}
|
||||
|
||||
public void a(Event<?> event) {
|
||||
Preconditions.a(event);
|
||||
synchronized (this) {
|
||||
if (this.b != null) {
|
||||
this.b.add(event);
|
||||
return;
|
||||
}
|
||||
for (Map.Entry<EventHandler<Object>, Executor> entry : b(event)) {
|
||||
entry.getValue().execute(zzi.a(entry, event));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override // com.google.firebase.events.Subscriber
|
||||
public synchronized <T> void a(Class<T> cls, Executor executor, EventHandler<? super T> eventHandler) {
|
||||
Preconditions.a(cls);
|
||||
Preconditions.a(eventHandler);
|
||||
Preconditions.a(executor);
|
||||
if (!this.a.containsKey(cls)) {
|
||||
this.a.put(cls, new ConcurrentHashMap<>());
|
||||
}
|
||||
this.a.get(cls).put(eventHandler, executor);
|
||||
}
|
||||
|
||||
@Override // com.google.firebase.events.Subscriber
|
||||
public <T> void a(Class<T> cls, EventHandler<? super T> eventHandler) {
|
||||
a(cls, this.c, eventHandler);
|
||||
}
|
||||
|
||||
final void a() {
|
||||
Queue<Event<?>> queue;
|
||||
synchronized (this) {
|
||||
if (this.b != null) {
|
||||
queue = this.b;
|
||||
this.b = null;
|
||||
} else {
|
||||
queue = null;
|
||||
}
|
||||
}
|
||||
if (queue != null) {
|
||||
Iterator<Event<?>> it = queue.iterator();
|
||||
while (it.hasNext()) {
|
||||
a(it.next());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
26
sources/com/google/firebase/components/zzi.java
Normal file
26
sources/com/google/firebase/components/zzi.java
Normal file
@@ -0,0 +1,26 @@
|
||||
package com.google.firebase.components;
|
||||
|
||||
import com.google.firebase.events.Event;
|
||||
import com.google.firebase.events.EventHandler;
|
||||
import java.util.Map;
|
||||
|
||||
/* compiled from: com.google.firebase:firebase-common@@16.0.2 */
|
||||
/* loaded from: classes.dex */
|
||||
final /* synthetic */ class zzi implements Runnable {
|
||||
private final Map.Entry a;
|
||||
private final Event b;
|
||||
|
||||
private zzi(Map.Entry entry, Event event) {
|
||||
this.a = entry;
|
||||
this.b = event;
|
||||
}
|
||||
|
||||
public static Runnable a(Map.Entry entry, Event event) {
|
||||
return new zzi(entry, event);
|
||||
}
|
||||
|
||||
@Override // java.lang.Runnable
|
||||
public final void run() {
|
||||
((EventHandler) this.a.getKey()).a(this.b);
|
||||
}
|
||||
}
|
31
sources/com/google/firebase/components/zzj.java
Normal file
31
sources/com/google/firebase/components/zzj.java
Normal file
@@ -0,0 +1,31 @@
|
||||
package com.google.firebase.components;
|
||||
|
||||
import com.google.firebase.inject.Provider;
|
||||
|
||||
/* compiled from: com.google.firebase:firebase-common@@16.0.2 */
|
||||
/* loaded from: classes.dex */
|
||||
final class zzj<T> implements Provider<T> {
|
||||
private static final Object c = new Object();
|
||||
private volatile Object a = c;
|
||||
private volatile Provider<T> b;
|
||||
|
||||
zzj(ComponentFactory<T> componentFactory, ComponentContainer componentContainer) {
|
||||
this.b = zzk.a(componentFactory, componentContainer);
|
||||
}
|
||||
|
||||
@Override // com.google.firebase.inject.Provider
|
||||
public final T get() {
|
||||
T t = (T) this.a;
|
||||
if (t == c) {
|
||||
synchronized (this) {
|
||||
t = (T) this.a;
|
||||
if (t == c) {
|
||||
t = this.b.get();
|
||||
this.a = t;
|
||||
this.b = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
return t;
|
||||
}
|
||||
}
|
26
sources/com/google/firebase/components/zzk.java
Normal file
26
sources/com/google/firebase/components/zzk.java
Normal file
@@ -0,0 +1,26 @@
|
||||
package com.google.firebase.components;
|
||||
|
||||
import com.google.firebase.inject.Provider;
|
||||
|
||||
/* compiled from: com.google.firebase:firebase-common@@16.0.2 */
|
||||
/* loaded from: classes.dex */
|
||||
final /* synthetic */ class zzk implements Provider {
|
||||
private final ComponentFactory a;
|
||||
private final ComponentContainer b;
|
||||
|
||||
private zzk(ComponentFactory componentFactory, ComponentContainer componentContainer) {
|
||||
this.a = componentFactory;
|
||||
this.b = componentContainer;
|
||||
}
|
||||
|
||||
public static Provider a(ComponentFactory componentFactory, ComponentContainer componentContainer) {
|
||||
return new zzk(componentFactory, componentContainer);
|
||||
}
|
||||
|
||||
@Override // com.google.firebase.inject.Provider
|
||||
public final Object get() {
|
||||
Object a;
|
||||
a = this.a.a(this.b);
|
||||
return a;
|
||||
}
|
||||
}
|
58
sources/com/google/firebase/components/zzl.java
Normal file
58
sources/com/google/firebase/components/zzl.java
Normal file
@@ -0,0 +1,58 @@
|
||||
package com.google.firebase.components;
|
||||
|
||||
import com.google.firebase.events.Publisher;
|
||||
import com.google.firebase.inject.Provider;
|
||||
import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
/* compiled from: com.google.firebase:firebase-common@@16.0.2 */
|
||||
/* loaded from: classes.dex */
|
||||
final class zzl extends com.google.firebase.components.zza {
|
||||
private final Set<Class<?>> a;
|
||||
private final Set<Class<?>> b;
|
||||
private final Set<Class<?>> c;
|
||||
private final ComponentContainer d;
|
||||
|
||||
/* compiled from: com.google.firebase:firebase-common@@16.0.2 */
|
||||
static class zza implements Publisher {
|
||||
public zza(Set<Class<?>> set, Publisher publisher) {
|
||||
}
|
||||
}
|
||||
|
||||
zzl(Component<?> component, ComponentContainer componentContainer) {
|
||||
HashSet hashSet = new HashSet();
|
||||
HashSet hashSet2 = new HashSet();
|
||||
for (Dependency dependency : component.b()) {
|
||||
if (dependency.c()) {
|
||||
hashSet.add(dependency.a());
|
||||
} else {
|
||||
hashSet2.add(dependency.a());
|
||||
}
|
||||
}
|
||||
if (!component.d().isEmpty()) {
|
||||
hashSet.add(Publisher.class);
|
||||
}
|
||||
this.a = Collections.unmodifiableSet(hashSet);
|
||||
this.b = Collections.unmodifiableSet(hashSet2);
|
||||
this.c = component.d();
|
||||
this.d = componentContainer;
|
||||
}
|
||||
|
||||
@Override // com.google.firebase.components.zza, com.google.firebase.components.ComponentContainer
|
||||
public final <T> T a(Class<T> cls) {
|
||||
if (!this.a.contains(cls)) {
|
||||
throw new IllegalArgumentException(String.format("Requesting %s is not allowed.", cls));
|
||||
}
|
||||
T t = (T) this.d.a(cls);
|
||||
return !cls.equals(Publisher.class) ? t : (T) new zza(this.c, (Publisher) t);
|
||||
}
|
||||
|
||||
@Override // com.google.firebase.components.ComponentContainer
|
||||
public final <T> Provider<T> b(Class<T> cls) {
|
||||
if (this.b.contains(cls)) {
|
||||
return this.d.b(cls);
|
||||
}
|
||||
throw new IllegalArgumentException(String.format("Requesting Provider<%s> is not allowed.", cls));
|
||||
}
|
||||
}
|
20
sources/com/google/firebase/events/Event.java
Normal file
20
sources/com/google/firebase/events/Event.java
Normal file
@@ -0,0 +1,20 @@
|
||||
package com.google.firebase.events;
|
||||
|
||||
/* compiled from: com.google.firebase:firebase-common@@16.0.2 */
|
||||
/* loaded from: classes.dex */
|
||||
public class Event<T> {
|
||||
private final Class<T> a;
|
||||
private final T b;
|
||||
|
||||
public T a() {
|
||||
return this.b;
|
||||
}
|
||||
|
||||
public Class<T> b() {
|
||||
return this.a;
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return String.format("Event{type: %s, payload: %s}", this.a, this.b);
|
||||
}
|
||||
}
|
7
sources/com/google/firebase/events/EventHandler.java
Normal file
7
sources/com/google/firebase/events/EventHandler.java
Normal file
@@ -0,0 +1,7 @@
|
||||
package com.google.firebase.events;
|
||||
|
||||
/* compiled from: com.google.firebase:firebase-common@@16.0.2 */
|
||||
/* loaded from: classes.dex */
|
||||
public interface EventHandler<T> {
|
||||
void a(Event<T> event);
|
||||
}
|
6
sources/com/google/firebase/events/Publisher.java
Normal file
6
sources/com/google/firebase/events/Publisher.java
Normal file
@@ -0,0 +1,6 @@
|
||||
package com.google.firebase.events;
|
||||
|
||||
/* compiled from: com.google.firebase:firebase-common@@16.0.2 */
|
||||
/* loaded from: classes.dex */
|
||||
public interface Publisher {
|
||||
}
|
11
sources/com/google/firebase/events/Subscriber.java
Normal file
11
sources/com/google/firebase/events/Subscriber.java
Normal file
@@ -0,0 +1,11 @@
|
||||
package com.google.firebase.events;
|
||||
|
||||
import java.util.concurrent.Executor;
|
||||
|
||||
/* compiled from: com.google.firebase:firebase-common@@16.0.2 */
|
||||
/* loaded from: classes.dex */
|
||||
public interface Subscriber {
|
||||
<T> void a(Class<T> cls, EventHandler<? super T> eventHandler);
|
||||
|
||||
<T> void a(Class<T> cls, Executor executor, EventHandler<? super T> eventHandler);
|
||||
}
|
388
sources/com/google/firebase/iid/FirebaseInstanceId.java
Normal file
388
sources/com/google/firebase/iid/FirebaseInstanceId.java
Normal file
@@ -0,0 +1,388 @@
|
||||
package com.google.firebase.iid;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.content.pm.ApplicationInfo;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.content.pm.ResolveInfo;
|
||||
import android.os.Build;
|
||||
import android.os.Looper;
|
||||
import android.util.Log;
|
||||
import androidx.annotation.Keep;
|
||||
import com.google.android.gms.common.util.concurrent.NamedThreadFactory;
|
||||
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.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.iid.FirebaseInstanceId;
|
||||
import com.ubtrobot.jimu.robotapi.PeripheralType;
|
||||
import java.io.IOException;
|
||||
import java.util.concurrent.ExecutionException;
|
||||
import java.util.concurrent.Executor;
|
||||
import java.util.concurrent.ScheduledThreadPoolExecutor;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.concurrent.TimeoutException;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class FirebaseInstanceId {
|
||||
private static final long i = TimeUnit.HOURS.toSeconds(8);
|
||||
private static zzaw j;
|
||||
private static ScheduledThreadPoolExecutor k;
|
||||
private final Executor a;
|
||||
private final FirebaseApp b;
|
||||
private final zzan c;
|
||||
private MessagingChannel d;
|
||||
private final zzaq e;
|
||||
private final zzba f;
|
||||
private boolean g;
|
||||
private final zza h;
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: private */
|
||||
class zza {
|
||||
private EventHandler<DataCollectionDefaultChange> b;
|
||||
private final boolean a = c();
|
||||
private Boolean c = b();
|
||||
|
||||
zza(Subscriber subscriber) {
|
||||
if (this.c == null && this.a) {
|
||||
this.b = new EventHandler(this) { // from class: com.google.firebase.iid.zzq
|
||||
private final FirebaseInstanceId.zza a;
|
||||
|
||||
{
|
||||
this.a = this;
|
||||
}
|
||||
|
||||
@Override // com.google.firebase.events.EventHandler
|
||||
public final void a(Event event) {
|
||||
FirebaseInstanceId.zza zzaVar = this.a;
|
||||
synchronized (zzaVar) {
|
||||
if (zzaVar.a()) {
|
||||
FirebaseInstanceId.this.l();
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
subscriber.a(DataCollectionDefaultChange.class, this.b);
|
||||
}
|
||||
}
|
||||
|
||||
private final Boolean b() {
|
||||
ApplicationInfo applicationInfo;
|
||||
Context a = FirebaseInstanceId.this.b.a();
|
||||
SharedPreferences sharedPreferences = a.getSharedPreferences("com.google.firebase.messaging", 0);
|
||||
if (sharedPreferences.contains("auto_init")) {
|
||||
return Boolean.valueOf(sharedPreferences.getBoolean("auto_init", false));
|
||||
}
|
||||
try {
|
||||
PackageManager packageManager = a.getPackageManager();
|
||||
if (packageManager == null || (applicationInfo = packageManager.getApplicationInfo(a.getPackageName(), PeripheralType.SERVO)) == null || applicationInfo.metaData == null || !applicationInfo.metaData.containsKey("firebase_messaging_auto_init_enabled")) {
|
||||
return null;
|
||||
}
|
||||
return Boolean.valueOf(applicationInfo.metaData.getBoolean("firebase_messaging_auto_init_enabled"));
|
||||
} catch (PackageManager.NameNotFoundException unused) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private final boolean c() {
|
||||
try {
|
||||
Class.forName("com.google.firebase.messaging.FirebaseMessaging");
|
||||
return true;
|
||||
} catch (ClassNotFoundException unused) {
|
||||
Context a = FirebaseInstanceId.this.b.a();
|
||||
Intent intent = new Intent("com.google.firebase.MESSAGING_EVENT");
|
||||
intent.setPackage(a.getPackageName());
|
||||
ResolveInfo resolveService = a.getPackageManager().resolveService(intent, 0);
|
||||
return (resolveService == null || resolveService.serviceInfo == null) ? false : true;
|
||||
}
|
||||
}
|
||||
|
||||
final synchronized boolean a() {
|
||||
if (this.c != null) {
|
||||
return this.c.booleanValue();
|
||||
}
|
||||
return this.a && FirebaseInstanceId.this.b.d();
|
||||
}
|
||||
}
|
||||
|
||||
FirebaseInstanceId(FirebaseApp firebaseApp, Subscriber subscriber) {
|
||||
this(firebaseApp, new zzan(firebaseApp.a()), zzi.b(), zzi.b(), subscriber);
|
||||
}
|
||||
|
||||
@Keep
|
||||
public static synchronized FirebaseInstanceId getInstance(FirebaseApp firebaseApp) {
|
||||
FirebaseInstanceId firebaseInstanceId;
|
||||
synchronized (FirebaseInstanceId.class) {
|
||||
firebaseInstanceId = (FirebaseInstanceId) firebaseApp.a(FirebaseInstanceId.class);
|
||||
}
|
||||
return firebaseInstanceId;
|
||||
}
|
||||
|
||||
public static FirebaseInstanceId j() {
|
||||
return getInstance(FirebaseApp.f());
|
||||
}
|
||||
|
||||
private final synchronized void k() {
|
||||
if (!this.g) {
|
||||
a(0L);
|
||||
}
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: private */
|
||||
public final void l() {
|
||||
zzax c = c();
|
||||
if (!g() || c == null || c.a(this.c.b()) || this.f.a()) {
|
||||
k();
|
||||
}
|
||||
}
|
||||
|
||||
private static String m() {
|
||||
return zzan.a(j.b("").a());
|
||||
}
|
||||
|
||||
static boolean n() {
|
||||
if (Log.isLoggable("FirebaseInstanceId", 3)) {
|
||||
return true;
|
||||
}
|
||||
return Build.VERSION.SDK_INT == 23 && Log.isLoggable("FirebaseInstanceId", 3);
|
||||
}
|
||||
|
||||
final synchronized void a(boolean z) {
|
||||
this.g = z;
|
||||
}
|
||||
|
||||
final FirebaseApp b() {
|
||||
return this.b;
|
||||
}
|
||||
|
||||
final zzax c() {
|
||||
return c(zzan.a(this.b), "*");
|
||||
}
|
||||
|
||||
final String d() throws IOException {
|
||||
return a(zzan.a(this.b), "*");
|
||||
}
|
||||
|
||||
final synchronized void e() {
|
||||
j.b();
|
||||
if (this.h.a()) {
|
||||
k();
|
||||
}
|
||||
}
|
||||
|
||||
final boolean f() {
|
||||
return this.d.b();
|
||||
}
|
||||
|
||||
final boolean g() {
|
||||
return this.d.a();
|
||||
}
|
||||
|
||||
final void h() throws IOException {
|
||||
a(this.d.a(m(), zzax.a(c())));
|
||||
}
|
||||
|
||||
final void i() {
|
||||
j.c("");
|
||||
k();
|
||||
}
|
||||
|
||||
private final Task<InstanceIdResult> b(final String str, final String str2) {
|
||||
final String c = c(str2);
|
||||
final TaskCompletionSource taskCompletionSource = new TaskCompletionSource();
|
||||
this.a.execute(new Runnable(this, str, str2, taskCompletionSource, c) { // from class: com.google.firebase.iid.zzn
|
||||
private final FirebaseInstanceId a;
|
||||
private final String b;
|
||||
private final String c;
|
||||
private final TaskCompletionSource d;
|
||||
private final String e;
|
||||
|
||||
{
|
||||
this.a = this;
|
||||
this.b = str;
|
||||
this.c = str2;
|
||||
this.d = taskCompletionSource;
|
||||
this.e = c;
|
||||
}
|
||||
|
||||
@Override // java.lang.Runnable
|
||||
public final void run() {
|
||||
this.a.a(this.b, this.c, this.d, this.e);
|
||||
}
|
||||
});
|
||||
return taskCompletionSource.a();
|
||||
}
|
||||
|
||||
private static zzax c(String str, String str2) {
|
||||
return j.a("", str, str2);
|
||||
}
|
||||
|
||||
private static String c(String str) {
|
||||
return (str.isEmpty() || str.equalsIgnoreCase("fcm") || str.equalsIgnoreCase("gcm")) ? "*" : str;
|
||||
}
|
||||
|
||||
final synchronized void a(long j2) {
|
||||
a(new zzay(this, this.c, this.f, Math.min(Math.max(30L, j2 << 1), i)), j2);
|
||||
this.g = true;
|
||||
}
|
||||
|
||||
private FirebaseInstanceId(FirebaseApp firebaseApp, zzan zzanVar, Executor executor, Executor executor2, Subscriber subscriber) {
|
||||
this.g = false;
|
||||
if (zzan.a(firebaseApp) != null) {
|
||||
synchronized (FirebaseInstanceId.class) {
|
||||
if (j == null) {
|
||||
j = new zzaw(firebaseApp.a());
|
||||
}
|
||||
}
|
||||
this.b = firebaseApp;
|
||||
this.c = zzanVar;
|
||||
if (this.d == null) {
|
||||
MessagingChannel messagingChannel = (MessagingChannel) firebaseApp.a(MessagingChannel.class);
|
||||
if (messagingChannel != null && messagingChannel.b()) {
|
||||
this.d = messagingChannel;
|
||||
} else {
|
||||
this.d = new zzr(firebaseApp, zzanVar, executor);
|
||||
}
|
||||
}
|
||||
this.d = this.d;
|
||||
this.a = executor2;
|
||||
this.f = new zzba(j);
|
||||
this.h = new zza(subscriber);
|
||||
this.e = new zzaq(executor);
|
||||
if (this.h.a()) {
|
||||
l();
|
||||
return;
|
||||
}
|
||||
return;
|
||||
}
|
||||
throw new IllegalStateException("FirebaseInstanceId failed to initialize, FirebaseApp is missing project ID");
|
||||
}
|
||||
|
||||
final void b(String str) throws IOException {
|
||||
zzax c = c();
|
||||
if (c != null && !c.a(this.c.b())) {
|
||||
a(this.d.a(m(), c.a, str));
|
||||
return;
|
||||
}
|
||||
throw new IOException("token not available");
|
||||
}
|
||||
|
||||
static void a(Runnable runnable, long j2) {
|
||||
synchronized (FirebaseInstanceId.class) {
|
||||
if (k == null) {
|
||||
k = new ScheduledThreadPoolExecutor(1, new NamedThreadFactory("FirebaseInstanceId"));
|
||||
}
|
||||
k.schedule(runnable, j2, TimeUnit.SECONDS);
|
||||
}
|
||||
}
|
||||
|
||||
public String a() {
|
||||
l();
|
||||
return m();
|
||||
}
|
||||
|
||||
public String a(String str, String str2) throws IOException {
|
||||
if (Looper.getMainLooper() != Looper.myLooper()) {
|
||||
return ((InstanceIdResult) a(b(str, str2))).a();
|
||||
}
|
||||
throw new IOException("MAIN_THREAD");
|
||||
}
|
||||
|
||||
private final <T> T a(Task<T> task) throws IOException {
|
||||
try {
|
||||
return (T) Tasks.a(task, 30000L, TimeUnit.MILLISECONDS);
|
||||
} catch (InterruptedException | TimeoutException unused) {
|
||||
throw new IOException("SERVICE_NOT_AVAILABLE");
|
||||
} catch (ExecutionException e) {
|
||||
Throwable cause = e.getCause();
|
||||
if (cause instanceof IOException) {
|
||||
if ("INSTANCE_ID_RESET".equals(cause.getMessage())) {
|
||||
e();
|
||||
}
|
||||
throw ((IOException) cause);
|
||||
}
|
||||
if (cause instanceof RuntimeException) {
|
||||
throw ((RuntimeException) cause);
|
||||
}
|
||||
throw new IOException(e);
|
||||
}
|
||||
}
|
||||
|
||||
final void a(String str) throws IOException {
|
||||
zzax c = c();
|
||||
if (c != null && !c.a(this.c.b())) {
|
||||
a(this.d.b(m(), c.a, str));
|
||||
return;
|
||||
}
|
||||
throw new IOException("token not available");
|
||||
}
|
||||
|
||||
final /* synthetic */ void a(final String str, String str2, final TaskCompletionSource taskCompletionSource, final String str3) {
|
||||
final String m = m();
|
||||
zzax c = c(str, str2);
|
||||
if (c != null && !c.a(this.c.b())) {
|
||||
taskCompletionSource.a((TaskCompletionSource) new zzx(m, c.a));
|
||||
} else {
|
||||
final String a = zzax.a(c);
|
||||
this.e.a(str, str3, new zzas(this, m, a, str, str3) { // from class: com.google.firebase.iid.zzo
|
||||
private final FirebaseInstanceId a;
|
||||
private final String b;
|
||||
private final String c;
|
||||
private final String d;
|
||||
private final String e;
|
||||
|
||||
{
|
||||
this.a = this;
|
||||
this.b = m;
|
||||
this.c = a;
|
||||
this.d = str;
|
||||
this.e = str3;
|
||||
}
|
||||
|
||||
@Override // com.google.firebase.iid.zzas
|
||||
public final Task a() {
|
||||
return this.a.a(this.b, this.c, this.d, this.e);
|
||||
}
|
||||
}).a(this.a, new OnCompleteListener(this, str, str3, taskCompletionSource, m) { // from class: com.google.firebase.iid.zzp
|
||||
private final FirebaseInstanceId a;
|
||||
private final String b;
|
||||
private final String c;
|
||||
private final TaskCompletionSource d;
|
||||
private final String e;
|
||||
|
||||
{
|
||||
this.a = this;
|
||||
this.b = str;
|
||||
this.c = str3;
|
||||
this.d = taskCompletionSource;
|
||||
this.e = m;
|
||||
}
|
||||
|
||||
@Override // com.google.android.gms.tasks.OnCompleteListener
|
||||
public final void a(Task task) {
|
||||
this.a.a(this.b, this.c, this.d, this.e, task);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
final /* synthetic */ void a(String str, String str2, TaskCompletionSource taskCompletionSource, String str3, Task task) {
|
||||
if (task.e()) {
|
||||
String str4 = (String) task.b();
|
||||
j.a("", str, str2, str4, this.c.b());
|
||||
taskCompletionSource.a((TaskCompletionSource) new zzx(str3, str4));
|
||||
return;
|
||||
}
|
||||
taskCompletionSource.a(task.a());
|
||||
}
|
||||
|
||||
final /* synthetic */ Task a(String str, String str2, String str3, String str4) {
|
||||
return this.d.a(str, str2, str3, str4);
|
||||
}
|
||||
}
|
100
sources/com/google/firebase/iid/FirebaseInstanceIdReceiver.java
Normal file
100
sources/com/google/firebase/iid/FirebaseInstanceIdReceiver.java
Normal file
@@ -0,0 +1,100 @@
|
||||
package com.google.firebase.iid;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.Build;
|
||||
import android.os.Parcelable;
|
||||
import android.util.Base64;
|
||||
import android.util.Log;
|
||||
import androidx.legacy.content.WakefulBroadcastReceiver;
|
||||
import com.google.android.gms.common.util.PlatformVersion;
|
||||
import com.ubt.jimu.unity.bluetooth.MyUnityListener;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class FirebaseInstanceIdReceiver extends WakefulBroadcastReceiver {
|
||||
private static zzh c;
|
||||
private static zzh d;
|
||||
|
||||
private final void a(Context context, Intent intent, String str) {
|
||||
String str2 = null;
|
||||
intent.setComponent(null);
|
||||
intent.setPackage(context.getPackageName());
|
||||
if (Build.VERSION.SDK_INT <= 18) {
|
||||
intent.removeCategory(context.getPackageName());
|
||||
}
|
||||
String stringExtra = intent.getStringExtra("gcm.rawData64");
|
||||
if (stringExtra != null) {
|
||||
intent.putExtra("rawData", Base64.decode(stringExtra, 0));
|
||||
intent.removeExtra("gcm.rawData64");
|
||||
}
|
||||
if ("google.com/iid".equals(intent.getStringExtra(MyUnityListener.CALLER)) || "com.google.firebase.INSTANCE_ID_EVENT".equals(str)) {
|
||||
str2 = "com.google.firebase.INSTANCE_ID_EVENT";
|
||||
} else if ("com.google.android.c2dm.intent.RECEIVE".equals(str) || "com.google.firebase.MESSAGING_EVENT".equals(str)) {
|
||||
str2 = "com.google.firebase.MESSAGING_EVENT";
|
||||
} else {
|
||||
Log.d("FirebaseInstanceId", "Unexpected intent");
|
||||
}
|
||||
int a = str2 != null ? a(this, context, str2, intent) : -1;
|
||||
if (isOrderedBroadcast()) {
|
||||
setResultCode(a);
|
||||
}
|
||||
}
|
||||
|
||||
private static int b(BroadcastReceiver broadcastReceiver, Context context, String str, Intent intent) {
|
||||
if (Log.isLoggable("FirebaseInstanceId", 3)) {
|
||||
String valueOf = String.valueOf(str);
|
||||
Log.d("FirebaseInstanceId", valueOf.length() != 0 ? "Binding to service: ".concat(valueOf) : new String("Binding to service: "));
|
||||
}
|
||||
if (broadcastReceiver.isOrderedBroadcast()) {
|
||||
broadcastReceiver.setResultCode(-1);
|
||||
}
|
||||
a(context, str).a(intent, broadcastReceiver.goAsync());
|
||||
return -1;
|
||||
}
|
||||
|
||||
@Override // android.content.BroadcastReceiver
|
||||
public final void onReceive(Context context, Intent intent) {
|
||||
if (intent == null) {
|
||||
return;
|
||||
}
|
||||
Parcelable parcelableExtra = intent.getParcelableExtra("wrapped_intent");
|
||||
Intent intent2 = parcelableExtra instanceof Intent ? (Intent) parcelableExtra : null;
|
||||
if (intent2 != null) {
|
||||
a(context, intent2, intent.getAction());
|
||||
} else {
|
||||
a(context, intent, intent.getAction());
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressLint({"InlinedApi"})
|
||||
public static int a(BroadcastReceiver broadcastReceiver, Context context, String str, Intent intent) {
|
||||
boolean z = PlatformVersion.i() && context.getApplicationInfo().targetSdkVersion >= 26;
|
||||
boolean z2 = (intent.getFlags() & 268435456) != 0;
|
||||
if (z && !z2) {
|
||||
return b(broadcastReceiver, context, str, intent);
|
||||
}
|
||||
int a = zzav.a().a(context, str, intent);
|
||||
if (!PlatformVersion.i() || a != 402) {
|
||||
return a;
|
||||
}
|
||||
b(broadcastReceiver, context, str, intent);
|
||||
return 403;
|
||||
}
|
||||
|
||||
private static synchronized zzh a(Context context, String str) {
|
||||
synchronized (FirebaseInstanceIdReceiver.class) {
|
||||
if ("com.google.firebase.MESSAGING_EVENT".equals(str)) {
|
||||
if (d == null) {
|
||||
d = new zzh(context, str);
|
||||
}
|
||||
return d;
|
||||
}
|
||||
if (c == null) {
|
||||
c = new zzh(context, str);
|
||||
}
|
||||
return c;
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,42 @@
|
||||
package com.google.firebase.iid;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.util.Log;
|
||||
|
||||
@Deprecated
|
||||
/* loaded from: classes.dex */
|
||||
public class FirebaseInstanceIdService extends zzb {
|
||||
@Override // com.google.firebase.iid.zzb
|
||||
protected final Intent a(Intent intent) {
|
||||
return zzav.a().c.poll();
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public void a() {
|
||||
}
|
||||
|
||||
@Override // com.google.firebase.iid.zzb
|
||||
public final void c(Intent intent) {
|
||||
if ("com.google.firebase.iid.TOKEN_REFRESH".equals(intent.getAction())) {
|
||||
a();
|
||||
return;
|
||||
}
|
||||
String stringExtra = intent.getStringExtra("CMD");
|
||||
if (stringExtra != null) {
|
||||
if (Log.isLoggable("FirebaseInstanceId", 3)) {
|
||||
String valueOf = String.valueOf(intent.getExtras());
|
||||
StringBuilder sb = new StringBuilder(String.valueOf(stringExtra).length() + 21 + String.valueOf(valueOf).length());
|
||||
sb.append("Received command: ");
|
||||
sb.append(stringExtra);
|
||||
sb.append(" - ");
|
||||
sb.append(valueOf);
|
||||
Log.d("FirebaseInstanceId", sb.toString());
|
||||
}
|
||||
if ("RST".equals(stringExtra) || "RST_FULL".equals(stringExtra)) {
|
||||
FirebaseInstanceId.j().e();
|
||||
} else if ("SYNC".equals(stringExtra)) {
|
||||
FirebaseInstanceId.j().i();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
6
sources/com/google/firebase/iid/InstanceIdResult.java
Normal file
6
sources/com/google/firebase/iid/InstanceIdResult.java
Normal file
@@ -0,0 +1,6 @@
|
||||
package com.google.firebase.iid;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public interface InstanceIdResult {
|
||||
String a();
|
||||
}
|
18
sources/com/google/firebase/iid/MessagingChannel.java
Normal file
18
sources/com/google/firebase/iid/MessagingChannel.java
Normal file
@@ -0,0 +1,18 @@
|
||||
package com.google.firebase.iid;
|
||||
|
||||
import com.google.android.gms.tasks.Task;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public interface MessagingChannel {
|
||||
Task<Void> a(String str, String str2);
|
||||
|
||||
Task<Void> a(String str, String str2, String str3);
|
||||
|
||||
Task<String> a(String str, String str2, String str3, String str4);
|
||||
|
||||
boolean a();
|
||||
|
||||
Task<Void> b(String str, String str2, String str3);
|
||||
|
||||
boolean b();
|
||||
}
|
37
sources/com/google/firebase/iid/Registrar.java
Normal file
37
sources/com/google/firebase/iid/Registrar.java
Normal file
@@ -0,0 +1,37 @@
|
||||
package com.google.firebase.iid;
|
||||
|
||||
import androidx.annotation.Keep;
|
||||
import com.google.firebase.FirebaseApp;
|
||||
import com.google.firebase.components.Component;
|
||||
import com.google.firebase.components.ComponentRegistrar;
|
||||
import com.google.firebase.components.Dependency;
|
||||
import com.google.firebase.events.Subscriber;
|
||||
import com.google.firebase.iid.internal.FirebaseInstanceIdInternal;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
@Keep
|
||||
/* loaded from: classes.dex */
|
||||
public final class Registrar implements ComponentRegistrar {
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: private */
|
||||
static class zza implements FirebaseInstanceIdInternal {
|
||||
public zza(FirebaseInstanceId firebaseInstanceId) {
|
||||
}
|
||||
}
|
||||
|
||||
@Override // com.google.firebase.components.ComponentRegistrar
|
||||
@Keep
|
||||
public final List<Component<?>> getComponents() {
|
||||
Component.Builder a = Component.a(FirebaseInstanceId.class);
|
||||
a.a(Dependency.a(FirebaseApp.class));
|
||||
a.a(Dependency.a(Subscriber.class));
|
||||
a.a(zzao.a);
|
||||
a.a();
|
||||
Component b = a.b();
|
||||
Component.Builder a2 = Component.a(FirebaseInstanceIdInternal.class);
|
||||
a2.a(Dependency.a(FirebaseInstanceId.class));
|
||||
a2.a(zzap.a);
|
||||
return Arrays.asList(b, a2.b());
|
||||
}
|
||||
}
|
@@ -0,0 +1,5 @@
|
||||
package com.google.firebase.iid.internal;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public interface FirebaseInstanceIdInternal {
|
||||
}
|
18
sources/com/google/firebase/iid/zza.java
Normal file
18
sources/com/google/firebase/iid/zza.java
Normal file
@@ -0,0 +1,18 @@
|
||||
package com.google.firebase.iid;
|
||||
|
||||
import java.security.KeyPair;
|
||||
import java.security.KeyPairGenerator;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class zza {
|
||||
public static KeyPair a() {
|
||||
try {
|
||||
KeyPairGenerator keyPairGenerator = KeyPairGenerator.getInstance("RSA");
|
||||
keyPairGenerator.initialize(2048);
|
||||
return keyPairGenerator.generateKeyPair();
|
||||
} catch (NoSuchAlgorithmException e) {
|
||||
throw new AssertionError(e);
|
||||
}
|
||||
}
|
||||
}
|
12
sources/com/google/firebase/iid/zzaa.java
Normal file
12
sources/com/google/firebase/iid/zzaa.java
Normal file
@@ -0,0 +1,12 @@
|
||||
package com.google.firebase.iid;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
final class zzaa extends Exception {
|
||||
zzaa(String str) {
|
||||
super(str);
|
||||
}
|
||||
|
||||
zzaa(Exception exc) {
|
||||
super(exc);
|
||||
}
|
||||
}
|
60
sources/com/google/firebase/iid/zzab.java
Normal file
60
sources/com/google/firebase/iid/zzab.java
Normal file
@@ -0,0 +1,60 @@
|
||||
package com.google.firebase.iid;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
import com.google.android.gms.common.util.concurrent.NamedThreadFactory;
|
||||
import com.google.android.gms.tasks.Task;
|
||||
import java.util.concurrent.Executors;
|
||||
import java.util.concurrent.ScheduledExecutorService;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class zzab {
|
||||
private static zzab e;
|
||||
private final Context a;
|
||||
private final ScheduledExecutorService b;
|
||||
private zzad c = new zzad(this);
|
||||
private int d = 1;
|
||||
|
||||
private zzab(Context context, ScheduledExecutorService scheduledExecutorService) {
|
||||
this.b = scheduledExecutorService;
|
||||
this.a = context.getApplicationContext();
|
||||
}
|
||||
|
||||
public static synchronized zzab a(Context context) {
|
||||
zzab zzabVar;
|
||||
synchronized (zzab.class) {
|
||||
if (e == null) {
|
||||
e = new zzab(context, Executors.newSingleThreadScheduledExecutor(new NamedThreadFactory("MessengerIpcClient")));
|
||||
}
|
||||
zzabVar = e;
|
||||
}
|
||||
return zzabVar;
|
||||
}
|
||||
|
||||
public final Task<Bundle> a(int i, Bundle bundle) {
|
||||
return a(new zzam(a(), 1, bundle));
|
||||
}
|
||||
|
||||
private final synchronized <T> Task<T> a(zzak<T> zzakVar) {
|
||||
if (Log.isLoggable("MessengerIpcClient", 3)) {
|
||||
String valueOf = String.valueOf(zzakVar);
|
||||
StringBuilder sb = new StringBuilder(String.valueOf(valueOf).length() + 9);
|
||||
sb.append("Queueing ");
|
||||
sb.append(valueOf);
|
||||
Log.d("MessengerIpcClient", sb.toString());
|
||||
}
|
||||
if (!this.c.a(zzakVar)) {
|
||||
this.c = new zzad(this);
|
||||
this.c.a(zzakVar);
|
||||
}
|
||||
return zzakVar.b.a();
|
||||
}
|
||||
|
||||
private final synchronized int a() {
|
||||
int i;
|
||||
i = this.d;
|
||||
this.d = i + 1;
|
||||
return i;
|
||||
}
|
||||
}
|
305
sources/com/google/firebase/iid/zzad.java
Normal file
305
sources/com/google/firebase/iid/zzad.java
Normal file
@@ -0,0 +1,305 @@
|
||||
package com.google.firebase.iid;
|
||||
|
||||
import android.content.ComponentName;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.ServiceConnection;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.IBinder;
|
||||
import android.os.Looper;
|
||||
import android.os.Message;
|
||||
import android.os.Messenger;
|
||||
import android.os.RemoteException;
|
||||
import android.util.Log;
|
||||
import android.util.SparseArray;
|
||||
import com.google.android.gms.common.internal.Preconditions;
|
||||
import com.google.android.gms.common.stats.ConnectionTracker;
|
||||
import java.util.ArrayDeque;
|
||||
import java.util.Iterator;
|
||||
import java.util.Queue;
|
||||
import java.util.concurrent.ScheduledExecutorService;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
final class zzad implements ServiceConnection {
|
||||
int a;
|
||||
final Messenger b;
|
||||
zzai c;
|
||||
final Queue<zzak<?>> d;
|
||||
final SparseArray<zzak<?>> e;
|
||||
final /* synthetic */ zzab f;
|
||||
|
||||
private zzad(zzab zzabVar) {
|
||||
this.f = zzabVar;
|
||||
this.a = 0;
|
||||
this.b = new Messenger(new com.google.android.gms.internal.firebase_messaging.zza(Looper.getMainLooper(), new Handler.Callback(this) { // from class: com.google.firebase.iid.zzae
|
||||
private final zzad a;
|
||||
|
||||
{
|
||||
this.a = this;
|
||||
}
|
||||
|
||||
@Override // android.os.Handler.Callback
|
||||
public final boolean handleMessage(Message message) {
|
||||
return this.a.a(message);
|
||||
}
|
||||
}));
|
||||
this.d = new ArrayDeque();
|
||||
this.e = new SparseArray<>();
|
||||
}
|
||||
|
||||
private final void c() {
|
||||
ScheduledExecutorService scheduledExecutorService;
|
||||
scheduledExecutorService = this.f.b;
|
||||
scheduledExecutorService.execute(new Runnable(this) { // from class: com.google.firebase.iid.zzag
|
||||
private final zzad a;
|
||||
|
||||
{
|
||||
this.a = this;
|
||||
}
|
||||
|
||||
@Override // java.lang.Runnable
|
||||
public final void run() {
|
||||
final zzak<?> poll;
|
||||
ScheduledExecutorService scheduledExecutorService2;
|
||||
Context context;
|
||||
final zzad zzadVar = this.a;
|
||||
while (true) {
|
||||
synchronized (zzadVar) {
|
||||
if (zzadVar.a != 2) {
|
||||
return;
|
||||
}
|
||||
if (zzadVar.d.isEmpty()) {
|
||||
zzadVar.b();
|
||||
return;
|
||||
}
|
||||
poll = zzadVar.d.poll();
|
||||
zzadVar.e.put(poll.a, poll);
|
||||
scheduledExecutorService2 = zzadVar.f.b;
|
||||
scheduledExecutorService2.schedule(new Runnable(zzadVar, poll) { // from class: com.google.firebase.iid.zzah
|
||||
private final zzad a;
|
||||
private final zzak b;
|
||||
|
||||
{
|
||||
this.a = zzadVar;
|
||||
this.b = poll;
|
||||
}
|
||||
|
||||
@Override // java.lang.Runnable
|
||||
public final void run() {
|
||||
this.a.a(this.b.a);
|
||||
}
|
||||
}, 30L, TimeUnit.SECONDS);
|
||||
}
|
||||
if (Log.isLoggable("MessengerIpcClient", 3)) {
|
||||
String valueOf = String.valueOf(poll);
|
||||
StringBuilder sb = new StringBuilder(String.valueOf(valueOf).length() + 8);
|
||||
sb.append("Sending ");
|
||||
sb.append(valueOf);
|
||||
Log.d("MessengerIpcClient", sb.toString());
|
||||
}
|
||||
context = zzadVar.f.a;
|
||||
Messenger messenger = zzadVar.b;
|
||||
Message obtain = Message.obtain();
|
||||
obtain.what = poll.c;
|
||||
obtain.arg1 = poll.a;
|
||||
obtain.replyTo = messenger;
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putBoolean("oneWay", poll.a());
|
||||
bundle.putString("pkg", context.getPackageName());
|
||||
bundle.putBundle("data", poll.d);
|
||||
obtain.setData(bundle);
|
||||
try {
|
||||
zzadVar.c.a(obtain);
|
||||
} catch (RemoteException e) {
|
||||
zzadVar.a(2, e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
final synchronized boolean a(zzak zzakVar) {
|
||||
Context context;
|
||||
ScheduledExecutorService scheduledExecutorService;
|
||||
int i = this.a;
|
||||
if (i == 0) {
|
||||
this.d.add(zzakVar);
|
||||
Preconditions.b(this.a == 0);
|
||||
if (Log.isLoggable("MessengerIpcClient", 2)) {
|
||||
Log.v("MessengerIpcClient", "Starting bind to GmsCore");
|
||||
}
|
||||
this.a = 1;
|
||||
Intent intent = new Intent("com.google.android.c2dm.intent.REGISTER");
|
||||
intent.setPackage("com.google.android.gms");
|
||||
ConnectionTracker a = ConnectionTracker.a();
|
||||
context = this.f.a;
|
||||
if (a.a(context, intent, this, 1)) {
|
||||
scheduledExecutorService = this.f.b;
|
||||
scheduledExecutorService.schedule(new Runnable(this) { // from class: com.google.firebase.iid.zzaf
|
||||
private final zzad a;
|
||||
|
||||
{
|
||||
this.a = this;
|
||||
}
|
||||
|
||||
@Override // java.lang.Runnable
|
||||
public final void run() {
|
||||
this.a.a();
|
||||
}
|
||||
}, 30L, TimeUnit.SECONDS);
|
||||
} else {
|
||||
a(0, "Unable to bind to service");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
if (i == 1) {
|
||||
this.d.add(zzakVar);
|
||||
return true;
|
||||
}
|
||||
if (i == 2) {
|
||||
this.d.add(zzakVar);
|
||||
c();
|
||||
return true;
|
||||
}
|
||||
if (i != 3 && i != 4) {
|
||||
int i2 = this.a;
|
||||
StringBuilder sb = new StringBuilder(26);
|
||||
sb.append("Unknown state: ");
|
||||
sb.append(i2);
|
||||
throw new IllegalStateException(sb.toString());
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
final synchronized void b() {
|
||||
Context context;
|
||||
if (this.a == 2 && this.d.isEmpty() && this.e.size() == 0) {
|
||||
if (Log.isLoggable("MessengerIpcClient", 2)) {
|
||||
Log.v("MessengerIpcClient", "Finished handling requests, unbinding");
|
||||
}
|
||||
this.a = 3;
|
||||
ConnectionTracker a = ConnectionTracker.a();
|
||||
context = this.f.a;
|
||||
a.a(context, this);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.content.ServiceConnection
|
||||
public final synchronized void onServiceConnected(ComponentName componentName, IBinder iBinder) {
|
||||
if (Log.isLoggable("MessengerIpcClient", 2)) {
|
||||
Log.v("MessengerIpcClient", "Service connected");
|
||||
}
|
||||
if (iBinder == null) {
|
||||
a(0, "Null service connection");
|
||||
return;
|
||||
}
|
||||
try {
|
||||
this.c = new zzai(iBinder);
|
||||
this.a = 2;
|
||||
c();
|
||||
} catch (RemoteException e) {
|
||||
a(0, e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.content.ServiceConnection
|
||||
public final synchronized void onServiceDisconnected(ComponentName componentName) {
|
||||
if (Log.isLoggable("MessengerIpcClient", 2)) {
|
||||
Log.v("MessengerIpcClient", "Service disconnected");
|
||||
}
|
||||
a(2, "Service disconnected");
|
||||
}
|
||||
|
||||
final boolean a(Message message) {
|
||||
int i = message.arg1;
|
||||
if (Log.isLoggable("MessengerIpcClient", 3)) {
|
||||
StringBuilder sb = new StringBuilder(41);
|
||||
sb.append("Received response to request: ");
|
||||
sb.append(i);
|
||||
Log.d("MessengerIpcClient", sb.toString());
|
||||
}
|
||||
synchronized (this) {
|
||||
zzak<?> zzakVar = this.e.get(i);
|
||||
if (zzakVar == null) {
|
||||
StringBuilder sb2 = new StringBuilder(50);
|
||||
sb2.append("Received response for unknown request: ");
|
||||
sb2.append(i);
|
||||
Log.w("MessengerIpcClient", sb2.toString());
|
||||
return true;
|
||||
}
|
||||
this.e.remove(i);
|
||||
b();
|
||||
Bundle data = message.getData();
|
||||
if (data.getBoolean("unsupported", false)) {
|
||||
zzakVar.a(new zzal(4, "Not supported by GmsCore"));
|
||||
} else {
|
||||
zzakVar.a(data);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
final synchronized void a(int i, String str) {
|
||||
Context context;
|
||||
if (Log.isLoggable("MessengerIpcClient", 3)) {
|
||||
String valueOf = String.valueOf(str);
|
||||
Log.d("MessengerIpcClient", valueOf.length() != 0 ? "Disconnected: ".concat(valueOf) : new String("Disconnected: "));
|
||||
}
|
||||
int i2 = this.a;
|
||||
if (i2 == 0) {
|
||||
throw new IllegalStateException();
|
||||
}
|
||||
if (i2 != 1 && i2 != 2) {
|
||||
if (i2 != 3) {
|
||||
if (i2 == 4) {
|
||||
return;
|
||||
}
|
||||
int i3 = this.a;
|
||||
StringBuilder sb = new StringBuilder(26);
|
||||
sb.append("Unknown state: ");
|
||||
sb.append(i3);
|
||||
throw new IllegalStateException(sb.toString());
|
||||
}
|
||||
this.a = 4;
|
||||
return;
|
||||
}
|
||||
if (Log.isLoggable("MessengerIpcClient", 2)) {
|
||||
Log.v("MessengerIpcClient", "Unbinding service");
|
||||
}
|
||||
this.a = 4;
|
||||
ConnectionTracker a = ConnectionTracker.a();
|
||||
context = this.f.a;
|
||||
a.a(context, this);
|
||||
zzal zzalVar = new zzal(i, str);
|
||||
Iterator<zzak<?>> it = this.d.iterator();
|
||||
while (it.hasNext()) {
|
||||
it.next().a(zzalVar);
|
||||
}
|
||||
this.d.clear();
|
||||
for (int i4 = 0; i4 < this.e.size(); i4++) {
|
||||
this.e.valueAt(i4).a(zzalVar);
|
||||
}
|
||||
this.e.clear();
|
||||
}
|
||||
|
||||
final synchronized void a() {
|
||||
if (this.a == 1) {
|
||||
a(1, "Timed out while binding");
|
||||
}
|
||||
}
|
||||
|
||||
final synchronized void a(int i) {
|
||||
zzak<?> zzakVar = this.e.get(i);
|
||||
if (zzakVar != null) {
|
||||
StringBuilder sb = new StringBuilder(31);
|
||||
sb.append("Timing out request: ");
|
||||
sb.append(i);
|
||||
Log.w("MessengerIpcClient", sb.toString());
|
||||
this.e.remove(i);
|
||||
zzakVar.a(new zzal(3, "Timed out waiting for response"));
|
||||
b();
|
||||
}
|
||||
}
|
||||
}
|
41
sources/com/google/firebase/iid/zzai.java
Normal file
41
sources/com/google/firebase/iid/zzai.java
Normal file
@@ -0,0 +1,41 @@
|
||||
package com.google.firebase.iid;
|
||||
|
||||
import android.os.IBinder;
|
||||
import android.os.Message;
|
||||
import android.os.Messenger;
|
||||
import android.os.RemoteException;
|
||||
import android.util.Log;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
final class zzai {
|
||||
private final Messenger a;
|
||||
private final zzl b;
|
||||
|
||||
zzai(IBinder iBinder) throws RemoteException {
|
||||
String interfaceDescriptor = iBinder.getInterfaceDescriptor();
|
||||
if ("android.os.IMessenger".equals(interfaceDescriptor)) {
|
||||
this.a = new Messenger(iBinder);
|
||||
this.b = null;
|
||||
} else if ("com.google.android.gms.iid.IMessengerCompat".equals(interfaceDescriptor)) {
|
||||
this.b = new zzl(iBinder);
|
||||
this.a = null;
|
||||
} else {
|
||||
String valueOf = String.valueOf(interfaceDescriptor);
|
||||
Log.w("MessengerIpcClient", valueOf.length() != 0 ? "Invalid interface descriptor: ".concat(valueOf) : new String("Invalid interface descriptor: "));
|
||||
throw new RemoteException();
|
||||
}
|
||||
}
|
||||
|
||||
final void a(Message message) throws RemoteException {
|
||||
Messenger messenger = this.a;
|
||||
if (messenger != null) {
|
||||
messenger.send(message);
|
||||
return;
|
||||
}
|
||||
zzl zzlVar = this.b;
|
||||
if (zzlVar == null) {
|
||||
throw new IllegalStateException("Both messengers are null");
|
||||
}
|
||||
zzlVar.send(message);
|
||||
}
|
||||
}
|
66
sources/com/google/firebase/iid/zzak.java
Normal file
66
sources/com/google/firebase/iid/zzak.java
Normal file
@@ -0,0 +1,66 @@
|
||||
package com.google.firebase.iid;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
import com.google.android.gms.tasks.TaskCompletionSource;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
abstract class zzak<T> {
|
||||
final int a;
|
||||
final TaskCompletionSource<T> b = new TaskCompletionSource<>();
|
||||
final int c;
|
||||
final Bundle d;
|
||||
|
||||
zzak(int i, int i2, Bundle bundle) {
|
||||
this.a = i;
|
||||
this.c = i2;
|
||||
this.d = bundle;
|
||||
}
|
||||
|
||||
abstract void a(Bundle bundle);
|
||||
|
||||
final void a(T t) {
|
||||
if (Log.isLoggable("MessengerIpcClient", 3)) {
|
||||
String valueOf = String.valueOf(this);
|
||||
String valueOf2 = String.valueOf(t);
|
||||
StringBuilder sb = new StringBuilder(String.valueOf(valueOf).length() + 16 + String.valueOf(valueOf2).length());
|
||||
sb.append("Finishing ");
|
||||
sb.append(valueOf);
|
||||
sb.append(" with ");
|
||||
sb.append(valueOf2);
|
||||
Log.d("MessengerIpcClient", sb.toString());
|
||||
}
|
||||
this.b.a((TaskCompletionSource<T>) t);
|
||||
}
|
||||
|
||||
abstract boolean a();
|
||||
|
||||
public String toString() {
|
||||
int i = this.c;
|
||||
int i2 = this.a;
|
||||
boolean a = a();
|
||||
StringBuilder sb = new StringBuilder(55);
|
||||
sb.append("Request { what=");
|
||||
sb.append(i);
|
||||
sb.append(" id=");
|
||||
sb.append(i2);
|
||||
sb.append(" oneWay=");
|
||||
sb.append(a);
|
||||
sb.append("}");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
final void a(zzal zzalVar) {
|
||||
if (Log.isLoggable("MessengerIpcClient", 3)) {
|
||||
String valueOf = String.valueOf(this);
|
||||
String valueOf2 = String.valueOf(zzalVar);
|
||||
StringBuilder sb = new StringBuilder(String.valueOf(valueOf).length() + 14 + String.valueOf(valueOf2).length());
|
||||
sb.append("Failing ");
|
||||
sb.append(valueOf);
|
||||
sb.append(" with ");
|
||||
sb.append(valueOf2);
|
||||
Log.d("MessengerIpcClient", sb.toString());
|
||||
}
|
||||
this.b.a(zzalVar);
|
||||
}
|
||||
}
|
15
sources/com/google/firebase/iid/zzal.java
Normal file
15
sources/com/google/firebase/iid/zzal.java
Normal file
@@ -0,0 +1,15 @@
|
||||
package com.google.firebase.iid;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class zzal extends Exception {
|
||||
private final int errorCode;
|
||||
|
||||
public zzal(int i, String str) {
|
||||
super(str);
|
||||
this.errorCode = i;
|
||||
}
|
||||
|
||||
public final int getErrorCode() {
|
||||
return this.errorCode;
|
||||
}
|
||||
}
|
24
sources/com/google/firebase/iid/zzam.java
Normal file
24
sources/com/google/firebase/iid/zzam.java
Normal file
@@ -0,0 +1,24 @@
|
||||
package com.google.firebase.iid;
|
||||
|
||||
import android.os.Bundle;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
final class zzam extends zzak<Bundle> {
|
||||
zzam(int i, int i2, Bundle bundle) {
|
||||
super(i, 1, bundle);
|
||||
}
|
||||
|
||||
@Override // com.google.firebase.iid.zzak
|
||||
final void a(Bundle bundle) {
|
||||
Bundle bundle2 = bundle.getBundle("data");
|
||||
if (bundle2 == null) {
|
||||
bundle2 = Bundle.EMPTY;
|
||||
}
|
||||
a((zzam) bundle2);
|
||||
}
|
||||
|
||||
@Override // com.google.firebase.iid.zzak
|
||||
final boolean a() {
|
||||
return false;
|
||||
}
|
||||
}
|
136
sources/com/google/firebase/iid/zzan.java
Normal file
136
sources/com/google/firebase/iid/zzan.java
Normal file
@@ -0,0 +1,136 @@
|
||||
package com.google.firebase.iid;
|
||||
|
||||
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.Base64;
|
||||
import android.util.Log;
|
||||
import com.google.android.gms.common.util.PlatformVersion;
|
||||
import com.google.firebase.FirebaseApp;
|
||||
import java.security.KeyPair;
|
||||
import java.security.MessageDigest;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import java.util.List;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class zzan {
|
||||
private final Context a;
|
||||
private String b;
|
||||
private String c;
|
||||
private int d;
|
||||
private int e = 0;
|
||||
|
||||
public zzan(Context context) {
|
||||
this.a = context;
|
||||
}
|
||||
|
||||
private final synchronized void e() {
|
||||
PackageInfo a = a(this.a.getPackageName());
|
||||
if (a != null) {
|
||||
this.b = Integer.toString(a.versionCode);
|
||||
this.c = a.versionName;
|
||||
}
|
||||
}
|
||||
|
||||
public final synchronized int a() {
|
||||
if (this.e != 0) {
|
||||
return this.e;
|
||||
}
|
||||
PackageManager packageManager = this.a.getPackageManager();
|
||||
if (packageManager.checkPermission("com.google.android.c2dm.permission.SEND", "com.google.android.gms") == -1) {
|
||||
Log.e("FirebaseInstanceId", "Google Play services missing or without correct permission.");
|
||||
return 0;
|
||||
}
|
||||
if (!PlatformVersion.i()) {
|
||||
Intent intent = new Intent("com.google.android.c2dm.intent.REGISTER");
|
||||
intent.setPackage("com.google.android.gms");
|
||||
List<ResolveInfo> queryIntentServices = packageManager.queryIntentServices(intent, 0);
|
||||
if (queryIntentServices != null && queryIntentServices.size() > 0) {
|
||||
this.e = 1;
|
||||
return this.e;
|
||||
}
|
||||
}
|
||||
Intent intent2 = new Intent("com.google.iid.TOKEN_REQUEST");
|
||||
intent2.setPackage("com.google.android.gms");
|
||||
List<ResolveInfo> queryBroadcastReceivers = packageManager.queryBroadcastReceivers(intent2, 0);
|
||||
if (queryBroadcastReceivers != null && queryBroadcastReceivers.size() > 0) {
|
||||
this.e = 2;
|
||||
return this.e;
|
||||
}
|
||||
Log.w("FirebaseInstanceId", "Failed to resolve IID implementation package, falling back");
|
||||
if (PlatformVersion.i()) {
|
||||
this.e = 2;
|
||||
} else {
|
||||
this.e = 1;
|
||||
}
|
||||
return this.e;
|
||||
}
|
||||
|
||||
public final synchronized String b() {
|
||||
if (this.b == null) {
|
||||
e();
|
||||
}
|
||||
return this.b;
|
||||
}
|
||||
|
||||
public final synchronized String c() {
|
||||
if (this.c == null) {
|
||||
e();
|
||||
}
|
||||
return this.c;
|
||||
}
|
||||
|
||||
public final synchronized int d() {
|
||||
PackageInfo a;
|
||||
if (this.d == 0 && (a = a("com.google.android.gms")) != null) {
|
||||
this.d = a.versionCode;
|
||||
}
|
||||
return this.d;
|
||||
}
|
||||
|
||||
public static String a(FirebaseApp firebaseApp) {
|
||||
String b = firebaseApp.c().b();
|
||||
if (b != null) {
|
||||
return b;
|
||||
}
|
||||
String a = firebaseApp.c().a();
|
||||
if (!a.startsWith("1:")) {
|
||||
return a;
|
||||
}
|
||||
String[] split = a.split(":");
|
||||
if (split.length < 2) {
|
||||
return null;
|
||||
}
|
||||
String str = split[1];
|
||||
if (str.isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
||||
public static String a(KeyPair keyPair) {
|
||||
try {
|
||||
byte[] digest = MessageDigest.getInstance("SHA1").digest(keyPair.getPublic().getEncoded());
|
||||
digest[0] = (byte) ((digest[0] & 15) + 112);
|
||||
return Base64.encodeToString(digest, 0, 8, 11);
|
||||
} catch (NoSuchAlgorithmException unused) {
|
||||
Log.w("FirebaseInstanceId", "Unexpected error, device missing required algorithms");
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private final PackageInfo a(String str) {
|
||||
try {
|
||||
return this.a.getPackageManager().getPackageInfo(str, 0);
|
||||
} catch (PackageManager.NameNotFoundException e) {
|
||||
String valueOf = String.valueOf(e);
|
||||
StringBuilder sb = new StringBuilder(String.valueOf(valueOf).length() + 23);
|
||||
sb.append("Failed to find package ");
|
||||
sb.append(valueOf);
|
||||
Log.w("FirebaseInstanceId", sb.toString());
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
19
sources/com/google/firebase/iid/zzao.java
Normal file
19
sources/com/google/firebase/iid/zzao.java
Normal file
@@ -0,0 +1,19 @@
|
||||
package com.google.firebase.iid;
|
||||
|
||||
import com.google.firebase.FirebaseApp;
|
||||
import com.google.firebase.components.ComponentContainer;
|
||||
import com.google.firebase.components.ComponentFactory;
|
||||
import com.google.firebase.events.Subscriber;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
final /* synthetic */ class zzao implements ComponentFactory {
|
||||
static final ComponentFactory a = new zzao();
|
||||
|
||||
private zzao() {
|
||||
}
|
||||
|
||||
@Override // com.google.firebase.components.ComponentFactory
|
||||
public final Object a(ComponentContainer componentContainer) {
|
||||
return new FirebaseInstanceId((FirebaseApp) componentContainer.a(FirebaseApp.class), (Subscriber) componentContainer.a(Subscriber.class));
|
||||
}
|
||||
}
|
18
sources/com/google/firebase/iid/zzap.java
Normal file
18
sources/com/google/firebase/iid/zzap.java
Normal file
@@ -0,0 +1,18 @@
|
||||
package com.google.firebase.iid;
|
||||
|
||||
import com.google.firebase.components.ComponentContainer;
|
||||
import com.google.firebase.components.ComponentFactory;
|
||||
import com.google.firebase.iid.Registrar;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
final /* synthetic */ class zzap implements ComponentFactory {
|
||||
static final ComponentFactory a = new zzap();
|
||||
|
||||
private zzap() {
|
||||
}
|
||||
|
||||
@Override // com.google.firebase.components.ComponentFactory
|
||||
public final Object a(ComponentContainer componentContainer) {
|
||||
return new Registrar.zza((FirebaseInstanceId) componentContainer.a(FirebaseInstanceId.class));
|
||||
}
|
||||
}
|
66
sources/com/google/firebase/iid/zzaq.java
Normal file
66
sources/com/google/firebase/iid/zzaq.java
Normal file
@@ -0,0 +1,66 @@
|
||||
package com.google.firebase.iid;
|
||||
|
||||
import android.util.Log;
|
||||
import android.util.Pair;
|
||||
import androidx.collection.ArrayMap;
|
||||
import com.google.android.gms.tasks.Continuation;
|
||||
import com.google.android.gms.tasks.Task;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.Executor;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
final class zzaq {
|
||||
private final Executor a;
|
||||
private final Map<Pair<String, String>, Task<String>> b = new ArrayMap();
|
||||
|
||||
zzaq(Executor executor) {
|
||||
this.a = executor;
|
||||
}
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
final synchronized Task<String> a(String str, String str2, zzas zzasVar) {
|
||||
final Pair pair = new Pair(str, str2);
|
||||
Task<String> task = this.b.get(pair);
|
||||
if (task != null) {
|
||||
if (Log.isLoggable("FirebaseInstanceId", 3)) {
|
||||
String valueOf = String.valueOf(pair);
|
||||
StringBuilder sb = new StringBuilder(String.valueOf(valueOf).length() + 29);
|
||||
sb.append("Joining ongoing request for: ");
|
||||
sb.append(valueOf);
|
||||
Log.d("FirebaseInstanceId", sb.toString());
|
||||
}
|
||||
return task;
|
||||
}
|
||||
if (Log.isLoggable("FirebaseInstanceId", 3)) {
|
||||
String valueOf2 = String.valueOf(pair);
|
||||
StringBuilder sb2 = new StringBuilder(String.valueOf(valueOf2).length() + 24);
|
||||
sb2.append("Making new request for: ");
|
||||
sb2.append(valueOf2);
|
||||
Log.d("FirebaseInstanceId", sb2.toString());
|
||||
}
|
||||
Task b = zzasVar.a().b(this.a, new Continuation(this, pair) { // from class: com.google.firebase.iid.zzar
|
||||
private final zzaq a;
|
||||
private final Pair b;
|
||||
|
||||
{
|
||||
this.a = this;
|
||||
this.b = pair;
|
||||
}
|
||||
|
||||
@Override // com.google.android.gms.tasks.Continuation
|
||||
public final Object a(Task task2) {
|
||||
this.a.a(this.b, task2);
|
||||
return task2;
|
||||
}
|
||||
});
|
||||
this.b.put(pair, b);
|
||||
return b;
|
||||
}
|
||||
|
||||
final /* synthetic */ Task a(Pair pair, Task task) throws Exception {
|
||||
synchronized (this) {
|
||||
this.b.remove(pair);
|
||||
}
|
||||
return task;
|
||||
}
|
||||
}
|
8
sources/com/google/firebase/iid/zzas.java
Normal file
8
sources/com/google/firebase/iid/zzas.java
Normal file
@@ -0,0 +1,8 @@
|
||||
package com.google.firebase.iid;
|
||||
|
||||
import com.google.android.gms.tasks.Task;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
interface zzas {
|
||||
Task<String> a();
|
||||
}
|
215
sources/com/google/firebase/iid/zzat.java
Normal file
215
sources/com/google/firebase/iid/zzat.java
Normal file
@@ -0,0 +1,215 @@
|
||||
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 android.util.Log;
|
||||
import androidx.collection.SimpleArrayMap;
|
||||
import com.baidu.cloud.media.player.BDCloudMediaPlayer;
|
||||
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.iid.zzl;
|
||||
import java.io.IOException;
|
||||
import java.util.concurrent.ExecutionException;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
final class zzat {
|
||||
private static int g;
|
||||
private static PendingIntent h;
|
||||
private final Context b;
|
||||
private final zzan c;
|
||||
private Messenger e;
|
||||
private zzl f;
|
||||
private final SimpleArrayMap<String, TaskCompletionSource<Bundle>> a = new SimpleArrayMap<>();
|
||||
private Messenger d = new Messenger(new zzau(this, Looper.getMainLooper()));
|
||||
|
||||
public zzat(Context context, zzan zzanVar) {
|
||||
this.b = context;
|
||||
this.c = zzanVar;
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: private */
|
||||
public final void a(Message message) {
|
||||
if (message != null) {
|
||||
Object obj = message.obj;
|
||||
if (obj instanceof Intent) {
|
||||
Intent intent = (Intent) obj;
|
||||
intent.setExtrasClassLoader(new zzl.zza());
|
||||
if (intent.hasExtra("google.messenger")) {
|
||||
Parcelable parcelableExtra = intent.getParcelableExtra("google.messenger");
|
||||
if (parcelableExtra instanceof zzl) {
|
||||
this.f = (zzl) parcelableExtra;
|
||||
}
|
||||
if (parcelableExtra instanceof Messenger) {
|
||||
this.e = (Messenger) parcelableExtra;
|
||||
}
|
||||
}
|
||||
Intent intent2 = (Intent) message.obj;
|
||||
String action = intent2.getAction();
|
||||
if (!"com.google.android.c2dm.intent.REGISTRATION".equals(action)) {
|
||||
if (Log.isLoggable("FirebaseInstanceId", 3)) {
|
||||
String valueOf = String.valueOf(action);
|
||||
Log.d("FirebaseInstanceId", valueOf.length() != 0 ? "Unexpected response action: ".concat(valueOf) : new String("Unexpected response action: "));
|
||||
return;
|
||||
}
|
||||
return;
|
||||
}
|
||||
String stringExtra = intent2.getStringExtra("registration_id");
|
||||
if (stringExtra == null) {
|
||||
stringExtra = intent2.getStringExtra("unregistered");
|
||||
}
|
||||
if (stringExtra != null) {
|
||||
Matcher matcher = Pattern.compile("\\|ID\\|([^|]+)\\|:?+(.*)").matcher(stringExtra);
|
||||
if (!matcher.matches()) {
|
||||
if (Log.isLoggable("FirebaseInstanceId", 3)) {
|
||||
String valueOf2 = String.valueOf(stringExtra);
|
||||
Log.d("FirebaseInstanceId", valueOf2.length() != 0 ? "Unexpected response string: ".concat(valueOf2) : new String("Unexpected response string: "));
|
||||
return;
|
||||
}
|
||||
return;
|
||||
}
|
||||
String group = matcher.group(1);
|
||||
String group2 = matcher.group(2);
|
||||
Bundle extras = intent2.getExtras();
|
||||
extras.putString("registration_id", group2);
|
||||
a(group, extras);
|
||||
return;
|
||||
}
|
||||
String stringExtra2 = intent2.getStringExtra(BDCloudMediaPlayer.OnNativeInvokeListener.ARG_ERROR);
|
||||
if (stringExtra2 == null) {
|
||||
String valueOf3 = String.valueOf(intent2.getExtras());
|
||||
StringBuilder sb = new StringBuilder(String.valueOf(valueOf3).length() + 49);
|
||||
sb.append("Unexpected response, no error or registration id ");
|
||||
sb.append(valueOf3);
|
||||
Log.w("FirebaseInstanceId", sb.toString());
|
||||
return;
|
||||
}
|
||||
if (Log.isLoggable("FirebaseInstanceId", 3)) {
|
||||
String valueOf4 = String.valueOf(stringExtra2);
|
||||
Log.d("FirebaseInstanceId", valueOf4.length() != 0 ? "Received InstanceID error ".concat(valueOf4) : new String("Received InstanceID error "));
|
||||
}
|
||||
if (!stringExtra2.startsWith("|")) {
|
||||
synchronized (this.a) {
|
||||
for (int i = 0; i < this.a.size(); i++) {
|
||||
a(this.a.b(i), intent2.getExtras());
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
String[] split = stringExtra2.split("\\|");
|
||||
if (split.length <= 2 || !"ID".equals(split[1])) {
|
||||
String valueOf5 = String.valueOf(stringExtra2);
|
||||
Log.w("FirebaseInstanceId", valueOf5.length() != 0 ? "Unexpected structured response ".concat(valueOf5) : new String("Unexpected structured response "));
|
||||
return;
|
||||
}
|
||||
String str = split[2];
|
||||
String str2 = split[3];
|
||||
if (str2.startsWith(":")) {
|
||||
str2 = str2.substring(1);
|
||||
}
|
||||
a(str, intent2.putExtra(BDCloudMediaPlayer.OnNativeInvokeListener.ARG_ERROR, str2).getExtras());
|
||||
return;
|
||||
}
|
||||
}
|
||||
Log.w("FirebaseInstanceId", "Dropping invalid message");
|
||||
}
|
||||
|
||||
private final Bundle b(Bundle bundle) throws IOException {
|
||||
Bundle c = c(bundle);
|
||||
if (c == null || !c.containsKey("google.messenger")) {
|
||||
return c;
|
||||
}
|
||||
Bundle c2 = c(bundle);
|
||||
if (c2 == null || !c2.containsKey("google.messenger")) {
|
||||
return c2;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/* JADX WARN: Code restructure failed: missing block: B:17:0x00a3, code lost:
|
||||
|
||||
if (r7.f != null) goto L19;
|
||||
*/
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
/* JADX WARN: Removed duplicated region for block: B:25:0x00ef 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: r1v7 */
|
||||
/* JADX WARN: Type inference failed for: r8v10 */
|
||||
/* JADX WARN: Type inference failed for: r8v21, types: [android.os.Bundle] */
|
||||
/* JADX WARN: Unsupported multi-entry loop pattern (BACK_EDGE: B:20:0x00d3 -> B:21:0x00de). Please report as a decompilation issue!!! */
|
||||
/* JADX WARN: Unsupported multi-entry loop pattern (BACK_EDGE: B:54:0x00d9 -> B:21:0x00de). Please report as a decompilation issue!!! */
|
||||
/*
|
||||
Code decompiled incorrectly, please refer to instructions dump.
|
||||
To view partially-correct code enable 'Show inconsistent code' option in preferences
|
||||
*/
|
||||
private final android.os.Bundle c(android.os.Bundle r8) throws java.io.IOException {
|
||||
/*
|
||||
Method dump skipped, instructions count: 297
|
||||
To view this dump change 'Code comments level' option to 'DEBUG'
|
||||
*/
|
||||
throw new UnsupportedOperationException("Method not decompiled: com.google.firebase.iid.zzat.c(android.os.Bundle):android.os.Bundle");
|
||||
}
|
||||
|
||||
private static synchronized void a(Context context, Intent intent) {
|
||||
synchronized (zzat.class) {
|
||||
if (h == null) {
|
||||
Intent intent2 = new Intent();
|
||||
intent2.setPackage("com.google.example.invalidpackage");
|
||||
h = PendingIntent.getBroadcast(context, 0, intent2, 0);
|
||||
}
|
||||
intent.putExtra("app", h);
|
||||
}
|
||||
}
|
||||
|
||||
private final void a(String str, Bundle bundle) {
|
||||
synchronized (this.a) {
|
||||
TaskCompletionSource<Bundle> remove = this.a.remove(str);
|
||||
if (remove == null) {
|
||||
String valueOf = String.valueOf(str);
|
||||
Log.w("FirebaseInstanceId", valueOf.length() != 0 ? "Missing callback for ".concat(valueOf) : new String("Missing callback for "));
|
||||
} else {
|
||||
remove.a((TaskCompletionSource<Bundle>) bundle);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
final Bundle a(Bundle bundle) throws IOException {
|
||||
if (this.c.d() >= 12000000) {
|
||||
try {
|
||||
return (Bundle) Tasks.a((Task) zzab.a(this.b).a(1, bundle));
|
||||
} catch (InterruptedException | ExecutionException e) {
|
||||
if (Log.isLoggable("FirebaseInstanceId", 3)) {
|
||||
String valueOf = String.valueOf(e);
|
||||
StringBuilder sb = new StringBuilder(String.valueOf(valueOf).length() + 22);
|
||||
sb.append("Error making request: ");
|
||||
sb.append(valueOf);
|
||||
Log.d("FirebaseInstanceId", sb.toString());
|
||||
}
|
||||
if ((e.getCause() instanceof zzal) && ((zzal) e.getCause()).getErrorCode() == 4) {
|
||||
return b(bundle);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
return b(bundle);
|
||||
}
|
||||
|
||||
private static synchronized String a() {
|
||||
String num;
|
||||
synchronized (zzat.class) {
|
||||
int i = g;
|
||||
g = i + 1;
|
||||
num = Integer.toString(i);
|
||||
}
|
||||
return num;
|
||||
}
|
||||
}
|
20
sources/com/google/firebase/iid/zzau.java
Normal file
20
sources/com/google/firebase/iid/zzau.java
Normal file
@@ -0,0 +1,20 @@
|
||||
package com.google.firebase.iid;
|
||||
|
||||
import android.os.Looper;
|
||||
import android.os.Message;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
final class zzau extends com.google.android.gms.internal.firebase_messaging.zza {
|
||||
private final /* synthetic */ zzat a;
|
||||
|
||||
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
|
||||
zzau(zzat zzatVar, Looper looper) {
|
||||
super(looper);
|
||||
this.a = zzatVar;
|
||||
}
|
||||
|
||||
@Override // android.os.Handler
|
||||
public final void handleMessage(Message message) {
|
||||
this.a.a(message);
|
||||
}
|
||||
}
|
93
sources/com/google/firebase/iid/zzav.java
Normal file
93
sources/com/google/firebase/iid/zzav.java
Normal file
@@ -0,0 +1,93 @@
|
||||
package com.google.firebase.iid;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.util.Log;
|
||||
import androidx.collection.SimpleArrayMap;
|
||||
import com.ubt.jimu.base.mvp.SingleClickListener;
|
||||
import java.util.ArrayDeque;
|
||||
import java.util.Queue;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class zzav {
|
||||
private static zzav e;
|
||||
private final SimpleArrayMap<String, String> a = new SimpleArrayMap<>();
|
||||
private Boolean b = null;
|
||||
final Queue<Intent> c = new ArrayDeque();
|
||||
private final Queue<Intent> d = new ArrayDeque();
|
||||
|
||||
private zzav() {
|
||||
}
|
||||
|
||||
public static synchronized zzav a() {
|
||||
zzav zzavVar;
|
||||
synchronized (zzav.class) {
|
||||
if (e == null) {
|
||||
e = new zzav();
|
||||
}
|
||||
zzavVar = e;
|
||||
}
|
||||
return zzavVar;
|
||||
}
|
||||
|
||||
public static void b(Context context, Intent intent) {
|
||||
context.sendBroadcast(b(context, "com.google.firebase.MESSAGING_EVENT", intent));
|
||||
}
|
||||
|
||||
/* JADX WARN: Removed duplicated region for block: B:37:0x00d9 A[Catch: IllegalStateException -> 0x010e, SecurityException -> 0x0136, TryCatch #4 {IllegalStateException -> 0x010e, SecurityException -> 0x0136, blocks: (B:35:0x00d5, B:37:0x00d9, B:40:0x00e2, B:41:0x00e8, B:43:0x00f0, B:45:0x0102, B:49:0x00f5), top: B:34:0x00d5 }] */
|
||||
/* JADX WARN: Removed duplicated region for block: B:43:0x00f0 A[Catch: IllegalStateException -> 0x010e, SecurityException -> 0x0136, TryCatch #4 {IllegalStateException -> 0x010e, SecurityException -> 0x0136, blocks: (B:35:0x00d5, B:37:0x00d9, B:40:0x00e2, B:41:0x00e8, B:43:0x00f0, B:45:0x0102, B:49:0x00f5), top: B:34:0x00d5 }] */
|
||||
/* JADX WARN: Removed duplicated region for block: B:45:0x0102 A[Catch: IllegalStateException -> 0x010e, SecurityException -> 0x0136, TRY_LEAVE, TryCatch #4 {IllegalStateException -> 0x010e, SecurityException -> 0x0136, blocks: (B:35:0x00d5, B:37:0x00d9, B:40:0x00e2, B:41:0x00e8, B:43:0x00f0, B:45:0x0102, B:49:0x00f5), top: B:34:0x00d5 }] */
|
||||
/* JADX WARN: Removed duplicated region for block: B:48:0x010c A[RETURN] */
|
||||
/* JADX WARN: Removed duplicated region for block: B:49:0x00f5 A[Catch: IllegalStateException -> 0x010e, SecurityException -> 0x0136, TryCatch #4 {IllegalStateException -> 0x010e, SecurityException -> 0x0136, blocks: (B:35:0x00d5, B:37:0x00d9, B:40:0x00e2, B:41:0x00e8, B:43:0x00f0, B:45:0x0102, B:49:0x00f5), top: B:34:0x00d5 }] */
|
||||
/*
|
||||
Code decompiled incorrectly, please refer to instructions dump.
|
||||
To view partially-correct code enable 'Show inconsistent code' option in preferences
|
||||
*/
|
||||
private final int c(android.content.Context r6, android.content.Intent r7) {
|
||||
/*
|
||||
Method dump skipped, instructions count: 324
|
||||
To view this dump change 'Code comments level' option to 'DEBUG'
|
||||
*/
|
||||
throw new UnsupportedOperationException("Method not decompiled: com.google.firebase.iid.zzav.c(android.content.Context, android.content.Intent):int");
|
||||
}
|
||||
|
||||
private static Intent b(Context context, String str, Intent intent) {
|
||||
Intent intent2 = new Intent(context, (Class<?>) FirebaseInstanceIdReceiver.class);
|
||||
intent2.setAction(str);
|
||||
intent2.putExtra("wrapped_intent", intent);
|
||||
return intent2;
|
||||
}
|
||||
|
||||
public static void a(Context context, Intent intent) {
|
||||
context.sendBroadcast(b(context, "com.google.firebase.INSTANCE_ID_EVENT", intent));
|
||||
}
|
||||
|
||||
public final int a(Context context, String str, Intent intent) {
|
||||
if (Log.isLoggable("FirebaseInstanceId", 3)) {
|
||||
String valueOf = String.valueOf(str);
|
||||
Log.d("FirebaseInstanceId", valueOf.length() != 0 ? "Starting service: ".concat(valueOf) : new String("Starting service: "));
|
||||
}
|
||||
char c = 65535;
|
||||
int hashCode = str.hashCode();
|
||||
if (hashCode != -842411455) {
|
||||
if (hashCode == 41532704 && str.equals("com.google.firebase.MESSAGING_EVENT")) {
|
||||
c = 1;
|
||||
}
|
||||
} else if (str.equals("com.google.firebase.INSTANCE_ID_EVENT")) {
|
||||
c = 0;
|
||||
}
|
||||
if (c == 0) {
|
||||
this.c.offer(intent);
|
||||
} else {
|
||||
if (c != 1) {
|
||||
String valueOf2 = String.valueOf(str);
|
||||
Log.w("FirebaseInstanceId", valueOf2.length() != 0 ? "Unknown service action: ".concat(valueOf2) : new String("Unknown service action: "));
|
||||
return SingleClickListener.FAST_CLICK_DELAY_TIME;
|
||||
}
|
||||
this.d.offer(intent);
|
||||
}
|
||||
Intent intent2 = new Intent(str);
|
||||
intent2.setPackage(context.getPackageName());
|
||||
return c(context, intent2);
|
||||
}
|
||||
}
|
124
sources/com/google/firebase/iid/zzaw.java
Normal file
124
sources/com/google/firebase/iid/zzaw.java
Normal file
@@ -0,0 +1,124 @@
|
||||
package com.google.firebase.iid;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
import android.util.Log;
|
||||
import androidx.collection.ArrayMap;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.Map;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
final class zzaw {
|
||||
private final SharedPreferences a;
|
||||
private final Context b;
|
||||
private final zzy c;
|
||||
private final Map<String, zzz> d;
|
||||
|
||||
public zzaw(Context context) {
|
||||
this(context, new zzy());
|
||||
}
|
||||
|
||||
private static String b(String str, String str2, String str3) {
|
||||
StringBuilder sb = new StringBuilder(String.valueOf(str).length() + 4 + String.valueOf(str2).length() + String.valueOf(str3).length());
|
||||
sb.append(str);
|
||||
sb.append("|T|");
|
||||
sb.append(str2);
|
||||
sb.append("|");
|
||||
sb.append(str3);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
private final synchronized boolean c() {
|
||||
return this.a.getAll().isEmpty();
|
||||
}
|
||||
|
||||
public final synchronized String a() {
|
||||
return this.a.getString("topic_operaion_queue", "");
|
||||
}
|
||||
|
||||
private zzaw(Context context, zzy zzyVar) {
|
||||
this.d = new ArrayMap();
|
||||
this.b = context;
|
||||
this.a = context.getSharedPreferences("com.google.android.gms.appid", 0);
|
||||
this.c = zzyVar;
|
||||
File file = new File(ContextCompat.b(this.b), "com.google.android.gms.appid-no-backup");
|
||||
if (file.exists()) {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
if (!file.createNewFile() || c()) {
|
||||
return;
|
||||
}
|
||||
Log.i("FirebaseInstanceId", "App restored, clearing state");
|
||||
b();
|
||||
FirebaseInstanceId.j().e();
|
||||
} catch (IOException e) {
|
||||
if (Log.isLoggable("FirebaseInstanceId", 3)) {
|
||||
String valueOf = String.valueOf(e.getMessage());
|
||||
Log.d("FirebaseInstanceId", valueOf.length() != 0 ? "Error creating file in no backup dir: ".concat(valueOf) : new String("Error creating file in no backup dir: "));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public final synchronized void a(String str) {
|
||||
this.a.edit().putString("topic_operaion_queue", str).apply();
|
||||
}
|
||||
|
||||
public final synchronized void b() {
|
||||
this.d.clear();
|
||||
zzy.a(this.b);
|
||||
this.a.edit().clear().commit();
|
||||
}
|
||||
|
||||
public final synchronized void c(String str) {
|
||||
String concat = String.valueOf(str).concat("|T|");
|
||||
SharedPreferences.Editor edit = this.a.edit();
|
||||
for (String str2 : this.a.getAll().keySet()) {
|
||||
if (str2.startsWith(concat)) {
|
||||
edit.remove(str2);
|
||||
}
|
||||
}
|
||||
edit.commit();
|
||||
}
|
||||
|
||||
static String a(String str, String str2) {
|
||||
StringBuilder sb = new StringBuilder(String.valueOf(str).length() + 3 + String.valueOf(str2).length());
|
||||
sb.append(str);
|
||||
sb.append("|S|");
|
||||
sb.append(str2);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public final synchronized zzax a(String str, String str2, String str3) {
|
||||
return zzax.b(this.a.getString(b(str, str2, str3), null));
|
||||
}
|
||||
|
||||
public final synchronized void a(String str, String str2, String str3, String str4, String str5) {
|
||||
String a = zzax.a(str4, str5, System.currentTimeMillis());
|
||||
if (a == null) {
|
||||
return;
|
||||
}
|
||||
SharedPreferences.Editor edit = this.a.edit();
|
||||
edit.putString(b(str, str2, str3), a);
|
||||
edit.commit();
|
||||
}
|
||||
|
||||
public final synchronized zzz b(String str) {
|
||||
zzz b;
|
||||
zzz zzzVar = this.d.get(str);
|
||||
if (zzzVar != null) {
|
||||
return zzzVar;
|
||||
}
|
||||
try {
|
||||
b = this.c.a(this.b, str);
|
||||
} catch (zzaa unused) {
|
||||
Log.w("FirebaseInstanceId", "Stored data is corrupt, generating new identity");
|
||||
FirebaseInstanceId.j().e();
|
||||
b = this.c.b(this.b, str);
|
||||
}
|
||||
this.d.put(str, b);
|
||||
return b;
|
||||
}
|
||||
}
|
69
sources/com/google/firebase/iid/zzax.java
Normal file
69
sources/com/google/firebase/iid/zzax.java
Normal file
@@ -0,0 +1,69 @@
|
||||
package com.google.firebase.iid;
|
||||
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
final class zzax {
|
||||
private static final long d = TimeUnit.DAYS.toMillis(7);
|
||||
final String a;
|
||||
private final String b;
|
||||
private final long c;
|
||||
|
||||
private zzax(String str, String str2, long j) {
|
||||
this.a = str;
|
||||
this.b = str2;
|
||||
this.c = j;
|
||||
}
|
||||
|
||||
static String a(String str, String str2, long j) {
|
||||
try {
|
||||
JSONObject jSONObject = new JSONObject();
|
||||
jSONObject.put("token", str);
|
||||
jSONObject.put("appVersion", str2);
|
||||
jSONObject.put("timestamp", j);
|
||||
return jSONObject.toString();
|
||||
} catch (JSONException e) {
|
||||
String valueOf = String.valueOf(e);
|
||||
StringBuilder sb = new StringBuilder(String.valueOf(valueOf).length() + 24);
|
||||
sb.append("Failed to encode token: ");
|
||||
sb.append(valueOf);
|
||||
Log.w("FirebaseInstanceId", sb.toString());
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
static zzax b(String str) {
|
||||
if (TextUtils.isEmpty(str)) {
|
||||
return null;
|
||||
}
|
||||
if (!str.startsWith("{")) {
|
||||
return new zzax(str, null, 0L);
|
||||
}
|
||||
try {
|
||||
JSONObject jSONObject = new JSONObject(str);
|
||||
return new zzax(jSONObject.getString("token"), jSONObject.getString("appVersion"), jSONObject.getLong("timestamp"));
|
||||
} catch (JSONException e) {
|
||||
String valueOf = String.valueOf(e);
|
||||
StringBuilder sb = new StringBuilder(String.valueOf(valueOf).length() + 23);
|
||||
sb.append("Failed to parse token: ");
|
||||
sb.append(valueOf);
|
||||
Log.w("FirebaseInstanceId", sb.toString());
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
static String a(zzax zzaxVar) {
|
||||
if (zzaxVar == null) {
|
||||
return null;
|
||||
}
|
||||
return zzaxVar.a;
|
||||
}
|
||||
|
||||
final boolean a(String str) {
|
||||
return System.currentTimeMillis() > this.c + d || !str.equals(this.b);
|
||||
}
|
||||
}
|
102
sources/com/google/firebase/iid/zzay.java
Normal file
102
sources/com/google/firebase/iid/zzay.java
Normal file
@@ -0,0 +1,102 @@
|
||||
package com.google.firebase.iid;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.net.ConnectivityManager;
|
||||
import android.net.NetworkInfo;
|
||||
import android.os.PowerManager;
|
||||
import android.util.Log;
|
||||
import java.io.IOException;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
final class zzay implements Runnable {
|
||||
private final long a;
|
||||
private final PowerManager.WakeLock b = ((PowerManager) a().getSystemService("power")).newWakeLock(1, "fiid-sync");
|
||||
private final FirebaseInstanceId c;
|
||||
private final zzan d;
|
||||
private final zzba e;
|
||||
|
||||
zzay(FirebaseInstanceId firebaseInstanceId, zzan zzanVar, zzba zzbaVar, long j) {
|
||||
this.c = firebaseInstanceId;
|
||||
this.d = zzanVar;
|
||||
this.e = zzbaVar;
|
||||
this.a = j;
|
||||
this.b.setReferenceCounted(false);
|
||||
}
|
||||
|
||||
private final boolean c() {
|
||||
try {
|
||||
if (this.c.g()) {
|
||||
return true;
|
||||
}
|
||||
this.c.h();
|
||||
return true;
|
||||
} catch (IOException e) {
|
||||
String valueOf = String.valueOf(e.getMessage());
|
||||
Log.e("FirebaseInstanceId", valueOf.length() != 0 ? "Build channel failed: ".concat(valueOf) : new String("Build channel failed: "));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
private final boolean d() {
|
||||
zzax c = this.c.c();
|
||||
if (c != null && !c.a(this.d.b())) {
|
||||
return true;
|
||||
}
|
||||
try {
|
||||
String d = this.c.d();
|
||||
if (d == null) {
|
||||
Log.e("FirebaseInstanceId", "Token retrieval failed: null");
|
||||
return false;
|
||||
}
|
||||
if (Log.isLoggable("FirebaseInstanceId", 3)) {
|
||||
Log.d("FirebaseInstanceId", "Token successfully retrieved");
|
||||
}
|
||||
if (c == null || (c != null && !d.equals(c.a))) {
|
||||
Context a = a();
|
||||
Intent intent = new Intent("com.google.firebase.messaging.NEW_TOKEN");
|
||||
intent.putExtra("token", d);
|
||||
zzav.b(a, intent);
|
||||
zzav.a(a, new Intent("com.google.firebase.iid.TOKEN_REFRESH"));
|
||||
}
|
||||
return true;
|
||||
} catch (IOException | SecurityException e) {
|
||||
String valueOf = String.valueOf(e.getMessage());
|
||||
Log.e("FirebaseInstanceId", valueOf.length() != 0 ? "Token retrieval failed: ".concat(valueOf) : new String("Token retrieval failed: "));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
final Context a() {
|
||||
return this.c.b().a();
|
||||
}
|
||||
|
||||
final boolean b() {
|
||||
ConnectivityManager connectivityManager = (ConnectivityManager) a().getSystemService("connectivity");
|
||||
NetworkInfo activeNetworkInfo = connectivityManager != null ? connectivityManager.getActiveNetworkInfo() : null;
|
||||
return activeNetworkInfo != null && activeNetworkInfo.isConnected();
|
||||
}
|
||||
|
||||
@Override // java.lang.Runnable
|
||||
public final void run() {
|
||||
this.b.acquire();
|
||||
try {
|
||||
this.c.a(true);
|
||||
if (!this.c.f()) {
|
||||
this.c.a(false);
|
||||
return;
|
||||
}
|
||||
if (!b()) {
|
||||
new zzaz(this).a();
|
||||
return;
|
||||
}
|
||||
if (c() && d() && this.e.a(this.c)) {
|
||||
this.c.a(false);
|
||||
} else {
|
||||
this.c.a(this.a);
|
||||
}
|
||||
} finally {
|
||||
this.b.release();
|
||||
}
|
||||
}
|
||||
}
|
36
sources/com/google/firebase/iid/zzaz.java
Normal file
36
sources/com/google/firebase/iid/zzaz.java
Normal file
@@ -0,0 +1,36 @@
|
||||
package com.google.firebase.iid;
|
||||
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.IntentFilter;
|
||||
import android.util.Log;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
final class zzaz extends BroadcastReceiver {
|
||||
private zzay a;
|
||||
|
||||
public zzaz(zzay zzayVar) {
|
||||
this.a = zzayVar;
|
||||
}
|
||||
|
||||
public final void a() {
|
||||
if (FirebaseInstanceId.n()) {
|
||||
Log.d("FirebaseInstanceId", "Connectivity change received registered");
|
||||
}
|
||||
this.a.a().registerReceiver(this, new IntentFilter("android.net.conn.CONNECTIVITY_CHANGE"));
|
||||
}
|
||||
|
||||
@Override // android.content.BroadcastReceiver
|
||||
public final void onReceive(Context context, Intent intent) {
|
||||
zzay zzayVar = this.a;
|
||||
if (zzayVar != null && zzayVar.b()) {
|
||||
if (FirebaseInstanceId.n()) {
|
||||
Log.d("FirebaseInstanceId", "Connectivity changed. Starting background sync.");
|
||||
}
|
||||
FirebaseInstanceId.a(this.a, 0L);
|
||||
this.a.a().unregisterReceiver(this);
|
||||
this.a = null;
|
||||
}
|
||||
}
|
||||
}
|
80
sources/com/google/firebase/iid/zzb.java
Normal file
80
sources/com/google/firebase/iid/zzb.java
Normal file
@@ -0,0 +1,80 @@
|
||||
package com.google.firebase.iid;
|
||||
|
||||
import android.app.Service;
|
||||
import android.content.Intent;
|
||||
import android.os.Binder;
|
||||
import android.os.IBinder;
|
||||
import android.util.Log;
|
||||
import androidx.legacy.content.WakefulBroadcastReceiver;
|
||||
import com.google.android.gms.common.util.concurrent.NamedThreadFactory;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.Executors;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public abstract class zzb extends Service {
|
||||
final ExecutorService a;
|
||||
private Binder b;
|
||||
private final Object c;
|
||||
private int d;
|
||||
private int e;
|
||||
|
||||
public zzb() {
|
||||
String valueOf = String.valueOf(getClass().getSimpleName());
|
||||
this.a = Executors.newSingleThreadExecutor(new NamedThreadFactory(valueOf.length() != 0 ? "Firebase-".concat(valueOf) : new String("Firebase-")));
|
||||
this.c = new Object();
|
||||
this.e = 0;
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: private */
|
||||
public final void d(Intent intent) {
|
||||
if (intent != null) {
|
||||
WakefulBroadcastReceiver.a(intent);
|
||||
}
|
||||
synchronized (this.c) {
|
||||
this.e--;
|
||||
if (this.e == 0) {
|
||||
stopSelfResult(this.d);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected Intent a(Intent intent) {
|
||||
return intent;
|
||||
}
|
||||
|
||||
public boolean b(Intent intent) {
|
||||
return false;
|
||||
}
|
||||
|
||||
public abstract void c(Intent intent);
|
||||
|
||||
@Override // android.app.Service
|
||||
public final synchronized IBinder onBind(Intent intent) {
|
||||
if (Log.isLoggable("EnhancedIntentService", 3)) {
|
||||
Log.d("EnhancedIntentService", "Service received bind request");
|
||||
}
|
||||
if (this.b == null) {
|
||||
this.b = new zzf(this);
|
||||
}
|
||||
return this.b;
|
||||
}
|
||||
|
||||
@Override // android.app.Service
|
||||
public final int onStartCommand(Intent intent, int i, int i2) {
|
||||
synchronized (this.c) {
|
||||
this.d = i2;
|
||||
this.e++;
|
||||
}
|
||||
Intent a = a(intent);
|
||||
if (a == null) {
|
||||
d(intent);
|
||||
return 2;
|
||||
}
|
||||
if (b(a)) {
|
||||
d(intent);
|
||||
return 2;
|
||||
}
|
||||
this.a.execute(new zzc(this, a, intent));
|
||||
return 3;
|
||||
}
|
||||
}
|
204
sources/com/google/firebase/iid/zzba.java
Normal file
204
sources/com/google/firebase/iid/zzba.java
Normal file
@@ -0,0 +1,204 @@
|
||||
package com.google.firebase.iid;
|
||||
|
||||
import android.text.TextUtils;
|
||||
import androidx.collection.ArrayMap;
|
||||
import com.google.android.gms.tasks.TaskCompletionSource;
|
||||
import java.util.Map;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
final class zzba {
|
||||
private int a = 0;
|
||||
private final Map<Integer, TaskCompletionSource<Void>> b = new ArrayMap();
|
||||
private final zzaw c;
|
||||
|
||||
zzba(zzaw zzawVar) {
|
||||
this.c = zzawVar;
|
||||
}
|
||||
|
||||
private final String b() {
|
||||
String a;
|
||||
synchronized (this.c) {
|
||||
a = this.c.a();
|
||||
}
|
||||
if (TextUtils.isEmpty(a)) {
|
||||
return null;
|
||||
}
|
||||
String[] split = a.split(",");
|
||||
if (split.length <= 1 || TextUtils.isEmpty(split[1])) {
|
||||
return null;
|
||||
}
|
||||
return split[1];
|
||||
}
|
||||
|
||||
final synchronized boolean a() {
|
||||
return b() != null;
|
||||
}
|
||||
|
||||
/* JADX WARN: Code restructure failed: missing block: B:27:0x000c, code lost:
|
||||
|
||||
if (com.google.firebase.iid.FirebaseInstanceId.n() == false) goto L8;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:28:0x000e, code lost:
|
||||
|
||||
android.util.Log.d("FirebaseInstanceId", "topic sync succeeded");
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:30:0x0016, code lost:
|
||||
|
||||
return true;
|
||||
*/
|
||||
/*
|
||||
Code decompiled incorrectly, please refer to instructions dump.
|
||||
To view partially-correct code enable 'Show inconsistent code' option in preferences
|
||||
*/
|
||||
final boolean a(com.google.firebase.iid.FirebaseInstanceId r5) {
|
||||
/*
|
||||
r4 = this;
|
||||
L0:
|
||||
monitor-enter(r4)
|
||||
java.lang.String r0 = r4.b() // Catch: java.lang.Throwable -> L42
|
||||
r1 = 1
|
||||
if (r0 != 0) goto L17
|
||||
boolean r5 = com.google.firebase.iid.FirebaseInstanceId.n() // Catch: java.lang.Throwable -> L42
|
||||
if (r5 == 0) goto L15
|
||||
java.lang.String r5 = "FirebaseInstanceId"
|
||||
java.lang.String r0 = "topic sync succeeded"
|
||||
android.util.Log.d(r5, r0) // Catch: java.lang.Throwable -> L42
|
||||
L15:
|
||||
monitor-exit(r4) // Catch: java.lang.Throwable -> L42
|
||||
return r1
|
||||
L17:
|
||||
monitor-exit(r4) // Catch: java.lang.Throwable -> L42
|
||||
boolean r2 = a(r5, r0)
|
||||
if (r2 != 0) goto L20
|
||||
r5 = 0
|
||||
return r5
|
||||
L20:
|
||||
monitor-enter(r4)
|
||||
java.util.Map<java.lang.Integer, com.google.android.gms.tasks.TaskCompletionSource<java.lang.Void>> r2 = r4.b // Catch: java.lang.Throwable -> L3f
|
||||
int r3 = r4.a // Catch: java.lang.Throwable -> L3f
|
||||
java.lang.Integer r3 = java.lang.Integer.valueOf(r3) // Catch: java.lang.Throwable -> L3f
|
||||
java.lang.Object r2 = r2.remove(r3) // Catch: java.lang.Throwable -> L3f
|
||||
com.google.android.gms.tasks.TaskCompletionSource r2 = (com.google.android.gms.tasks.TaskCompletionSource) r2 // Catch: java.lang.Throwable -> L3f
|
||||
r4.a(r0) // Catch: java.lang.Throwable -> L3f
|
||||
int r0 = r4.a // Catch: java.lang.Throwable -> L3f
|
||||
int r0 = r0 + r1
|
||||
r4.a = r0 // Catch: java.lang.Throwable -> L3f
|
||||
monitor-exit(r4) // Catch: java.lang.Throwable -> L3f
|
||||
if (r2 == 0) goto L0
|
||||
r0 = 0
|
||||
r2.a(r0)
|
||||
goto L0
|
||||
L3f:
|
||||
r5 = move-exception
|
||||
monitor-exit(r4) // Catch: java.lang.Throwable -> L3f
|
||||
throw r5
|
||||
L42:
|
||||
r5 = move-exception
|
||||
monitor-exit(r4) // Catch: java.lang.Throwable -> L42
|
||||
throw r5
|
||||
*/
|
||||
throw new UnsupportedOperationException("Method not decompiled: com.google.firebase.iid.zzba.a(com.google.firebase.iid.FirebaseInstanceId):boolean");
|
||||
}
|
||||
|
||||
private final synchronized boolean a(String str) {
|
||||
synchronized (this.c) {
|
||||
String a = this.c.a();
|
||||
String valueOf = String.valueOf(str);
|
||||
if (!a.startsWith(valueOf.length() != 0 ? ",".concat(valueOf) : new String(","))) {
|
||||
return false;
|
||||
}
|
||||
String valueOf2 = String.valueOf(str);
|
||||
this.c.a(a.substring((valueOf2.length() != 0 ? ",".concat(valueOf2) : new String(",")).length()));
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
/* JADX WARN: Code restructure failed: missing block: B:11:0x0035, code lost:
|
||||
|
||||
if (r4 == 1) goto L19;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:13:0x0038, code lost:
|
||||
|
||||
r7.b(r8);
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:14:0x003f, code lost:
|
||||
|
||||
if (com.google.firebase.iid.FirebaseInstanceId.n() == false) goto L33;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:15:0x0041, code lost:
|
||||
|
||||
android.util.Log.d("FirebaseInstanceId", "unsubscribe operation succeeded");
|
||||
*/
|
||||
/*
|
||||
Code decompiled incorrectly, please refer to instructions dump.
|
||||
To view partially-correct code enable 'Show inconsistent code' option in preferences
|
||||
*/
|
||||
private static boolean a(com.google.firebase.iid.FirebaseInstanceId r7, java.lang.String r8) {
|
||||
/*
|
||||
java.lang.String r0 = "FirebaseInstanceId"
|
||||
java.lang.String r1 = "!"
|
||||
java.lang.String[] r8 = r8.split(r1)
|
||||
int r1 = r8.length
|
||||
r2 = 1
|
||||
r3 = 2
|
||||
if (r1 != r3) goto L75
|
||||
r1 = 0
|
||||
r3 = r8[r1]
|
||||
r8 = r8[r2]
|
||||
r4 = -1
|
||||
int r5 = r3.hashCode() // Catch: java.io.IOException -> L56
|
||||
r6 = 83
|
||||
if (r5 == r6) goto L2a
|
||||
r6 = 85
|
||||
if (r5 == r6) goto L20
|
||||
goto L33
|
||||
L20:
|
||||
java.lang.String r5 = "U"
|
||||
boolean r3 = r3.equals(r5) // Catch: java.io.IOException -> L56
|
||||
if (r3 == 0) goto L33
|
||||
r4 = 1
|
||||
goto L33
|
||||
L2a:
|
||||
java.lang.String r5 = "S"
|
||||
boolean r3 = r3.equals(r5) // Catch: java.io.IOException -> L56
|
||||
if (r3 == 0) goto L33
|
||||
r4 = 0
|
||||
L33:
|
||||
if (r4 == 0) goto L47
|
||||
if (r4 == r2) goto L38
|
||||
goto L75
|
||||
L38:
|
||||
r7.b(r8) // Catch: java.io.IOException -> L56
|
||||
boolean r7 = com.google.firebase.iid.FirebaseInstanceId.n() // Catch: java.io.IOException -> L56
|
||||
if (r7 == 0) goto L75
|
||||
java.lang.String r7 = "unsubscribe operation succeeded"
|
||||
android.util.Log.d(r0, r7) // Catch: java.io.IOException -> L56
|
||||
goto L75
|
||||
L47:
|
||||
r7.a(r8) // Catch: java.io.IOException -> L56
|
||||
boolean r7 = com.google.firebase.iid.FirebaseInstanceId.n() // Catch: java.io.IOException -> L56
|
||||
if (r7 == 0) goto L75
|
||||
java.lang.String r7 = "subscribe operation succeeded"
|
||||
android.util.Log.d(r0, r7) // Catch: java.io.IOException -> L56
|
||||
goto L75
|
||||
L56:
|
||||
r7 = move-exception
|
||||
java.lang.String r8 = "Topic sync failed: "
|
||||
java.lang.String r7 = r7.getMessage()
|
||||
java.lang.String r7 = java.lang.String.valueOf(r7)
|
||||
int r2 = r7.length()
|
||||
if (r2 == 0) goto L6c
|
||||
java.lang.String r7 = r8.concat(r7)
|
||||
goto L71
|
||||
L6c:
|
||||
java.lang.String r7 = new java.lang.String
|
||||
r7.<init>(r8)
|
||||
L71:
|
||||
android.util.Log.e(r0, r7)
|
||||
return r1
|
||||
L75:
|
||||
return r2
|
||||
*/
|
||||
throw new UnsupportedOperationException("Method not decompiled: com.google.firebase.iid.zzba.a(com.google.firebase.iid.FirebaseInstanceId, java.lang.String):boolean");
|
||||
}
|
||||
}
|
22
sources/com/google/firebase/iid/zzc.java
Normal file
22
sources/com/google/firebase/iid/zzc.java
Normal file
@@ -0,0 +1,22 @@
|
||||
package com.google.firebase.iid;
|
||||
|
||||
import android.content.Intent;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
final class zzc implements Runnable {
|
||||
private final /* synthetic */ Intent a;
|
||||
private final /* synthetic */ Intent b;
|
||||
private final /* synthetic */ zzb c;
|
||||
|
||||
zzc(zzb zzbVar, Intent intent, Intent intent2) {
|
||||
this.c = zzbVar;
|
||||
this.a = intent;
|
||||
this.b = intent2;
|
||||
}
|
||||
|
||||
@Override // java.lang.Runnable
|
||||
public final void run() {
|
||||
this.c.c(this.a);
|
||||
this.c.d(this.b);
|
||||
}
|
||||
}
|
50
sources/com/google/firebase/iid/zzd.java
Normal file
50
sources/com/google/firebase/iid/zzd.java
Normal file
@@ -0,0 +1,50 @@
|
||||
package com.google.firebase.iid;
|
||||
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.Intent;
|
||||
import android.util.Log;
|
||||
import java.util.concurrent.ScheduledExecutorService;
|
||||
import java.util.concurrent.ScheduledFuture;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
final class zzd {
|
||||
final Intent a;
|
||||
private final BroadcastReceiver.PendingResult b;
|
||||
private boolean c = false;
|
||||
private final ScheduledFuture<?> d;
|
||||
|
||||
zzd(final Intent intent, BroadcastReceiver.PendingResult pendingResult, ScheduledExecutorService scheduledExecutorService) {
|
||||
this.a = intent;
|
||||
this.b = pendingResult;
|
||||
this.d = scheduledExecutorService.schedule(new Runnable(this, intent) { // from class: com.google.firebase.iid.zze
|
||||
private final zzd a;
|
||||
private final Intent b;
|
||||
|
||||
{
|
||||
this.a = this;
|
||||
this.b = intent;
|
||||
}
|
||||
|
||||
@Override // java.lang.Runnable
|
||||
public final void run() {
|
||||
zzd zzdVar = this.a;
|
||||
String action = this.b.getAction();
|
||||
StringBuilder sb = new StringBuilder(String.valueOf(action).length() + 61);
|
||||
sb.append("Service took too long to process intent: ");
|
||||
sb.append(action);
|
||||
sb.append(" App may get closed.");
|
||||
Log.w("EnhancedIntentService", sb.toString());
|
||||
zzdVar.a();
|
||||
}
|
||||
}, 9000L, TimeUnit.MILLISECONDS);
|
||||
}
|
||||
|
||||
final synchronized void a() {
|
||||
if (!this.c) {
|
||||
this.b.finish();
|
||||
this.d.cancel(false);
|
||||
this.c = true;
|
||||
}
|
||||
}
|
||||
}
|
31
sources/com/google/firebase/iid/zzf.java
Normal file
31
sources/com/google/firebase/iid/zzf.java
Normal file
@@ -0,0 +1,31 @@
|
||||
package com.google.firebase.iid;
|
||||
|
||||
import android.os.Binder;
|
||||
import android.os.Process;
|
||||
import android.util.Log;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class zzf extends Binder {
|
||||
private final zzb a;
|
||||
|
||||
zzf(zzb zzbVar) {
|
||||
this.a = zzbVar;
|
||||
}
|
||||
|
||||
public final void a(zzd zzdVar) {
|
||||
if (Binder.getCallingUid() != Process.myUid()) {
|
||||
throw new SecurityException("Binding only allowed within app");
|
||||
}
|
||||
if (Log.isLoggable("EnhancedIntentService", 3)) {
|
||||
Log.d("EnhancedIntentService", "service received new intent via bind strategy");
|
||||
}
|
||||
if (this.a.b(zzdVar.a)) {
|
||||
zzdVar.a();
|
||||
return;
|
||||
}
|
||||
if (Log.isLoggable("EnhancedIntentService", 3)) {
|
||||
Log.d("EnhancedIntentService", "intent being queued for bg execution");
|
||||
}
|
||||
this.a.a.execute(new zzg(this, zzdVar));
|
||||
}
|
||||
}
|
25
sources/com/google/firebase/iid/zzg.java
Normal file
25
sources/com/google/firebase/iid/zzg.java
Normal file
@@ -0,0 +1,25 @@
|
||||
package com.google.firebase.iid;
|
||||
|
||||
import android.util.Log;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
final class zzg implements Runnable {
|
||||
private final /* synthetic */ zzd a;
|
||||
private final /* synthetic */ zzf b;
|
||||
|
||||
zzg(zzf zzfVar, zzd zzdVar) {
|
||||
this.b = zzfVar;
|
||||
this.a = zzdVar;
|
||||
}
|
||||
|
||||
@Override // java.lang.Runnable
|
||||
public final void run() {
|
||||
zzb zzbVar;
|
||||
if (Log.isLoggable("EnhancedIntentService", 3)) {
|
||||
Log.d("EnhancedIntentService", "bg processing of the intent starting now");
|
||||
}
|
||||
zzbVar = this.b.a;
|
||||
zzbVar.c(this.a.a);
|
||||
this.a.a();
|
||||
}
|
||||
}
|
123
sources/com/google/firebase/iid/zzh.java
Normal file
123
sources/com/google/firebase/iid/zzh.java
Normal file
@@ -0,0 +1,123 @@
|
||||
package com.google.firebase.iid;
|
||||
|
||||
import android.content.BroadcastReceiver;
|
||||
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 java.util.ArrayDeque;
|
||||
import java.util.Queue;
|
||||
import java.util.concurrent.ScheduledExecutorService;
|
||||
import java.util.concurrent.ScheduledThreadPoolExecutor;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class zzh implements ServiceConnection {
|
||||
private final Context a;
|
||||
private final Intent b;
|
||||
private final ScheduledExecutorService c;
|
||||
private final Queue<zzd> d;
|
||||
private zzf e;
|
||||
private boolean f;
|
||||
|
||||
public zzh(Context context, String str) {
|
||||
this(context, str, new ScheduledThreadPoolExecutor(0, new NamedThreadFactory("Firebase-FirebaseInstanceIdServiceConnection")));
|
||||
}
|
||||
|
||||
private final void b() {
|
||||
while (!this.d.isEmpty()) {
|
||||
this.d.poll().a();
|
||||
}
|
||||
}
|
||||
|
||||
public final synchronized void a(Intent intent, BroadcastReceiver.PendingResult pendingResult) {
|
||||
if (Log.isLoggable("EnhancedIntentService", 3)) {
|
||||
Log.d("EnhancedIntentService", "new intent queued in the bind-strategy delivery");
|
||||
}
|
||||
this.d.add(new zzd(intent, pendingResult, this.c));
|
||||
a();
|
||||
}
|
||||
|
||||
@Override // android.content.ServiceConnection
|
||||
public final void onServiceConnected(ComponentName componentName, IBinder iBinder) {
|
||||
synchronized (this) {
|
||||
this.f = false;
|
||||
this.e = (zzf) iBinder;
|
||||
if (Log.isLoggable("EnhancedIntentService", 3)) {
|
||||
String valueOf = String.valueOf(componentName);
|
||||
StringBuilder sb = new StringBuilder(String.valueOf(valueOf).length() + 20);
|
||||
sb.append("onServiceConnected: ");
|
||||
sb.append(valueOf);
|
||||
Log.d("EnhancedIntentService", sb.toString());
|
||||
}
|
||||
if (iBinder == null) {
|
||||
Log.e("EnhancedIntentService", "Null service connection");
|
||||
b();
|
||||
} else {
|
||||
a();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.content.ServiceConnection
|
||||
public final void onServiceDisconnected(ComponentName componentName) {
|
||||
if (Log.isLoggable("EnhancedIntentService", 3)) {
|
||||
String valueOf = String.valueOf(componentName);
|
||||
StringBuilder sb = new StringBuilder(String.valueOf(valueOf).length() + 23);
|
||||
sb.append("onServiceDisconnected: ");
|
||||
sb.append(valueOf);
|
||||
Log.d("EnhancedIntentService", sb.toString());
|
||||
}
|
||||
a();
|
||||
}
|
||||
|
||||
private zzh(Context context, String str, ScheduledExecutorService scheduledExecutorService) {
|
||||
this.d = new ArrayDeque();
|
||||
this.f = false;
|
||||
this.a = context.getApplicationContext();
|
||||
this.b = new Intent(str).setPackage(this.a.getPackageName());
|
||||
this.c = scheduledExecutorService;
|
||||
}
|
||||
|
||||
private final synchronized void a() {
|
||||
if (Log.isLoggable("EnhancedIntentService", 3)) {
|
||||
Log.d("EnhancedIntentService", "flush queue called");
|
||||
}
|
||||
while (!this.d.isEmpty()) {
|
||||
if (Log.isLoggable("EnhancedIntentService", 3)) {
|
||||
Log.d("EnhancedIntentService", "found intent to be delivered");
|
||||
}
|
||||
if (this.e != null && this.e.isBinderAlive()) {
|
||||
if (Log.isLoggable("EnhancedIntentService", 3)) {
|
||||
Log.d("EnhancedIntentService", "binder is alive, sending the intent.");
|
||||
}
|
||||
this.e.a(this.d.poll());
|
||||
} else {
|
||||
if (Log.isLoggable("EnhancedIntentService", 3)) {
|
||||
boolean z = !this.f;
|
||||
StringBuilder sb = new StringBuilder(39);
|
||||
sb.append("binder is dead. start connection? ");
|
||||
sb.append(z);
|
||||
Log.d("EnhancedIntentService", sb.toString());
|
||||
}
|
||||
if (!this.f) {
|
||||
this.f = true;
|
||||
try {
|
||||
} catch (SecurityException e) {
|
||||
Log.e("EnhancedIntentService", "Exception while binding the service", e);
|
||||
}
|
||||
if (ConnectionTracker.a().a(this.a, this.b, this, 65)) {
|
||||
return;
|
||||
}
|
||||
Log.e("EnhancedIntentService", "binding to the service failed");
|
||||
this.f = false;
|
||||
b();
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
23
sources/com/google/firebase/iid/zzi.java
Normal file
23
sources/com/google/firebase/iid/zzi.java
Normal file
@@ -0,0 +1,23 @@
|
||||
package com.google.firebase.iid;
|
||||
|
||||
import java.util.concurrent.Executor;
|
||||
import java.util.concurrent.LinkedBlockingQueue;
|
||||
import java.util.concurrent.ThreadPoolExecutor;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
final class zzi {
|
||||
private static final Executor a = zzk.a;
|
||||
|
||||
static Executor a() {
|
||||
return a;
|
||||
}
|
||||
|
||||
static Executor b() {
|
||||
return new ThreadPoolExecutor(0, 1, 30L, TimeUnit.SECONDS, new LinkedBlockingQueue(), zzj.a);
|
||||
}
|
||||
|
||||
static final /* synthetic */ Thread a(Runnable runnable) {
|
||||
return new Thread(runnable, "firebase-iid-executor");
|
||||
}
|
||||
}
|
16
sources/com/google/firebase/iid/zzj.java
Normal file
16
sources/com/google/firebase/iid/zzj.java
Normal file
@@ -0,0 +1,16 @@
|
||||
package com.google.firebase.iid;
|
||||
|
||||
import java.util.concurrent.ThreadFactory;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
final /* synthetic */ class zzj implements ThreadFactory {
|
||||
static final ThreadFactory a = new zzj();
|
||||
|
||||
private zzj() {
|
||||
}
|
||||
|
||||
@Override // java.util.concurrent.ThreadFactory
|
||||
public final Thread newThread(Runnable runnable) {
|
||||
return zzi.a(runnable);
|
||||
}
|
||||
}
|
16
sources/com/google/firebase/iid/zzk.java
Normal file
16
sources/com/google/firebase/iid/zzk.java
Normal file
@@ -0,0 +1,16 @@
|
||||
package com.google.firebase.iid;
|
||||
|
||||
import java.util.concurrent.Executor;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
final /* synthetic */ class zzk implements Executor {
|
||||
static final Executor a = new zzk();
|
||||
|
||||
private zzk() {
|
||||
}
|
||||
|
||||
@Override // java.util.concurrent.Executor
|
||||
public final void execute(Runnable runnable) {
|
||||
runnable.run();
|
||||
}
|
||||
}
|
83
sources/com/google/firebase/iid/zzl.java
Normal file
83
sources/com/google/firebase/iid/zzl.java
Normal file
@@ -0,0 +1,83 @@
|
||||
package com.google.firebase.iid;
|
||||
|
||||
import android.os.Build;
|
||||
import android.os.IBinder;
|
||||
import android.os.Message;
|
||||
import android.os.Messenger;
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
import android.os.RemoteException;
|
||||
import android.util.Log;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class zzl implements Parcelable {
|
||||
public static final Parcelable.Creator<zzl> CREATOR = new zzm();
|
||||
private Messenger zzag;
|
||||
private zzv zzah;
|
||||
|
||||
public static final class zza extends ClassLoader {
|
||||
@Override // java.lang.ClassLoader
|
||||
protected final Class<?> loadClass(String str, boolean z) throws ClassNotFoundException {
|
||||
if (!"com.google.android.gms.iid.MessengerCompat".equals(str)) {
|
||||
return super.loadClass(str, z);
|
||||
}
|
||||
if (!FirebaseInstanceId.n()) {
|
||||
return zzl.class;
|
||||
}
|
||||
Log.d("FirebaseInstanceId", "Using renamed FirebaseIidMessengerCompat class");
|
||||
return zzl.class;
|
||||
}
|
||||
}
|
||||
|
||||
public zzl(IBinder iBinder) {
|
||||
if (Build.VERSION.SDK_INT >= 21) {
|
||||
this.zzag = new Messenger(iBinder);
|
||||
} else {
|
||||
this.zzah = new zzw(iBinder);
|
||||
}
|
||||
}
|
||||
|
||||
private final IBinder getBinder() {
|
||||
Messenger messenger = this.zzag;
|
||||
return messenger != null ? messenger.getBinder() : this.zzah.asBinder();
|
||||
}
|
||||
|
||||
@Override // android.os.Parcelable
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public boolean equals(Object obj) {
|
||||
if (obj == null) {
|
||||
return false;
|
||||
}
|
||||
try {
|
||||
return getBinder().equals(((zzl) obj).getBinder());
|
||||
} catch (ClassCastException unused) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public int hashCode() {
|
||||
return getBinder().hashCode();
|
||||
}
|
||||
|
||||
public final void send(Message message) throws RemoteException {
|
||||
Messenger messenger = this.zzag;
|
||||
if (messenger != null) {
|
||||
messenger.send(message);
|
||||
} else {
|
||||
this.zzah.a(message);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.os.Parcelable
|
||||
public void writeToParcel(Parcel parcel, int i) {
|
||||
Messenger messenger = this.zzag;
|
||||
if (messenger != null) {
|
||||
parcel.writeStrongBinder(messenger.getBinder());
|
||||
} else {
|
||||
parcel.writeStrongBinder(this.zzah.asBinder());
|
||||
}
|
||||
}
|
||||
}
|
25
sources/com/google/firebase/iid/zzm.java
Normal file
25
sources/com/google/firebase/iid/zzm.java
Normal file
@@ -0,0 +1,25 @@
|
||||
package com.google.firebase.iid;
|
||||
|
||||
import android.os.IBinder;
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
final class zzm implements Parcelable.Creator<zzl> {
|
||||
zzm() {
|
||||
}
|
||||
|
||||
@Override // android.os.Parcelable.Creator
|
||||
public final /* synthetic */ zzl createFromParcel(Parcel parcel) {
|
||||
IBinder readStrongBinder = parcel.readStrongBinder();
|
||||
if (readStrongBinder != null) {
|
||||
return new zzl(readStrongBinder);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override // android.os.Parcelable.Creator
|
||||
public final /* synthetic */ zzl[] newArray(int i) {
|
||||
return new zzl[i];
|
||||
}
|
||||
}
|
146
sources/com/google/firebase/iid/zzr.java
Normal file
146
sources/com/google/firebase/iid/zzr.java
Normal file
@@ -0,0 +1,146 @@
|
||||
package com.google.firebase.iid;
|
||||
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
import com.baidu.cloud.media.player.BDCloudMediaPlayer;
|
||||
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.FirebaseApp;
|
||||
import com.tencent.open.SocialConstants;
|
||||
import java.io.IOException;
|
||||
import java.util.concurrent.Executor;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
final class zzr implements MessagingChannel {
|
||||
private final FirebaseApp a;
|
||||
private final zzan b;
|
||||
private final zzat c;
|
||||
private final Executor d;
|
||||
|
||||
zzr(FirebaseApp firebaseApp, zzan zzanVar, Executor executor) {
|
||||
this(firebaseApp, zzanVar, executor, new zzat(firebaseApp.a(), zzanVar));
|
||||
}
|
||||
|
||||
@Override // com.google.firebase.iid.MessagingChannel
|
||||
public final Task<Void> a(String str, String str2) {
|
||||
return Tasks.a((Object) null);
|
||||
}
|
||||
|
||||
@Override // com.google.firebase.iid.MessagingChannel
|
||||
public final boolean a() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override // com.google.firebase.iid.MessagingChannel
|
||||
public final boolean b() {
|
||||
return this.b.a() != 0;
|
||||
}
|
||||
|
||||
private zzr(FirebaseApp firebaseApp, zzan zzanVar, Executor executor, zzat zzatVar) {
|
||||
this.a = firebaseApp;
|
||||
this.b = zzanVar;
|
||||
this.c = zzatVar;
|
||||
this.d = executor;
|
||||
}
|
||||
|
||||
@Override // com.google.firebase.iid.MessagingChannel
|
||||
public final Task<String> a(String str, String str2, String str3, String str4) {
|
||||
return b(a(str, str3, str4, new Bundle()));
|
||||
}
|
||||
|
||||
@Override // com.google.firebase.iid.MessagingChannel
|
||||
public final Task<Void> b(String str, String str2, String str3) {
|
||||
Bundle bundle = new Bundle();
|
||||
String valueOf = String.valueOf(str3);
|
||||
bundle.putString("gcm.topic", valueOf.length() != 0 ? "/topics/".concat(valueOf) : new String("/topics/"));
|
||||
String valueOf2 = String.valueOf(str3);
|
||||
return a(b(a(str, str2, valueOf2.length() != 0 ? "/topics/".concat(valueOf2) : new String("/topics/"), bundle)));
|
||||
}
|
||||
|
||||
@Override // com.google.firebase.iid.MessagingChannel
|
||||
public final Task<Void> a(String str, String str2, String str3) {
|
||||
Bundle bundle = new Bundle();
|
||||
String valueOf = String.valueOf(str3);
|
||||
bundle.putString("gcm.topic", valueOf.length() != 0 ? "/topics/".concat(valueOf) : new String("/topics/"));
|
||||
bundle.putString("delete", "1");
|
||||
String valueOf2 = String.valueOf(str3);
|
||||
return a(b(a(str, str2, valueOf2.length() != 0 ? "/topics/".concat(valueOf2) : new String("/topics/"), bundle)));
|
||||
}
|
||||
|
||||
private final Task<String> b(Task<Bundle> task) {
|
||||
return task.a(this.d, new zzu(this));
|
||||
}
|
||||
|
||||
private final Task<Bundle> a(String str, String str2, String str3, final Bundle bundle) {
|
||||
bundle.putString("scope", str3);
|
||||
bundle.putString("sender", str2);
|
||||
bundle.putString("subtype", str2);
|
||||
bundle.putString(SocialConstants.PARAM_APP_ID, str);
|
||||
bundle.putString("gmp_app_id", this.a.c().a());
|
||||
bundle.putString("gmsv", Integer.toString(this.b.d()));
|
||||
bundle.putString("osv", Integer.toString(Build.VERSION.SDK_INT));
|
||||
bundle.putString("app_ver", this.b.b());
|
||||
bundle.putString("app_ver_name", this.b.c());
|
||||
bundle.putString("cliv", "fiid-12451000");
|
||||
final TaskCompletionSource taskCompletionSource = new TaskCompletionSource();
|
||||
this.d.execute(new Runnable(this, bundle, taskCompletionSource) { // from class: com.google.firebase.iid.zzs
|
||||
private final zzr a;
|
||||
private final Bundle b;
|
||||
private final TaskCompletionSource c;
|
||||
|
||||
{
|
||||
this.a = this;
|
||||
this.b = bundle;
|
||||
this.c = taskCompletionSource;
|
||||
}
|
||||
|
||||
@Override // java.lang.Runnable
|
||||
public final void run() {
|
||||
this.a.a(this.b, this.c);
|
||||
}
|
||||
});
|
||||
return taskCompletionSource.a();
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: private */
|
||||
public static String a(Bundle bundle) throws IOException {
|
||||
if (bundle != null) {
|
||||
String string = bundle.getString("registration_id");
|
||||
if (string != null) {
|
||||
return string;
|
||||
}
|
||||
String string2 = bundle.getString("unregistered");
|
||||
if (string2 != null) {
|
||||
return string2;
|
||||
}
|
||||
String string3 = bundle.getString(BDCloudMediaPlayer.OnNativeInvokeListener.ARG_ERROR);
|
||||
if ("RST".equals(string3)) {
|
||||
throw new IOException("INSTANCE_ID_RESET");
|
||||
}
|
||||
if (string3 != null) {
|
||||
throw new IOException(string3);
|
||||
}
|
||||
String valueOf = String.valueOf(bundle);
|
||||
StringBuilder sb = new StringBuilder(String.valueOf(valueOf).length() + 21);
|
||||
sb.append("Unexpected response: ");
|
||||
sb.append(valueOf);
|
||||
Log.w("FirebaseInstanceId", sb.toString(), new Throwable());
|
||||
throw new IOException("SERVICE_NOT_AVAILABLE");
|
||||
}
|
||||
throw new IOException("SERVICE_NOT_AVAILABLE");
|
||||
}
|
||||
|
||||
private final <T> Task<Void> a(Task<T> task) {
|
||||
return task.a(zzi.a(), new zzt(this));
|
||||
}
|
||||
|
||||
final /* synthetic */ void a(Bundle bundle, TaskCompletionSource taskCompletionSource) {
|
||||
try {
|
||||
taskCompletionSource.a((TaskCompletionSource) this.c.a(bundle));
|
||||
} catch (IOException e) {
|
||||
taskCompletionSource.a((Exception) e);
|
||||
}
|
||||
}
|
||||
}
|
16
sources/com/google/firebase/iid/zzt.java
Normal file
16
sources/com/google/firebase/iid/zzt.java
Normal file
@@ -0,0 +1,16 @@
|
||||
package com.google.firebase.iid;
|
||||
|
||||
import com.google.android.gms.tasks.Continuation;
|
||||
import com.google.android.gms.tasks.Task;
|
||||
|
||||
/* JADX INFO: Add missing generic type declarations: [T] */
|
||||
/* loaded from: classes.dex */
|
||||
final class zzt<T> implements Continuation<T, Void> {
|
||||
zzt(zzr zzrVar) {
|
||||
}
|
||||
|
||||
@Override // com.google.android.gms.tasks.Continuation
|
||||
public final /* bridge */ /* synthetic */ Void a(Task task) throws Exception {
|
||||
return null;
|
||||
}
|
||||
}
|
24
sources/com/google/firebase/iid/zzu.java
Normal file
24
sources/com/google/firebase/iid/zzu.java
Normal file
@@ -0,0 +1,24 @@
|
||||
package com.google.firebase.iid;
|
||||
|
||||
import android.os.Bundle;
|
||||
import com.google.android.gms.tasks.Continuation;
|
||||
import com.google.android.gms.tasks.Task;
|
||||
import java.io.IOException;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
final class zzu implements Continuation<Bundle, String> {
|
||||
private final /* synthetic */ zzr a;
|
||||
|
||||
zzu(zzr zzrVar) {
|
||||
this.a = zzrVar;
|
||||
}
|
||||
|
||||
@Override // com.google.android.gms.tasks.Continuation
|
||||
public final /* synthetic */ String a(Task<Bundle> task) throws Exception {
|
||||
String a;
|
||||
Bundle a2 = task.a(IOException.class);
|
||||
zzr zzrVar = this.a;
|
||||
a = zzr.a(a2);
|
||||
return a;
|
||||
}
|
||||
}
|
10
sources/com/google/firebase/iid/zzv.java
Normal file
10
sources/com/google/firebase/iid/zzv.java
Normal file
@@ -0,0 +1,10 @@
|
||||
package com.google.firebase.iid;
|
||||
|
||||
import android.os.IInterface;
|
||||
import android.os.Message;
|
||||
import android.os.RemoteException;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
interface zzv extends IInterface {
|
||||
void a(Message message) throws RemoteException;
|
||||
}
|
33
sources/com/google/firebase/iid/zzw.java
Normal file
33
sources/com/google/firebase/iid/zzw.java
Normal file
@@ -0,0 +1,33 @@
|
||||
package com.google.firebase.iid;
|
||||
|
||||
import android.os.IBinder;
|
||||
import android.os.Message;
|
||||
import android.os.Parcel;
|
||||
import android.os.RemoteException;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class zzw implements zzv {
|
||||
private final IBinder a;
|
||||
|
||||
zzw(IBinder iBinder) {
|
||||
this.a = iBinder;
|
||||
}
|
||||
|
||||
@Override // com.google.firebase.iid.zzv
|
||||
public final void a(Message message) throws RemoteException {
|
||||
Parcel obtain = Parcel.obtain();
|
||||
obtain.writeInterfaceToken("com.google.android.gms.iid.IMessengerCompat");
|
||||
obtain.writeInt(1);
|
||||
message.writeToParcel(obtain, 0);
|
||||
try {
|
||||
this.a.transact(1, obtain, null, 1);
|
||||
} finally {
|
||||
obtain.recycle();
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.os.IInterface
|
||||
public final IBinder asBinder() {
|
||||
return this.a;
|
||||
}
|
||||
}
|
15
sources/com/google/firebase/iid/zzx.java
Normal file
15
sources/com/google/firebase/iid/zzx.java
Normal file
@@ -0,0 +1,15 @@
|
||||
package com.google.firebase.iid;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
final class zzx implements InstanceIdResult {
|
||||
private final String a;
|
||||
|
||||
zzx(String str, String str2) {
|
||||
this.a = str2;
|
||||
}
|
||||
|
||||
@Override // com.google.firebase.iid.InstanceIdResult
|
||||
public final String a() {
|
||||
return this.a;
|
||||
}
|
||||
}
|
339
sources/com/google/firebase/iid/zzy.java
Normal file
339
sources/com/google/firebase/iid/zzy.java
Normal file
@@ -0,0 +1,339 @@
|
||||
package com.google.firebase.iid;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Base64;
|
||||
import android.util.Log;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.RandomAccessFile;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.nio.channels.Channels;
|
||||
import java.nio.channels.FileChannel;
|
||||
import java.security.KeyFactory;
|
||||
import java.security.KeyPair;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import java.security.spec.InvalidKeySpecException;
|
||||
import java.security.spec.PKCS8EncodedKeySpec;
|
||||
import java.security.spec.X509EncodedKeySpec;
|
||||
import java.util.Properties;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
final class zzy {
|
||||
zzy() {
|
||||
}
|
||||
|
||||
private final zzz c(Context context, String str) throws zzaa {
|
||||
zzz d;
|
||||
try {
|
||||
d = d(context, str);
|
||||
} catch (zzaa e) {
|
||||
e = e;
|
||||
}
|
||||
if (d != null) {
|
||||
a(context, str, d);
|
||||
return d;
|
||||
}
|
||||
e = null;
|
||||
try {
|
||||
zzz a = a(context.getSharedPreferences("com.google.android.gms.appid", 0), str);
|
||||
if (a != null) {
|
||||
a(context, str, a, false);
|
||||
return a;
|
||||
}
|
||||
} catch (zzaa e2) {
|
||||
e = e2;
|
||||
}
|
||||
if (e == null) {
|
||||
return null;
|
||||
}
|
||||
throw e;
|
||||
}
|
||||
|
||||
private final zzz d(Context context, String str) throws zzaa {
|
||||
File e = e(context, str);
|
||||
if (!e.exists()) {
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
return a(e);
|
||||
} catch (zzaa | IOException e2) {
|
||||
if (Log.isLoggable("FirebaseInstanceId", 3)) {
|
||||
String valueOf = String.valueOf(e2);
|
||||
StringBuilder sb = new StringBuilder(String.valueOf(valueOf).length() + 40);
|
||||
sb.append("Failed to read key from file, retrying: ");
|
||||
sb.append(valueOf);
|
||||
Log.d("FirebaseInstanceId", sb.toString());
|
||||
}
|
||||
try {
|
||||
return a(e);
|
||||
} catch (IOException e3) {
|
||||
String valueOf2 = String.valueOf(e3);
|
||||
StringBuilder sb2 = new StringBuilder(String.valueOf(valueOf2).length() + 45);
|
||||
sb2.append("IID file exists, but failed to read from it: ");
|
||||
sb2.append(valueOf2);
|
||||
Log.w("FirebaseInstanceId", sb2.toString());
|
||||
throw new zzaa(e3);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static File e(Context context, String str) {
|
||||
String sb;
|
||||
if (TextUtils.isEmpty(str)) {
|
||||
sb = "com.google.InstanceId.properties";
|
||||
} else {
|
||||
try {
|
||||
String encodeToString = Base64.encodeToString(str.getBytes("UTF-8"), 11);
|
||||
StringBuilder sb2 = new StringBuilder(String.valueOf(encodeToString).length() + 33);
|
||||
sb2.append("com.google.InstanceId_");
|
||||
sb2.append(encodeToString);
|
||||
sb2.append(".properties");
|
||||
sb = sb2.toString();
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
throw new AssertionError(e);
|
||||
}
|
||||
}
|
||||
return new File(b(context), sb);
|
||||
}
|
||||
|
||||
final zzz a(Context context, String str) throws zzaa {
|
||||
zzz c = c(context, str);
|
||||
return c != null ? c : b(context, str);
|
||||
}
|
||||
|
||||
final zzz b(Context context, String str) {
|
||||
zzz zzzVar = new zzz(zza.a(), System.currentTimeMillis());
|
||||
zzz a = a(context, str, zzzVar, true);
|
||||
if (a != null && !a.equals(zzzVar)) {
|
||||
if (Log.isLoggable("FirebaseInstanceId", 3)) {
|
||||
Log.d("FirebaseInstanceId", "Loaded key after generating new one, using loaded one");
|
||||
}
|
||||
return a;
|
||||
}
|
||||
if (Log.isLoggable("FirebaseInstanceId", 3)) {
|
||||
Log.d("FirebaseInstanceId", "Generated new key");
|
||||
}
|
||||
a(context, str, zzzVar);
|
||||
return zzzVar;
|
||||
}
|
||||
|
||||
static void a(Context context) {
|
||||
for (File file : b(context).listFiles()) {
|
||||
if (file.getName().startsWith("com.google.InstanceId")) {
|
||||
file.delete();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static KeyPair a(String str, String str2) throws zzaa {
|
||||
try {
|
||||
byte[] decode = Base64.decode(str, 8);
|
||||
byte[] decode2 = Base64.decode(str2, 8);
|
||||
try {
|
||||
KeyFactory keyFactory = KeyFactory.getInstance("RSA");
|
||||
return new KeyPair(keyFactory.generatePublic(new X509EncodedKeySpec(decode)), keyFactory.generatePrivate(new PKCS8EncodedKeySpec(decode2)));
|
||||
} catch (NoSuchAlgorithmException | InvalidKeySpecException e) {
|
||||
String valueOf = String.valueOf(e);
|
||||
StringBuilder sb = new StringBuilder(String.valueOf(valueOf).length() + 19);
|
||||
sb.append("Invalid key stored ");
|
||||
sb.append(valueOf);
|
||||
Log.w("FirebaseInstanceId", sb.toString());
|
||||
throw new zzaa(e);
|
||||
}
|
||||
} catch (IllegalArgumentException e2) {
|
||||
throw new zzaa(e2);
|
||||
}
|
||||
}
|
||||
|
||||
private static File b(Context context) {
|
||||
File b = ContextCompat.b(context);
|
||||
if (b != null && b.isDirectory()) {
|
||||
return b;
|
||||
}
|
||||
Log.w("FirebaseInstanceId", "noBackupFilesDir doesn't exist, using regular files directory instead");
|
||||
return context.getFilesDir();
|
||||
}
|
||||
|
||||
private static long b(SharedPreferences sharedPreferences, String str) {
|
||||
String string = sharedPreferences.getString(zzaw.a(str, "cre"), null);
|
||||
if (string == null) {
|
||||
return 0L;
|
||||
}
|
||||
try {
|
||||
return Long.parseLong(string);
|
||||
} catch (NumberFormatException unused) {
|
||||
return 0L;
|
||||
}
|
||||
}
|
||||
|
||||
private final zzz a(Context context, String str, zzz zzzVar, boolean z) {
|
||||
String b;
|
||||
String c;
|
||||
long j;
|
||||
if (Log.isLoggable("FirebaseInstanceId", 3)) {
|
||||
Log.d("FirebaseInstanceId", "Writing key to properties file");
|
||||
}
|
||||
Properties properties = new Properties();
|
||||
b = zzzVar.b();
|
||||
properties.setProperty("pub", b);
|
||||
c = zzzVar.c();
|
||||
properties.setProperty("pri", c);
|
||||
j = zzzVar.b;
|
||||
properties.setProperty("cre", String.valueOf(j));
|
||||
File e = e(context, str);
|
||||
try {
|
||||
e.createNewFile();
|
||||
RandomAccessFile randomAccessFile = new RandomAccessFile(e, "rw");
|
||||
try {
|
||||
FileChannel channel = randomAccessFile.getChannel();
|
||||
try {
|
||||
channel.lock();
|
||||
if (z && channel.size() > 0) {
|
||||
try {
|
||||
channel.position(0L);
|
||||
zzz a = a(channel);
|
||||
if (channel != null) {
|
||||
a((Throwable) null, channel);
|
||||
}
|
||||
a((Throwable) null, randomAccessFile);
|
||||
return a;
|
||||
} catch (zzaa | IOException e2) {
|
||||
if (Log.isLoggable("FirebaseInstanceId", 3)) {
|
||||
String valueOf = String.valueOf(e2);
|
||||
StringBuilder sb = new StringBuilder(String.valueOf(valueOf).length() + 64);
|
||||
sb.append("Tried reading key pair before writing new one, but failed with: ");
|
||||
sb.append(valueOf);
|
||||
Log.d("FirebaseInstanceId", sb.toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
channel.position(0L);
|
||||
properties.store(Channels.newOutputStream(channel), (String) null);
|
||||
if (channel != null) {
|
||||
a((Throwable) null, channel);
|
||||
}
|
||||
a((Throwable) null, randomAccessFile);
|
||||
return zzzVar;
|
||||
} finally {
|
||||
}
|
||||
} finally {
|
||||
}
|
||||
} catch (IOException e3) {
|
||||
String valueOf2 = String.valueOf(e3);
|
||||
StringBuilder sb2 = new StringBuilder(String.valueOf(valueOf2).length() + 21);
|
||||
sb2.append("Failed to write key: ");
|
||||
sb2.append(valueOf2);
|
||||
Log.w("FirebaseInstanceId", sb2.toString());
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private final zzz a(File file) throws zzaa, IOException {
|
||||
FileInputStream fileInputStream = new FileInputStream(file);
|
||||
try {
|
||||
FileChannel channel = fileInputStream.getChannel();
|
||||
try {
|
||||
channel.lock(0L, Long.MAX_VALUE, true);
|
||||
zzz a = a(channel);
|
||||
if (channel != null) {
|
||||
a((Throwable) null, channel);
|
||||
}
|
||||
a((Throwable) null, fileInputStream);
|
||||
return a;
|
||||
} finally {
|
||||
}
|
||||
} finally {
|
||||
}
|
||||
}
|
||||
|
||||
private static zzz a(FileChannel fileChannel) throws zzaa, IOException {
|
||||
Properties properties = new Properties();
|
||||
properties.load(Channels.newInputStream(fileChannel));
|
||||
String property = properties.getProperty("pub");
|
||||
String property2 = properties.getProperty("pri");
|
||||
if (property != null && property2 != null) {
|
||||
try {
|
||||
return new zzz(a(property, property2), Long.parseLong(properties.getProperty("cre")));
|
||||
} catch (NumberFormatException e) {
|
||||
throw new zzaa(e);
|
||||
}
|
||||
}
|
||||
throw new zzaa("Invalid properties file");
|
||||
}
|
||||
|
||||
private static zzz a(SharedPreferences sharedPreferences, String str) throws zzaa {
|
||||
String string = sharedPreferences.getString(zzaw.a(str, "|P|"), null);
|
||||
String string2 = sharedPreferences.getString(zzaw.a(str, "|K|"), null);
|
||||
if (string == null || string2 == null) {
|
||||
return null;
|
||||
}
|
||||
return new zzz(a(string, string2), b(sharedPreferences, str));
|
||||
}
|
||||
|
||||
private final void a(Context context, String str, zzz zzzVar) {
|
||||
String b;
|
||||
String c;
|
||||
long j;
|
||||
SharedPreferences sharedPreferences = context.getSharedPreferences("com.google.android.gms.appid", 0);
|
||||
try {
|
||||
if (zzzVar.equals(a(sharedPreferences, str))) {
|
||||
return;
|
||||
}
|
||||
} catch (zzaa unused) {
|
||||
}
|
||||
if (Log.isLoggable("FirebaseInstanceId", 3)) {
|
||||
Log.d("FirebaseInstanceId", "Writing key to shared preferences");
|
||||
}
|
||||
SharedPreferences.Editor edit = sharedPreferences.edit();
|
||||
String a = zzaw.a(str, "|P|");
|
||||
b = zzzVar.b();
|
||||
edit.putString(a, b);
|
||||
String a2 = zzaw.a(str, "|K|");
|
||||
c = zzzVar.c();
|
||||
edit.putString(a2, c);
|
||||
String a3 = zzaw.a(str, "cre");
|
||||
j = zzzVar.b;
|
||||
edit.putString(a3, String.valueOf(j));
|
||||
edit.commit();
|
||||
}
|
||||
|
||||
private static /* synthetic */ void a(Throwable th, FileChannel fileChannel) {
|
||||
if (th == null) {
|
||||
fileChannel.close();
|
||||
return;
|
||||
}
|
||||
try {
|
||||
fileChannel.close();
|
||||
} catch (Throwable th2) {
|
||||
com.google.android.gms.internal.firebase_messaging.zzc.a(th, th2);
|
||||
}
|
||||
}
|
||||
|
||||
private static /* synthetic */ void a(Throwable th, RandomAccessFile randomAccessFile) {
|
||||
if (th == null) {
|
||||
randomAccessFile.close();
|
||||
return;
|
||||
}
|
||||
try {
|
||||
randomAccessFile.close();
|
||||
} catch (Throwable th2) {
|
||||
com.google.android.gms.internal.firebase_messaging.zzc.a(th, th2);
|
||||
}
|
||||
}
|
||||
|
||||
private static /* synthetic */ void a(Throwable th, FileInputStream fileInputStream) {
|
||||
if (th == null) {
|
||||
fileInputStream.close();
|
||||
return;
|
||||
}
|
||||
try {
|
||||
fileInputStream.close();
|
||||
} catch (Throwable th2) {
|
||||
com.google.android.gms.internal.firebase_messaging.zzc.a(th, th2);
|
||||
}
|
||||
}
|
||||
}
|
42
sources/com/google/firebase/iid/zzz.java
Normal file
42
sources/com/google/firebase/iid/zzz.java
Normal file
@@ -0,0 +1,42 @@
|
||||
package com.google.firebase.iid;
|
||||
|
||||
import android.util.Base64;
|
||||
import com.google.android.gms.common.internal.Objects;
|
||||
import java.security.KeyPair;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
final class zzz {
|
||||
private final KeyPair a;
|
||||
private final long b;
|
||||
|
||||
zzz(KeyPair keyPair, long j) {
|
||||
this.a = keyPair;
|
||||
this.b = j;
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: private */
|
||||
public final String b() {
|
||||
return Base64.encodeToString(this.a.getPublic().getEncoded(), 11);
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: private */
|
||||
public final String c() {
|
||||
return Base64.encodeToString(this.a.getPrivate().getEncoded(), 11);
|
||||
}
|
||||
|
||||
final KeyPair a() {
|
||||
return this.a;
|
||||
}
|
||||
|
||||
public final boolean equals(Object obj) {
|
||||
if (!(obj instanceof zzz)) {
|
||||
return false;
|
||||
}
|
||||
zzz zzzVar = (zzz) obj;
|
||||
return this.b == zzzVar.b && this.a.getPublic().equals(zzzVar.a.getPublic()) && this.a.getPrivate().equals(zzzVar.a.getPrivate());
|
||||
}
|
||||
|
||||
public final int hashCode() {
|
||||
return Objects.a(this.a.getPublic(), this.a.getPrivate(), Long.valueOf(this.b));
|
||||
}
|
||||
}
|
7
sources/com/google/firebase/inject/Provider.java
Normal file
7
sources/com/google/firebase/inject/Provider.java
Normal file
@@ -0,0 +1,7 @@
|
||||
package com.google.firebase.inject;
|
||||
|
||||
/* compiled from: com.google.firebase:firebase-common@@16.0.2 */
|
||||
/* loaded from: classes.dex */
|
||||
public interface Provider<T> {
|
||||
T get();
|
||||
}
|
@@ -0,0 +1,11 @@
|
||||
package com.google.firebase.internal.api;
|
||||
|
||||
import com.google.firebase.FirebaseException;
|
||||
|
||||
/* compiled from: com.google.firebase:firebase-common@@16.0.2 */
|
||||
/* loaded from: classes.dex */
|
||||
public class FirebaseNoSignedInUserException extends FirebaseException {
|
||||
public FirebaseNoSignedInUserException(String str) {
|
||||
super(str);
|
||||
}
|
||||
}
|
8
sources/com/google/firebase/internal/zza.java
Normal file
8
sources/com/google/firebase/internal/zza.java
Normal file
@@ -0,0 +1,8 @@
|
||||
package com.google.firebase.internal;
|
||||
|
||||
import com.google.firebase.FirebaseApp;
|
||||
|
||||
/* compiled from: com.google.firebase:firebase-common@@16.0.2 */
|
||||
/* loaded from: classes.dex */
|
||||
public final class zza implements FirebaseApp.IdTokenListenersCountChangedListener {
|
||||
}
|
@@ -0,0 +1,59 @@
|
||||
package com.google.firebase.provider;
|
||||
|
||||
import android.content.ContentProvider;
|
||||
import android.content.ContentValues;
|
||||
import android.content.Context;
|
||||
import android.content.pm.ProviderInfo;
|
||||
import android.database.Cursor;
|
||||
import android.net.Uri;
|
||||
import android.util.Log;
|
||||
import com.google.android.gms.common.internal.Preconditions;
|
||||
import com.google.firebase.FirebaseApp;
|
||||
|
||||
/* compiled from: com.google.firebase:firebase-common@@16.0.2 */
|
||||
/* loaded from: classes.dex */
|
||||
public class FirebaseInitProvider extends ContentProvider {
|
||||
@Override // android.content.ContentProvider
|
||||
public void attachInfo(Context context, ProviderInfo providerInfo) {
|
||||
Preconditions.a(providerInfo, "FirebaseInitProvider ProviderInfo cannot be null.");
|
||||
if ("com.google.firebase.firebaseinitprovider".equals(providerInfo.authority)) {
|
||||
throw new IllegalStateException("Incorrect provider authority in manifest. Most likely due to a missing applicationId variable in application's build.gradle.");
|
||||
}
|
||||
super.attachInfo(context, providerInfo);
|
||||
}
|
||||
|
||||
@Override // android.content.ContentProvider
|
||||
public int delete(Uri uri, String str, String[] strArr) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override // android.content.ContentProvider
|
||||
public String getType(Uri uri) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override // android.content.ContentProvider
|
||||
public Uri insert(Uri uri, ContentValues contentValues) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override // android.content.ContentProvider
|
||||
public boolean onCreate() {
|
||||
if (FirebaseApp.a(getContext()) == null) {
|
||||
Log.i("FirebaseInitProvider", "FirebaseApp initialization unsuccessful");
|
||||
return false;
|
||||
}
|
||||
Log.i("FirebaseInitProvider", "FirebaseApp initialization successful");
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override // android.content.ContentProvider
|
||||
public Cursor query(Uri uri, String[] strArr, String str, String[] strArr2, String str2) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override // android.content.ContentProvider
|
||||
public int update(Uri uri, ContentValues contentValues, String str, String[] strArr) {
|
||||
return 0;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user