Kufar v3.2.0版本的 MD5 值为:6a4d203db1c561c7e3bcd50d23fed59f
以下内容为反编译后的 g.java 源代码,内容仅作参考
package bz;
import android.annotation.SuppressLint;
import android.text.TextUtils;
import androidx.annotation.GuardedBy;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.VisibleForTesting;
import bz.i;
import com.google.android.gms.common.internal.Preconditions;
import com.google.android.gms.tasks.Task;
import com.google.android.gms.tasks.TaskCompletionSource;
import com.google.android.gms.tasks.Tasks;
import cy.x;
import ez.d;
import ez.f;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
import java.util.concurrent.Executor;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.ThreadFactory;
import java.util.concurrent.atomic.AtomicInteger;
public class g implements h {
public static final Object f21007m = new Object();
public static final ThreadFactory f21008n = new a();
public final ux.e f21009a;
public final ez.c f21010b;
public final dz.c f21011c;
public final p f21012d;
public final x<dz.b> f21013e;
public final n f21014f;
public final Object f21015g;
public final ExecutorService f21016h;
public final Executor f21017i;
@GuardedBy("this")
public String f21018j;
@GuardedBy("FirebaseInstallations.this")
public Set<cz.a> f21019k;
@GuardedBy("lock")
public final List<o> f21020l;
public class a implements ThreadFactory {
public final AtomicInteger f21021a = new AtomicInteger(1);
@Override
@SuppressLint({"ThreadPoolCreation"})
public Thread newThread(Runnable runnable) {
return new Thread(runnable, String.format("firebase-installations-executor-%d", Integer.valueOf(this.f21021a.getAndIncrement())));
}
}
public static class b {
public static final int[] f21022a;
public static final int[] f21023b;
static {
int[] iArr = new int[f.b.values().length];
f21023b = iArr;
try {
iArr[f.b.OK.ordinal()] = 1;
} catch (NoSuchFieldError unused) {
}
try {
f21023b[f.b.BAD_CONFIG.ordinal()] = 2;
} catch (NoSuchFieldError unused2) {
}
try {
f21023b[f.b.AUTH_ERROR.ordinal()] = 3;
} catch (NoSuchFieldError unused3) {
}
int[] iArr2 = new int[d.b.values().length];
f21022a = iArr2;
try {
iArr2[d.b.OK.ordinal()] = 1;
} catch (NoSuchFieldError unused4) {
}
try {
f21022a[d.b.BAD_CONFIG.ordinal()] = 2;
} catch (NoSuchFieldError unused5) {
}
}
}
@SuppressLint({"ThreadPoolCreation"})
public g(final ux.e eVar, @NonNull az.b<yy.i> bVar, @NonNull ExecutorService executorService, @NonNull Executor executor) {
this(executorService, executor, eVar, new ez.c(eVar.j(), bVar), new dz.c(eVar), p.c(), new x(new az.b() {
@Override
public final Object get() {
dz.b y11;
y11 = g.y(ux.e.this);
return y11;
}
}), new n());
}
@NonNull
public static g p() {
return q(ux.e.k());
}
@NonNull
public static g q(@NonNull ux.e eVar) {
boolean z11;
if (eVar != null) {
z11 = true;
} else {
z11 = false;
}
Preconditions.checkArgument(z11, "Null is not a valid value of FirebaseApp.");
return (g) eVar.i(h.class);
}
public void w() {
x(false);
}
public static dz.b y(ux.e eVar) {
return new dz.b(eVar);
}
public final String A(dz.d dVar) {
if ((!this.f21009a.l().equals("CHIME_ANDROID_SDK") && !this.f21009a.t()) || !dVar.m()) {
return this.f21014f.a();
}
String f11 = o().f();
if (TextUtils.isEmpty(f11)) {
return this.f21014f.a();
}
return f11;
}
public final dz.d B(dz.d dVar) throws i {
String str;
if (dVar.d() != null && dVar.d().length() == 11) {
str = o().i();
} else {
str = null;
}
ez.d d11 = this.f21010b.d(l(), dVar.d(), t(), m(), str);
int i11 = b.f21022a[d11.e().ordinal()];
if (i11 != 1) {
if (i11 == 2) {
return dVar.q("BAD CONFIG");
}
throw new i("Firebase Installations Service is unavailable. Please try again later.", i.a.UNAVAILABLE);
}
return dVar.s(d11.c(), d11.d(), this.f21012d.b(), d11.b().c(), d11.b().d());
}
public final void C(Exception exc) {
synchronized (this.f21015g) {
Iterator<o> it = this.f21020l.iterator();
while (it.hasNext()) {
if (it.next().a(exc)) {
it.remove();
}
}
}
}
public final void D(dz.d dVar) {
synchronized (this.f21015g) {
Iterator<o> it = this.f21020l.iterator();
while (it.hasNext()) {
if (it.next().b(dVar)) {
it.remove();
}
}
}
}
public final synchronized void E(String str) {
this.f21018j = str;
}
public final synchronized void F(dz.d dVar, dz.d dVar2) {
if (this.f21019k.size() != 0 && !TextUtils.equals(dVar.d(), dVar2.d())) {
Iterator<cz.a> it = this.f21019k.iterator();
while (it.hasNext()) {
it.next().a(dVar2.d());
}
}
}
@Override
@NonNull
public Task<m> a(final boolean z11) {
z();
Task<m> f11 = f();
this.f21016h.execute(new Runnable() {
@Override
public final void run() {
g.this.x(z11);
}
});
return f11;
}
public final Task<m> f() {
TaskCompletionSource taskCompletionSource = new TaskCompletionSource();
h(new k(this.f21012d, taskCompletionSource));
return taskCompletionSource.getTask();
}
public final Task<String> g() {
TaskCompletionSource taskCompletionSource = new TaskCompletionSource();
h(new l(taskCompletionSource));
return taskCompletionSource.getTask();
}
@Override
@NonNull
public Task<String> getId() {
z();
String n11 = n();
if (n11 != null) {
return Tasks.forResult(n11);
}
Task<String> g11 = g();
this.f21016h.execute(new Runnable() {
@Override
public final void run() {
g.this.w();
}
});
return g11;
}
public final void h(o oVar) {
synchronized (this.f21015g) {
this.f21020l.add(oVar);
}
}
public final void v(boolean z11) {
dz.d B;
dz.d r11 = r();
try {
if (!r11.i() && !r11.l()) {
if (!z11 && !this.f21012d.f(r11)) {
return;
}
B = k(r11);
u(B);
F(r11, B);
if (B.k()) {
E(B.d());
}
if (!B.i()) {
C(new i(i.a.BAD_CONFIG));
return;
} else if (B.j()) {
C(new IOException("Installation ID could not be validated with the Firebase servers (maybe it was deleted). Firebase Installations will need to create a new Installation ID and auth token. Please retry your last request."));
return;
} else {
D(B);
return;
}
}
B = B(r11);
u(B);
F(r11, B);
if (B.k()) {
}
if (!B.i()) {
}
} catch (i e11) {
C(e11);
}
}
public final void x(final boolean z11) {
dz.d s11 = s();
if (z11) {
s11 = s11.p();
}
D(s11);
this.f21017i.execute(new Runnable() {
@Override
public final void run() {
g.this.v(z11);
}
});
}
public final dz.d k(@NonNull dz.d dVar) throws i {
ez.f e11 = this.f21010b.e(l(), dVar.d(), t(), dVar.f());
int i11 = b.f21023b[e11.b().ordinal()];
if (i11 != 1) {
if (i11 != 2) {
if (i11 == 3) {
E(null);
return dVar.r();
}
throw new i("Firebase Installations Service is unavailable. Please try again later.", i.a.UNAVAILABLE);
}
return dVar.q("BAD CONFIG");
}
return dVar.o(e11.c(), e11.d(), this.f21012d.b());
}
@Nullable
public String l() {
return this.f21009a.m().b();
}
@VisibleForTesting
public String m() {
return this.f21009a.m().c();
}
public final synchronized String n() {
return this.f21018j;
}
public final dz.b o() {
return this.f21013e.get();
}
public final dz.d r() {
dz.d d11;
synchronized (f21007m) {
bz.b a11 = bz.b.a(this.f21009a.j(), "generatefid.lock");
try {
d11 = this.f21011c.d();
} finally {
if (a11 != null) {
a11.b();
}
}
}
return d11;
}
public final dz.d s() {
dz.d d11;
synchronized (f21007m) {
bz.b a11 = bz.b.a(this.f21009a.j(), "generatefid.lock");
try {
d11 = this.f21011c.d();
if (d11.j()) {
d11 = this.f21011c.b(d11.t(A(d11)));
}
} finally {
if (a11 != null) {
a11.b();
}
}
}
return d11;
}
@Nullable
public String t() {
return this.f21009a.m().e();
}
public final void u(dz.d dVar) {
synchronized (f21007m) {
bz.b a11 = bz.b.a(this.f21009a.j(), "generatefid.lock");
try {
this.f21011c.b(dVar);
} finally {
if (a11 != null) {
a11.b();
}
}
}
}
public final void z() {
Preconditions.checkNotEmpty(m(), "Please set your Application ID. A valid Firebase App ID is required to communicate with Firebase server APIs: It identifies your application with Firebase.Please refer to https://firebase.google.com/support/privacy/init-options.");
Preconditions.checkNotEmpty(t(), "Please set your Project ID. A valid Firebase Project ID is required to communicate with Firebase server APIs: It identifies your application with Firebase.Please refer to https://firebase.google.com/support/privacy/init-options.");
Preconditions.checkNotEmpty(l(), "Please set a valid API key. A Firebase API key is required to communicate with Firebase server APIs: It authenticates your project with Google.Please refer to https://firebase.google.com/support/privacy/init-options.");
Preconditions.checkArgument(p.h(m()), "Please set your Application ID. A valid Firebase App ID is required to communicate with Firebase server APIs: It identifies your application with Firebase.Please refer to https://firebase.google.com/support/privacy/init-options.");
Preconditions.checkArgument(p.g(l()), "Please set a valid API key. A Firebase API key is required to communicate with Firebase server APIs: It authenticates your project with Google.Please refer to https://firebase.google.com/support/privacy/init-options.");
}
@SuppressLint({"ThreadPoolCreation"})
public g(ExecutorService executorService, Executor executor, ux.e eVar, ez.c cVar, dz.c cVar2, p pVar, x<dz.b> xVar, n nVar) {
this.f21015g = new Object();
this.f21019k = new HashSet();
this.f21020l = new ArrayList();
this.f21009a = eVar;
this.f21010b = cVar;
this.f21011c = cVar2;
this.f21012d = pVar;
this.f21013e = xVar;
this.f21014f = nVar;
this.f21016h = executorService;
this.f21017i = executor;
}
}