Primer paso de la investigacion. Se aportan el .apk, las carpetas con el apk extraido y el apk descompilado. El archivo API_DOCUMENTATION.md es un archivo donde se anotaran los descubrimientos del funcionamiento de la API, y los .py son scripts para probar la funcionalidad de la API con los métodos que vayamos encontrando. Finalmente, los archivos .js son scripts de Frida para extraer informacion de la APP durante la ejecucion.

This commit is contained in:
2025-12-04 13:59:54 +01:00
parent f2fd1c3bf5
commit e0133d2ca2
10432 changed files with 1019085 additions and 1 deletions

View File

@@ -0,0 +1,8 @@
package com.google.android.gms.tasks;
/* loaded from: classes3.dex */
public abstract class CancellationToken {
public abstract boolean isCancellationRequested();
public abstract CancellationToken onCanceledRequested(OnTokenCanceledListener onTokenCanceledListener);
}

View File

@@ -0,0 +1,14 @@
package com.google.android.gms.tasks;
/* loaded from: classes3.dex */
public class CancellationTokenSource {
private final zzb zza = new zzb();
public void cancel() {
this.zza.zza();
}
public CancellationToken getToken() {
return this.zza;
}
}

View File

@@ -0,0 +1,6 @@
package com.google.android.gms.tasks;
/* loaded from: classes3.dex */
public interface Continuation<TResult, TContinuationResult> {
TContinuationResult then(Task<TResult> task) throws Exception;
}

View File

@@ -0,0 +1,16 @@
package com.google.android.gms.tasks;
/* loaded from: classes3.dex */
public final class DuplicateTaskCompletionException extends IllegalStateException {
private DuplicateTaskCompletionException(String str, Throwable th) {
super(str, th);
}
public static IllegalStateException of(Task<?> task) {
if (!task.isComplete()) {
return new IllegalStateException("DuplicateTaskCompletionException can only be created from completed Task.");
}
Exception exception = task.getException();
return new DuplicateTaskCompletionException("Complete with: ".concat(exception != null ? "failure" : task.isSuccessful() ? "result ".concat(String.valueOf(task.getResult())) : task.isCanceled() ? "cancellation" : "unknown issue"), exception);
}
}

View File

@@ -0,0 +1,41 @@
package com.google.android.gms.tasks;
import com.google.android.gms.common.annotation.KeepForSdk;
@KeepForSdk
/* loaded from: classes3.dex */
public class NativeOnCompleteListener implements OnCompleteListener<Object> {
private final long zza;
@KeepForSdk
public NativeOnCompleteListener(long j4) {
this.zza = j4;
}
@KeepForSdk
public static void createAndAddCallback(Task<Object> task, long j4) {
task.addOnCompleteListener(new NativeOnCompleteListener(j4));
}
@KeepForSdk
public native void nativeOnComplete(long j4, Object obj, boolean z3, boolean z4, String str);
@Override // com.google.android.gms.tasks.OnCompleteListener
@KeepForSdk
public void onComplete(Task<Object> task) {
Object obj;
String str;
Exception exception;
if (task.isSuccessful()) {
obj = task.getResult();
str = null;
} else if (task.isCanceled() || (exception = task.getException()) == null) {
obj = null;
str = null;
} else {
str = exception.getMessage();
obj = null;
}
nativeOnComplete(this.zza, obj, task.isSuccessful(), task.isCanceled(), str);
}
}

View File

@@ -0,0 +1,6 @@
package com.google.android.gms.tasks;
/* loaded from: classes3.dex */
public interface OnCanceledListener {
void onCanceled();
}

View File

@@ -0,0 +1,6 @@
package com.google.android.gms.tasks;
/* loaded from: classes3.dex */
public interface OnCompleteListener<TResult> {
void onComplete(Task<TResult> task);
}

View File

@@ -0,0 +1,6 @@
package com.google.android.gms.tasks;
/* loaded from: classes3.dex */
public interface OnFailureListener {
void onFailure(Exception exc);
}

View File

@@ -0,0 +1,6 @@
package com.google.android.gms.tasks;
/* loaded from: classes3.dex */
public interface OnSuccessListener<TResult> {
void onSuccess(TResult tresult);
}

View File

@@ -0,0 +1,6 @@
package com.google.android.gms.tasks;
/* loaded from: classes3.dex */
public interface OnTokenCanceledListener {
void onCanceled();
}

View File

@@ -0,0 +1,7 @@
package com.google.android.gms.tasks;
/* loaded from: classes3.dex */
public final class R {
private R() {
}
}

View File

@@ -0,0 +1,8 @@
package com.google.android.gms.tasks;
/* loaded from: classes3.dex */
public class RuntimeExecutionException extends RuntimeException {
public RuntimeExecutionException(Throwable th) {
super(th);
}
}

View File

@@ -0,0 +1,6 @@
package com.google.android.gms.tasks;
/* loaded from: classes3.dex */
public interface SuccessContinuation<TResult, TContinuationResult> {
Task<TContinuationResult> then(TResult tresult) throws Exception;
}

View File

@@ -0,0 +1,79 @@
package com.google.android.gms.tasks;
import android.app.Activity;
import java.util.concurrent.Executor;
/* loaded from: classes3.dex */
public abstract class Task<TResult> {
public Task<TResult> addOnCanceledListener(Activity activity, OnCanceledListener onCanceledListener) {
throw new UnsupportedOperationException("addOnCanceledListener is not implemented.");
}
public Task<TResult> addOnCompleteListener(Activity activity, OnCompleteListener<TResult> onCompleteListener) {
throw new UnsupportedOperationException("addOnCompleteListener is not implemented");
}
public abstract Task<TResult> addOnFailureListener(Activity activity, OnFailureListener onFailureListener);
public abstract Task<TResult> addOnFailureListener(OnFailureListener onFailureListener);
public abstract Task<TResult> addOnFailureListener(Executor executor, OnFailureListener onFailureListener);
public abstract Task<TResult> addOnSuccessListener(Activity activity, OnSuccessListener<? super TResult> onSuccessListener);
public abstract Task<TResult> addOnSuccessListener(OnSuccessListener<? super TResult> onSuccessListener);
public abstract Task<TResult> addOnSuccessListener(Executor executor, OnSuccessListener<? super TResult> onSuccessListener);
public <TContinuationResult> Task<TContinuationResult> continueWith(Continuation<TResult, TContinuationResult> continuation) {
throw new UnsupportedOperationException("continueWith is not implemented");
}
public <TContinuationResult> Task<TContinuationResult> continueWithTask(Continuation<TResult, Task<TContinuationResult>> continuation) {
throw new UnsupportedOperationException("continueWithTask is not implemented");
}
public abstract Exception getException();
public abstract TResult getResult();
public abstract <X extends Throwable> TResult getResult(Class<X> cls) throws Throwable;
public abstract boolean isCanceled();
public abstract boolean isComplete();
public abstract boolean isSuccessful();
public <TContinuationResult> Task<TContinuationResult> onSuccessTask(SuccessContinuation<TResult, TContinuationResult> successContinuation) {
throw new UnsupportedOperationException("onSuccessTask is not implemented");
}
public Task<TResult> addOnCanceledListener(OnCanceledListener onCanceledListener) {
throw new UnsupportedOperationException("addOnCanceledListener is not implemented.");
}
public Task<TResult> addOnCompleteListener(OnCompleteListener<TResult> onCompleteListener) {
throw new UnsupportedOperationException("addOnCompleteListener is not implemented");
}
public <TContinuationResult> Task<TContinuationResult> continueWith(Executor executor, Continuation<TResult, TContinuationResult> continuation) {
throw new UnsupportedOperationException("continueWith is not implemented");
}
public <TContinuationResult> Task<TContinuationResult> continueWithTask(Executor executor, Continuation<TResult, Task<TContinuationResult>> continuation) {
throw new UnsupportedOperationException("continueWithTask is not implemented");
}
public <TContinuationResult> Task<TContinuationResult> onSuccessTask(Executor executor, SuccessContinuation<TResult, TContinuationResult> successContinuation) {
throw new UnsupportedOperationException("onSuccessTask is not implemented");
}
public Task<TResult> addOnCanceledListener(Executor executor, OnCanceledListener onCanceledListener) {
throw new UnsupportedOperationException("addOnCanceledListener is not implemented");
}
public Task<TResult> addOnCompleteListener(Executor executor, OnCompleteListener<TResult> onCompleteListener) {
throw new UnsupportedOperationException("addOnCompleteListener is not implemented");
}
}

View File

@@ -0,0 +1,33 @@
package com.google.android.gms.tasks;
/* loaded from: classes3.dex */
public class TaskCompletionSource<TResult> {
private final zzw zza = new zzw();
public TaskCompletionSource() {
}
public Task<TResult> getTask() {
return this.zza;
}
public void setException(Exception exc) {
this.zza.zza(exc);
}
public void setResult(TResult tresult) {
this.zza.zzb(tresult);
}
public boolean trySetException(Exception exc) {
return this.zza.zzd(exc);
}
public boolean trySetResult(TResult tresult) {
return this.zza.zze(tresult);
}
public TaskCompletionSource(CancellationToken cancellationToken) {
cancellationToken.onCanceledRequested(new zzs(this));
}
}

View File

@@ -0,0 +1,12 @@
package com.google.android.gms.tasks;
import java.util.concurrent.Executor;
/* loaded from: classes3.dex */
public final class TaskExecutors {
public static final Executor MAIN_THREAD = new zzu();
static final Executor zza = new zzt();
private TaskExecutors() {
}
}

View File

@@ -0,0 +1,187 @@
package com.google.android.gms.tasks;
import android.os.Looper;
import com.google.android.gms.common.internal.Preconditions;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import java.util.concurrent.Callable;
import java.util.concurrent.CancellationException;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.Executor;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
/* loaded from: classes3.dex */
public final class Tasks {
private Tasks() {
}
public static <TResult> TResult await(Task<TResult> task) throws ExecutionException, InterruptedException {
Preconditions.checkNotMainThread();
Preconditions.checkNotNull(task, "Task must not be null");
if (task.isComplete()) {
return (TResult) zza(task);
}
zzad zzadVar = new zzad(null);
zzb(task, zzadVar);
zzadVar.zza();
return (TResult) zza(task);
}
@Deprecated
public static <TResult> Task<TResult> call(Callable<TResult> callable) {
return call(TaskExecutors.MAIN_THREAD, callable);
}
public static <TResult> Task<TResult> forCanceled() {
zzw zzwVar = new zzw();
zzwVar.zzc();
return zzwVar;
}
public static <TResult> Task<TResult> forException(Exception exc) {
zzw zzwVar = new zzw();
zzwVar.zza(exc);
return zzwVar;
}
public static <TResult> Task<TResult> forResult(TResult tresult) {
zzw zzwVar = new zzw();
zzwVar.zzb(tresult);
return zzwVar;
}
public static Task<Void> whenAll(Collection<? extends Task<?>> collection) {
if (collection != null && !collection.isEmpty()) {
Iterator<? extends Task<?>> it = collection.iterator();
while (it.hasNext()) {
if (it.next() == null) {
throw new NullPointerException("null tasks are not accepted");
}
}
zzw zzwVar = new zzw();
zzaf zzafVar = new zzaf(collection.size(), zzwVar);
Iterator<? extends Task<?>> it2 = collection.iterator();
while (it2.hasNext()) {
zzb(it2.next(), zzafVar);
}
return zzwVar;
}
return forResult(null);
}
public static Task<List<Task<?>>> whenAllComplete(Collection<? extends Task<?>> collection) {
if (collection != null && !collection.isEmpty()) {
return whenAll(collection).continueWithTask(TaskExecutors.MAIN_THREAD, new zzab(collection));
}
return forResult(Collections.EMPTY_LIST);
}
public static <TResult> Task<List<TResult>> whenAllSuccess(Collection<? extends Task> collection) {
if (collection != null && !collection.isEmpty()) {
return (Task<List<TResult>>) whenAll((Collection<? extends Task<?>>) collection).continueWith(TaskExecutors.MAIN_THREAD, new zzaa(collection));
}
return forResult(Collections.EMPTY_LIST);
}
public static <T> Task<T> withTimeout(Task<T> task, long j4, TimeUnit timeUnit) {
Preconditions.checkNotNull(task, "Task must not be null");
Preconditions.checkArgument(j4 > 0, "Timeout must be positive");
Preconditions.checkNotNull(timeUnit, "TimeUnit must not be null");
final zzb zzbVar = new zzb();
final TaskCompletionSource taskCompletionSource = new TaskCompletionSource(zzbVar);
final com.google.android.gms.internal.tasks.zza zzaVar = new com.google.android.gms.internal.tasks.zza(Looper.getMainLooper());
zzaVar.postDelayed(new Runnable() { // from class: com.google.android.gms.tasks.zzx
@Override // java.lang.Runnable
public final void run() {
TaskCompletionSource.this.trySetException(new TimeoutException());
}
}, timeUnit.toMillis(j4));
task.addOnCompleteListener(new OnCompleteListener() { // from class: com.google.android.gms.tasks.zzy
@Override // com.google.android.gms.tasks.OnCompleteListener
public final void onComplete(Task task2) {
com.google.android.gms.internal.tasks.zza zzaVar2 = com.google.android.gms.internal.tasks.zza.this;
TaskCompletionSource taskCompletionSource2 = taskCompletionSource;
zzb zzbVar2 = zzbVar;
zzaVar2.removeCallbacksAndMessages(null);
if (task2.isSuccessful()) {
taskCompletionSource2.trySetResult(task2.getResult());
} else {
if (task2.isCanceled()) {
zzbVar2.zza();
return;
}
Exception exception = task2.getException();
exception.getClass();
taskCompletionSource2.trySetException(exception);
}
}
});
return taskCompletionSource.getTask();
}
private static Object zza(Task task) throws ExecutionException {
if (task.isSuccessful()) {
return task.getResult();
}
if (task.isCanceled()) {
throw new CancellationException("Task is already canceled");
}
throw new ExecutionException(task.getException());
}
private static void zzb(Task task, zzae zzaeVar) {
Executor executor = TaskExecutors.zza;
task.addOnSuccessListener(executor, zzaeVar);
task.addOnFailureListener(executor, zzaeVar);
task.addOnCanceledListener(executor, zzaeVar);
}
@Deprecated
public static <TResult> Task<TResult> call(Executor executor, Callable<TResult> callable) {
Preconditions.checkNotNull(executor, "Executor must not be null");
Preconditions.checkNotNull(callable, "Callback must not be null");
zzw zzwVar = new zzw();
executor.execute(new zzz(zzwVar, callable));
return zzwVar;
}
public static Task<List<Task<?>>> whenAllComplete(Task<?>... taskArr) {
if (taskArr != null && taskArr.length != 0) {
return whenAllComplete(Arrays.asList(taskArr));
}
return forResult(Collections.EMPTY_LIST);
}
public static <TResult> Task<List<TResult>> whenAllSuccess(Task... taskArr) {
if (taskArr != null && taskArr.length != 0) {
return whenAllSuccess(Arrays.asList(taskArr));
}
return forResult(Collections.EMPTY_LIST);
}
public static <TResult> TResult await(Task<TResult> task, long j4, TimeUnit timeUnit) throws ExecutionException, InterruptedException, TimeoutException {
Preconditions.checkNotMainThread();
Preconditions.checkNotNull(task, "Task must not be null");
Preconditions.checkNotNull(timeUnit, "TimeUnit must not be null");
if (task.isComplete()) {
return (TResult) zza(task);
}
zzad zzadVar = new zzad(null);
zzb(task, zzadVar);
if (zzadVar.zzb(j4, timeUnit)) {
return (TResult) zza(task);
}
throw new TimeoutException("Timed out waiting for Task");
}
public static Task<Void> whenAll(Task<?>... taskArr) {
if (taskArr != null && taskArr.length != 0) {
return whenAll(Arrays.asList(taskArr));
}
return forResult(null);
}
}

View File

@@ -0,0 +1,15 @@
package com.google.android.gms.tasks;
/* loaded from: classes3.dex */
final class zza implements OnSuccessListener {
final /* synthetic */ OnTokenCanceledListener zza;
public zza(zzb zzbVar, OnTokenCanceledListener onTokenCanceledListener) {
this.zza = onTokenCanceledListener;
}
@Override // com.google.android.gms.tasks.OnSuccessListener
public final /* bridge */ /* synthetic */ void onSuccess(Object obj) {
this.zza.onCanceled();
}
}

View File

@@ -0,0 +1,24 @@
package com.google.android.gms.tasks;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
/* loaded from: classes3.dex */
final class zzaa implements Continuation {
final /* synthetic */ Collection zza;
public zzaa(Collection collection) {
this.zza = collection;
}
@Override // com.google.android.gms.tasks.Continuation
public final /* bridge */ /* synthetic */ Object then(Task task) throws Exception {
ArrayList arrayList = new ArrayList();
Iterator it = this.zza.iterator();
while (it.hasNext()) {
arrayList.add(((Task) it.next()).getResult());
}
return arrayList;
}
}

View File

@@ -0,0 +1,21 @@
package com.google.android.gms.tasks;
import java.util.ArrayList;
import java.util.Collection;
/* JADX INFO: Access modifiers changed from: package-private */
/* loaded from: classes3.dex */
public final class zzab implements Continuation {
final /* synthetic */ Collection zza;
public zzab(Collection collection) {
this.zza = collection;
}
@Override // com.google.android.gms.tasks.Continuation
public final /* bridge */ /* synthetic */ Object then(Task task) throws Exception {
ArrayList arrayList = new ArrayList();
arrayList.addAll(this.zza);
return Tasks.forResult(arrayList);
}
}

View File

@@ -0,0 +1,38 @@
package com.google.android.gms.tasks;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
/* loaded from: classes3.dex */
final class zzad<T> implements zzae<T> {
private final CountDownLatch zza = new CountDownLatch(1);
private zzad() {
}
@Override // com.google.android.gms.tasks.OnCanceledListener
public final void onCanceled() {
this.zza.countDown();
}
@Override // com.google.android.gms.tasks.OnFailureListener
public final void onFailure(Exception exc) {
this.zza.countDown();
}
@Override // com.google.android.gms.tasks.OnSuccessListener
public final void onSuccess(T t2) {
this.zza.countDown();
}
public final void zza() throws InterruptedException {
this.zza.await();
}
public final boolean zzb(long j4, TimeUnit timeUnit) throws InterruptedException {
return this.zza.await(j4, timeUnit);
}
public /* synthetic */ zzad(zzac zzacVar) {
}
}

View File

@@ -0,0 +1,6 @@
package com.google.android.gms.tasks;
/* JADX INFO: Access modifiers changed from: package-private */
/* loaded from: classes3.dex */
public interface zzae<T> extends OnSuccessListener<T>, OnFailureListener, OnCanceledListener {
}

View File

@@ -0,0 +1,62 @@
package com.google.android.gms.tasks;
import java.util.concurrent.ExecutionException;
/* JADX INFO: Access modifiers changed from: package-private */
/* loaded from: classes3.dex */
public final class zzaf<T> implements zzae<T> {
private final Object zza = new Object();
private final int zzb;
private final zzw zzc;
private int zzd;
private int zze;
private int zzf;
private Exception zzg;
private boolean zzh;
public zzaf(int i, zzw zzwVar) {
this.zzb = i;
this.zzc = zzwVar;
}
private final void zza() {
if (this.zzd + this.zze + this.zzf == this.zzb) {
if (this.zzg == null) {
if (this.zzh) {
this.zzc.zzc();
return;
} else {
this.zzc.zzb(null);
return;
}
}
this.zzc.zza(new ExecutionException(this.zze + " out of " + this.zzb + " underlying tasks failed", this.zzg));
}
}
@Override // com.google.android.gms.tasks.OnCanceledListener
public final void onCanceled() {
synchronized (this.zza) {
this.zzf++;
this.zzh = true;
zza();
}
}
@Override // com.google.android.gms.tasks.OnFailureListener
public final void onFailure(Exception exc) {
synchronized (this.zza) {
this.zze++;
this.zzg = exc;
zza();
}
}
@Override // com.google.android.gms.tasks.OnSuccessListener
public final void onSuccess(T t2) {
synchronized (this.zza) {
this.zzd++;
zza();
}
}
}

View File

@@ -0,0 +1,22 @@
package com.google.android.gms.tasks;
/* JADX INFO: Access modifiers changed from: package-private */
/* loaded from: classes3.dex */
public final class zzb extends CancellationToken {
private final zzw zza = new zzw();
@Override // com.google.android.gms.tasks.CancellationToken
public final boolean isCancellationRequested() {
return this.zza.isComplete();
}
@Override // com.google.android.gms.tasks.CancellationToken
public final CancellationToken onCanceledRequested(OnTokenCanceledListener onTokenCanceledListener) {
this.zza.addOnSuccessListener(TaskExecutors.MAIN_THREAD, new zza(this, onTokenCanceledListener));
return this;
}
public final void zza() {
this.zza.zze(null);
}
}

View File

@@ -0,0 +1,44 @@
package com.google.android.gms.tasks;
/* loaded from: classes3.dex */
final class zzc implements Runnable {
final /* synthetic */ Task zza;
final /* synthetic */ zzd zzb;
public zzc(zzd zzdVar, Task task) {
this.zzb = zzdVar;
this.zza = task;
}
@Override // java.lang.Runnable
public final void run() {
zzw zzwVar;
zzw zzwVar2;
zzw zzwVar3;
Continuation continuation;
zzw zzwVar4;
zzw zzwVar5;
if (this.zza.isCanceled()) {
zzwVar5 = this.zzb.zzc;
zzwVar5.zzc();
return;
}
try {
continuation = this.zzb.zzb;
Object then = continuation.then(this.zza);
zzwVar4 = this.zzb.zzc;
zzwVar4.zzb(then);
} catch (RuntimeExecutionException e4) {
if (e4.getCause() instanceof Exception) {
zzwVar3 = this.zzb.zzc;
zzwVar3.zza((Exception) e4.getCause());
} else {
zzwVar2 = this.zzb.zzc;
zzwVar2.zza(e4);
}
} catch (Exception e5) {
zzwVar = this.zzb.zzc;
zzwVar.zza(e5);
}
}
}

View File

@@ -0,0 +1,27 @@
package com.google.android.gms.tasks;
import java.util.concurrent.Executor;
/* JADX INFO: Access modifiers changed from: package-private */
/* loaded from: classes3.dex */
public final class zzd implements zzq {
private final Executor zza;
private final Continuation zzb;
private final zzw zzc;
public zzd(Executor executor, Continuation continuation, zzw zzwVar) {
this.zza = executor;
this.zzb = continuation;
this.zzc = zzwVar;
}
@Override // com.google.android.gms.tasks.zzq
public final void zzc() {
throw new UnsupportedOperationException();
}
@Override // com.google.android.gms.tasks.zzq
public final void zzd(Task task) {
this.zza.execute(new zzc(this, task));
}
}

View File

@@ -0,0 +1,45 @@
package com.google.android.gms.tasks;
import java.util.concurrent.Executor;
/* loaded from: classes3.dex */
final class zze implements Runnable {
final /* synthetic */ Task zza;
final /* synthetic */ zzf zzb;
public zze(zzf zzfVar, Task task) {
this.zzb = zzfVar;
this.zza = task;
}
@Override // java.lang.Runnable
public final void run() {
zzw zzwVar;
zzw zzwVar2;
zzw zzwVar3;
Continuation continuation;
try {
continuation = this.zzb.zzb;
Task task = (Task) continuation.then(this.zza);
if (task == null) {
this.zzb.onFailure(new NullPointerException("Continuation returned null"));
return;
}
Executor executor = TaskExecutors.zza;
task.addOnSuccessListener(executor, this.zzb);
task.addOnFailureListener(executor, this.zzb);
task.addOnCanceledListener(executor, this.zzb);
} catch (RuntimeExecutionException e4) {
if (e4.getCause() instanceof Exception) {
zzwVar3 = this.zzb.zzc;
zzwVar3.zza((Exception) e4.getCause());
} else {
zzwVar2 = this.zzb.zzc;
zzwVar2.zza(e4);
}
} catch (Exception e5) {
zzwVar = this.zzb.zzc;
zzwVar.zza(e5);
}
}
}

View File

@@ -0,0 +1,42 @@
package com.google.android.gms.tasks;
import java.util.concurrent.Executor;
/* JADX INFO: Access modifiers changed from: package-private */
/* loaded from: classes3.dex */
public final class zzf<TResult, TContinuationResult> implements OnSuccessListener<TContinuationResult>, OnFailureListener, OnCanceledListener, zzq {
private final Executor zza;
private final Continuation zzb;
private final zzw zzc;
public zzf(Executor executor, Continuation continuation, zzw zzwVar) {
this.zza = executor;
this.zzb = continuation;
this.zzc = zzwVar;
}
@Override // com.google.android.gms.tasks.OnCanceledListener
public final void onCanceled() {
this.zzc.zzc();
}
@Override // com.google.android.gms.tasks.OnFailureListener
public final void onFailure(Exception exc) {
this.zzc.zza(exc);
}
@Override // com.google.android.gms.tasks.OnSuccessListener
public final void onSuccess(TContinuationResult tcontinuationresult) {
this.zzc.zzb(tcontinuationresult);
}
@Override // com.google.android.gms.tasks.zzq
public final void zzc() {
throw new UnsupportedOperationException();
}
@Override // com.google.android.gms.tasks.zzq
public final void zzd(Task task) {
this.zza.execute(new zze(this, task));
}
}

View File

@@ -0,0 +1,30 @@
package com.google.android.gms.tasks;
/* loaded from: classes3.dex */
final class zzg implements Runnable {
final /* synthetic */ zzh zza;
public zzg(zzh zzhVar) {
this.zza = zzhVar;
}
@Override // java.lang.Runnable
public final void run() {
Object obj;
OnCanceledListener onCanceledListener;
OnCanceledListener onCanceledListener2;
obj = this.zza.zzb;
synchronized (obj) {
try {
zzh zzhVar = this.zza;
onCanceledListener = zzhVar.zzc;
if (onCanceledListener != null) {
onCanceledListener2 = zzhVar.zzc;
onCanceledListener2.onCanceled();
}
} catch (Throwable th) {
throw th;
}
}
}
}

View File

@@ -0,0 +1,38 @@
package com.google.android.gms.tasks;
import java.util.concurrent.Executor;
/* loaded from: classes3.dex */
final class zzh implements zzq {
private final Executor zza;
private final Object zzb = new Object();
private OnCanceledListener zzc;
public zzh(Executor executor, OnCanceledListener onCanceledListener) {
this.zza = executor;
this.zzc = onCanceledListener;
}
@Override // com.google.android.gms.tasks.zzq
public final void zzc() {
synchronized (this.zzb) {
this.zzc = null;
}
}
@Override // com.google.android.gms.tasks.zzq
public final void zzd(Task task) {
if (task.isCanceled()) {
synchronized (this.zzb) {
try {
if (this.zzc == null) {
return;
}
this.zza.execute(new zzg(this));
} catch (Throwable th) {
throw th;
}
}
}
}
}

View File

@@ -0,0 +1,32 @@
package com.google.android.gms.tasks;
/* loaded from: classes3.dex */
final class zzi implements Runnable {
final /* synthetic */ Task zza;
final /* synthetic */ zzj zzb;
public zzi(zzj zzjVar, Task task) {
this.zzb = zzjVar;
this.zza = task;
}
@Override // java.lang.Runnable
public final void run() {
Object obj;
OnCompleteListener onCompleteListener;
OnCompleteListener onCompleteListener2;
obj = this.zzb.zzb;
synchronized (obj) {
try {
zzj zzjVar = this.zzb;
onCompleteListener = zzjVar.zzc;
if (onCompleteListener != null) {
onCompleteListener2 = zzjVar.zzc;
onCompleteListener2.onComplete(this.zza);
}
} catch (Throwable th) {
throw th;
}
}
}
}

View File

@@ -0,0 +1,36 @@
package com.google.android.gms.tasks;
import java.util.concurrent.Executor;
/* loaded from: classes3.dex */
final class zzj implements zzq {
private final Executor zza;
private final Object zzb = new Object();
private OnCompleteListener zzc;
public zzj(Executor executor, OnCompleteListener onCompleteListener) {
this.zza = executor;
this.zzc = onCompleteListener;
}
@Override // com.google.android.gms.tasks.zzq
public final void zzc() {
synchronized (this.zzb) {
this.zzc = null;
}
}
@Override // com.google.android.gms.tasks.zzq
public final void zzd(Task task) {
synchronized (this.zzb) {
try {
if (this.zzc == null) {
return;
}
this.zza.execute(new zzi(this, task));
} catch (Throwable th) {
throw th;
}
}
}
}

View File

@@ -0,0 +1,34 @@
package com.google.android.gms.tasks;
import com.google.android.gms.common.internal.Preconditions;
/* loaded from: classes3.dex */
final class zzk implements Runnable {
final /* synthetic */ Task zza;
final /* synthetic */ zzl zzb;
public zzk(zzl zzlVar, Task task) {
this.zzb = zzlVar;
this.zza = task;
}
@Override // java.lang.Runnable
public final void run() {
Object obj;
OnFailureListener onFailureListener;
OnFailureListener onFailureListener2;
obj = this.zzb.zzb;
synchronized (obj) {
try {
zzl zzlVar = this.zzb;
onFailureListener = zzlVar.zzc;
if (onFailureListener != null) {
onFailureListener2 = zzlVar.zzc;
onFailureListener2.onFailure((Exception) Preconditions.checkNotNull(this.zza.getException()));
}
} catch (Throwable th) {
throw th;
}
}
}
}

View File

@@ -0,0 +1,40 @@
package com.google.android.gms.tasks;
import java.util.concurrent.Executor;
/* JADX INFO: Access modifiers changed from: package-private */
/* loaded from: classes3.dex */
public final class zzl implements zzq {
private final Executor zza;
private final Object zzb = new Object();
private OnFailureListener zzc;
public zzl(Executor executor, OnFailureListener onFailureListener) {
this.zza = executor;
this.zzc = onFailureListener;
}
@Override // com.google.android.gms.tasks.zzq
public final void zzc() {
synchronized (this.zzb) {
this.zzc = null;
}
}
@Override // com.google.android.gms.tasks.zzq
public final void zzd(Task task) {
if (task.isSuccessful() || task.isCanceled()) {
return;
}
synchronized (this.zzb) {
try {
if (this.zzc == null) {
return;
}
this.zza.execute(new zzk(this, task));
} catch (Throwable th) {
throw th;
}
}
}
}

View File

@@ -0,0 +1,32 @@
package com.google.android.gms.tasks;
/* loaded from: classes3.dex */
final class zzm implements Runnable {
final /* synthetic */ Task zza;
final /* synthetic */ zzn zzb;
public zzm(zzn zznVar, Task task) {
this.zzb = zznVar;
this.zza = task;
}
@Override // java.lang.Runnable
public final void run() {
Object obj;
OnSuccessListener onSuccessListener;
OnSuccessListener onSuccessListener2;
obj = this.zzb.zzb;
synchronized (obj) {
try {
zzn zznVar = this.zzb;
onSuccessListener = zznVar.zzc;
if (onSuccessListener != null) {
onSuccessListener2 = zznVar.zzc;
onSuccessListener2.onSuccess(this.zza.getResult());
}
} catch (Throwable th) {
throw th;
}
}
}
}

View File

@@ -0,0 +1,39 @@
package com.google.android.gms.tasks;
import java.util.concurrent.Executor;
/* JADX INFO: Access modifiers changed from: package-private */
/* loaded from: classes3.dex */
public final class zzn implements zzq {
private final Executor zza;
private final Object zzb = new Object();
private OnSuccessListener zzc;
public zzn(Executor executor, OnSuccessListener onSuccessListener) {
this.zza = executor;
this.zzc = onSuccessListener;
}
@Override // com.google.android.gms.tasks.zzq
public final void zzc() {
synchronized (this.zzb) {
this.zzc = null;
}
}
@Override // com.google.android.gms.tasks.zzq
public final void zzd(Task task) {
if (task.isSuccessful()) {
synchronized (this.zzb) {
try {
if (this.zzc == null) {
return;
}
this.zza.execute(new zzm(this, task));
} catch (Throwable th) {
throw th;
}
}
}
}
}

View File

@@ -0,0 +1,42 @@
package com.google.android.gms.tasks;
import java.util.concurrent.CancellationException;
import java.util.concurrent.Executor;
/* loaded from: classes3.dex */
final class zzo implements Runnable {
final /* synthetic */ Task zza;
final /* synthetic */ zzp zzb;
public zzo(zzp zzpVar, Task task) {
this.zzb = zzpVar;
this.zza = task;
}
@Override // java.lang.Runnable
public final void run() {
SuccessContinuation successContinuation;
try {
successContinuation = this.zzb.zzb;
Task then = successContinuation.then(this.zza.getResult());
if (then == null) {
this.zzb.onFailure(new NullPointerException("Continuation returned null"));
return;
}
Executor executor = TaskExecutors.zza;
then.addOnSuccessListener(executor, this.zzb);
then.addOnFailureListener(executor, this.zzb);
then.addOnCanceledListener(executor, this.zzb);
} catch (RuntimeExecutionException e4) {
if (e4.getCause() instanceof Exception) {
this.zzb.onFailure((Exception) e4.getCause());
} else {
this.zzb.onFailure(e4);
}
} catch (CancellationException unused) {
this.zzb.onCanceled();
} catch (Exception e5) {
this.zzb.onFailure(e5);
}
}
}

View File

@@ -0,0 +1,41 @@
package com.google.android.gms.tasks;
import java.util.concurrent.Executor;
/* loaded from: classes3.dex */
final class zzp<TResult, TContinuationResult> implements OnSuccessListener<TContinuationResult>, OnFailureListener, OnCanceledListener, zzq {
private final Executor zza;
private final SuccessContinuation zzb;
private final zzw zzc;
public zzp(Executor executor, SuccessContinuation successContinuation, zzw zzwVar) {
this.zza = executor;
this.zzb = successContinuation;
this.zzc = zzwVar;
}
@Override // com.google.android.gms.tasks.OnCanceledListener
public final void onCanceled() {
this.zzc.zzc();
}
@Override // com.google.android.gms.tasks.OnFailureListener
public final void onFailure(Exception exc) {
this.zzc.zza(exc);
}
@Override // com.google.android.gms.tasks.OnSuccessListener
public final void onSuccess(TContinuationResult tcontinuationresult) {
this.zzc.zzb(tcontinuationresult);
}
@Override // com.google.android.gms.tasks.zzq
public final void zzc() {
throw new UnsupportedOperationException();
}
@Override // com.google.android.gms.tasks.zzq
public final void zzd(Task task) {
this.zza.execute(new zzo(this, task));
}
}

View File

@@ -0,0 +1,9 @@
package com.google.android.gms.tasks;
/* JADX INFO: Access modifiers changed from: package-private */
/* loaded from: classes3.dex */
public interface zzq<TResult> {
void zzc();
void zzd(Task task);
}

View File

@@ -0,0 +1,47 @@
package com.google.android.gms.tasks;
import java.util.ArrayDeque;
import java.util.Queue;
/* JADX INFO: Access modifiers changed from: package-private */
/* loaded from: classes3.dex */
public final class zzr {
private final Object zza = new Object();
private Queue zzb;
private boolean zzc;
public final void zza(zzq zzqVar) {
synchronized (this.zza) {
try {
if (this.zzb == null) {
this.zzb = new ArrayDeque();
}
this.zzb.add(zzqVar);
} catch (Throwable th) {
throw th;
}
}
}
public final void zzb(Task task) {
zzq zzqVar;
synchronized (this.zza) {
if (this.zzb != null && !this.zzc) {
this.zzc = true;
while (true) {
synchronized (this.zza) {
try {
zzqVar = (zzq) this.zzb.poll();
if (zzqVar == null) {
this.zzc = false;
return;
}
} finally {
}
}
zzqVar.zzd(task);
}
}
}
}
}

View File

@@ -0,0 +1,18 @@
package com.google.android.gms.tasks;
/* JADX INFO: Access modifiers changed from: package-private */
/* loaded from: classes3.dex */
public final class zzs implements OnTokenCanceledListener {
final /* synthetic */ TaskCompletionSource zza;
public zzs(TaskCompletionSource taskCompletionSource) {
this.zza = taskCompletionSource;
}
@Override // com.google.android.gms.tasks.OnTokenCanceledListener
public final void onCanceled() {
zzw zzwVar;
zzwVar = this.zza.zza;
zzwVar.zzc();
}
}

View File

@@ -0,0 +1,11 @@
package com.google.android.gms.tasks;
import java.util.concurrent.Executor;
/* loaded from: classes3.dex */
final class zzt implements Executor {
@Override // java.util.concurrent.Executor
public final void execute(Runnable runnable) {
runnable.run();
}
}

View File

@@ -0,0 +1,15 @@
package com.google.android.gms.tasks;
import android.os.Handler;
import android.os.Looper;
import java.util.concurrent.Executor;
/* loaded from: classes3.dex */
final class zzu implements Executor {
private final Handler zza = new com.google.android.gms.internal.tasks.zza(Looper.getMainLooper());
@Override // java.util.concurrent.Executor
public final void execute(Runnable runnable) {
this.zza.post(runnable);
}
}

View File

@@ -0,0 +1,50 @@
package com.google.android.gms.tasks;
import android.app.Activity;
import com.google.android.gms.common.api.internal.LifecycleCallback;
import com.google.android.gms.common.api.internal.LifecycleFragment;
import java.lang.ref.WeakReference;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
/* loaded from: classes3.dex */
final class zzv extends LifecycleCallback {
private final List zza;
private zzv(LifecycleFragment lifecycleFragment) {
super(lifecycleFragment);
this.zza = new ArrayList();
this.mLifecycleFragment.addCallback("TaskOnStopCallback", this);
}
public static zzv zza(Activity activity) {
LifecycleFragment fragment = LifecycleCallback.getFragment(activity);
zzv zzvVar = (zzv) fragment.getCallbackOrNull("TaskOnStopCallback", zzv.class);
return zzvVar == null ? new zzv(fragment) : zzvVar;
}
@Override // com.google.android.gms.common.api.internal.LifecycleCallback
public final void onStop() {
synchronized (this.zza) {
try {
Iterator it = this.zza.iterator();
while (it.hasNext()) {
zzq zzqVar = (zzq) ((WeakReference) it.next()).get();
if (zzqVar != null) {
zzqVar.zzc();
}
}
this.zza.clear();
} catch (Throwable th) {
throw th;
}
}
}
public final void zzb(zzq zzqVar) {
synchronized (this.zza) {
this.zza.add(new WeakReference(zzqVar));
}
}
}

View File

@@ -0,0 +1,327 @@
package com.google.android.gms.tasks;
import android.app.Activity;
import com.google.android.gms.common.internal.Preconditions;
import java.util.concurrent.CancellationException;
import java.util.concurrent.Executor;
/* JADX INFO: Access modifiers changed from: package-private */
/* loaded from: classes3.dex */
public final class zzw<TResult> extends Task<TResult> {
private final Object zza = new Object();
private final zzr zzb = new zzr();
private boolean zzc;
private volatile boolean zzd;
private Object zze;
private Exception zzf;
private final void zzf() {
Preconditions.checkState(this.zzc, "Task is not yet complete");
}
private final void zzg() {
if (this.zzd) {
throw new CancellationException("Task is already canceled.");
}
}
private final void zzh() {
if (this.zzc) {
throw DuplicateTaskCompletionException.of(this);
}
}
private final void zzi() {
synchronized (this.zza) {
try {
if (this.zzc) {
this.zzb.zzb(this);
}
} catch (Throwable th) {
throw th;
}
}
}
@Override // com.google.android.gms.tasks.Task
public final Task<TResult> addOnCanceledListener(Activity activity, OnCanceledListener onCanceledListener) {
zzh zzhVar = new zzh(TaskExecutors.MAIN_THREAD, onCanceledListener);
this.zzb.zza(zzhVar);
zzv.zza(activity).zzb(zzhVar);
zzi();
return this;
}
@Override // com.google.android.gms.tasks.Task
public final Task<TResult> addOnCompleteListener(Activity activity, OnCompleteListener<TResult> onCompleteListener) {
zzj zzjVar = new zzj(TaskExecutors.MAIN_THREAD, onCompleteListener);
this.zzb.zza(zzjVar);
zzv.zza(activity).zzb(zzjVar);
zzi();
return this;
}
@Override // com.google.android.gms.tasks.Task
public final Task<TResult> addOnFailureListener(Activity activity, OnFailureListener onFailureListener) {
zzl zzlVar = new zzl(TaskExecutors.MAIN_THREAD, onFailureListener);
this.zzb.zza(zzlVar);
zzv.zza(activity).zzb(zzlVar);
zzi();
return this;
}
@Override // com.google.android.gms.tasks.Task
public final Task<TResult> addOnSuccessListener(Activity activity, OnSuccessListener<? super TResult> onSuccessListener) {
zzn zznVar = new zzn(TaskExecutors.MAIN_THREAD, onSuccessListener);
this.zzb.zza(zznVar);
zzv.zza(activity).zzb(zznVar);
zzi();
return this;
}
@Override // com.google.android.gms.tasks.Task
public final <TContinuationResult> Task<TContinuationResult> continueWith(Continuation<TResult, TContinuationResult> continuation) {
return continueWith(TaskExecutors.MAIN_THREAD, continuation);
}
@Override // com.google.android.gms.tasks.Task
public final <TContinuationResult> Task<TContinuationResult> continueWithTask(Continuation<TResult, Task<TContinuationResult>> continuation) {
return continueWithTask(TaskExecutors.MAIN_THREAD, continuation);
}
@Override // com.google.android.gms.tasks.Task
public final Exception getException() {
Exception exc;
synchronized (this.zza) {
exc = this.zzf;
}
return exc;
}
@Override // com.google.android.gms.tasks.Task
public final TResult getResult() {
TResult tresult;
synchronized (this.zza) {
try {
zzf();
zzg();
Exception exc = this.zzf;
if (exc == null) {
tresult = (TResult) this.zze;
} else {
throw new RuntimeExecutionException(exc);
}
} catch (Throwable th) {
throw th;
}
}
return tresult;
}
@Override // com.google.android.gms.tasks.Task
public final boolean isCanceled() {
return this.zzd;
}
@Override // com.google.android.gms.tasks.Task
public final boolean isComplete() {
boolean z3;
synchronized (this.zza) {
z3 = this.zzc;
}
return z3;
}
@Override // com.google.android.gms.tasks.Task
public final boolean isSuccessful() {
boolean z3;
synchronized (this.zza) {
try {
z3 = false;
if (this.zzc && !this.zzd && this.zzf == null) {
z3 = true;
}
} finally {
}
}
return z3;
}
@Override // com.google.android.gms.tasks.Task
public final <TContinuationResult> Task<TContinuationResult> onSuccessTask(SuccessContinuation<TResult, TContinuationResult> successContinuation) {
Executor executor = TaskExecutors.MAIN_THREAD;
zzw zzwVar = new zzw();
this.zzb.zza(new zzp(executor, successContinuation, zzwVar));
zzi();
return zzwVar;
}
public final void zza(Exception exc) {
Preconditions.checkNotNull(exc, "Exception must not be null");
synchronized (this.zza) {
zzh();
this.zzc = true;
this.zzf = exc;
}
this.zzb.zzb(this);
}
public final void zzb(Object obj) {
synchronized (this.zza) {
zzh();
this.zzc = true;
this.zze = obj;
}
this.zzb.zzb(this);
}
public final boolean zzc() {
synchronized (this.zza) {
try {
if (this.zzc) {
return false;
}
this.zzc = true;
this.zzd = true;
this.zzb.zzb(this);
return true;
} catch (Throwable th) {
throw th;
}
}
}
public final boolean zzd(Exception exc) {
Preconditions.checkNotNull(exc, "Exception must not be null");
synchronized (this.zza) {
try {
if (this.zzc) {
return false;
}
this.zzc = true;
this.zzf = exc;
this.zzb.zzb(this);
return true;
} catch (Throwable th) {
throw th;
}
}
}
public final boolean zze(Object obj) {
synchronized (this.zza) {
try {
if (this.zzc) {
return false;
}
this.zzc = true;
this.zze = obj;
this.zzb.zzb(this);
return true;
} catch (Throwable th) {
throw th;
}
}
}
@Override // com.google.android.gms.tasks.Task
public final <TContinuationResult> Task<TContinuationResult> continueWith(Executor executor, Continuation<TResult, TContinuationResult> continuation) {
zzw zzwVar = new zzw();
this.zzb.zza(new zzd(executor, continuation, zzwVar));
zzi();
return zzwVar;
}
@Override // com.google.android.gms.tasks.Task
public final <TContinuationResult> Task<TContinuationResult> continueWithTask(Executor executor, Continuation<TResult, Task<TContinuationResult>> continuation) {
zzw zzwVar = new zzw();
this.zzb.zza(new zzf(executor, continuation, zzwVar));
zzi();
return zzwVar;
}
@Override // com.google.android.gms.tasks.Task
public final Task<TResult> addOnCanceledListener(OnCanceledListener onCanceledListener) {
addOnCanceledListener(TaskExecutors.MAIN_THREAD, onCanceledListener);
return this;
}
@Override // com.google.android.gms.tasks.Task
public final Task<TResult> addOnCompleteListener(OnCompleteListener<TResult> onCompleteListener) {
this.zzb.zza(new zzj(TaskExecutors.MAIN_THREAD, onCompleteListener));
zzi();
return this;
}
@Override // com.google.android.gms.tasks.Task
public final Task<TResult> addOnFailureListener(OnFailureListener onFailureListener) {
addOnFailureListener(TaskExecutors.MAIN_THREAD, onFailureListener);
return this;
}
@Override // com.google.android.gms.tasks.Task
public final Task<TResult> addOnSuccessListener(OnSuccessListener<? super TResult> onSuccessListener) {
addOnSuccessListener(TaskExecutors.MAIN_THREAD, onSuccessListener);
return this;
}
@Override // com.google.android.gms.tasks.Task
public final <TContinuationResult> Task<TContinuationResult> onSuccessTask(Executor executor, SuccessContinuation<TResult, TContinuationResult> successContinuation) {
zzw zzwVar = new zzw();
this.zzb.zza(new zzp(executor, successContinuation, zzwVar));
zzi();
return zzwVar;
}
@Override // com.google.android.gms.tasks.Task
public final Task<TResult> addOnCanceledListener(Executor executor, OnCanceledListener onCanceledListener) {
this.zzb.zza(new zzh(executor, onCanceledListener));
zzi();
return this;
}
@Override // com.google.android.gms.tasks.Task
public final Task<TResult> addOnFailureListener(Executor executor, OnFailureListener onFailureListener) {
this.zzb.zza(new zzl(executor, onFailureListener));
zzi();
return this;
}
@Override // com.google.android.gms.tasks.Task
public final Task<TResult> addOnSuccessListener(Executor executor, OnSuccessListener<? super TResult> onSuccessListener) {
this.zzb.zza(new zzn(executor, onSuccessListener));
zzi();
return this;
}
@Override // com.google.android.gms.tasks.Task
public final Task<TResult> addOnCompleteListener(Executor executor, OnCompleteListener<TResult> onCompleteListener) {
this.zzb.zza(new zzj(executor, onCompleteListener));
zzi();
return this;
}
@Override // com.google.android.gms.tasks.Task
public final <X extends Throwable> TResult getResult(Class<X> cls) throws Throwable {
TResult tresult;
synchronized (this.zza) {
try {
zzf();
zzg();
if (!cls.isInstance(this.zzf)) {
Exception exc = this.zzf;
if (exc == null) {
tresult = (TResult) this.zze;
} else {
throw new RuntimeExecutionException(exc);
}
} else {
throw cls.cast(this.zzf);
}
} catch (Throwable th) {
throw th;
}
}
return tresult;
}
}

View File

@@ -0,0 +1,26 @@
package com.google.android.gms.tasks;
import java.util.concurrent.Callable;
/* JADX INFO: Access modifiers changed from: package-private */
/* loaded from: classes3.dex */
public final class zzz implements Runnable {
final /* synthetic */ zzw zza;
final /* synthetic */ Callable zzb;
public zzz(zzw zzwVar, Callable callable) {
this.zza = zzwVar;
this.zzb = callable;
}
@Override // java.lang.Runnable
public final void run() {
try {
this.zza.zzb(this.zzb.call());
} catch (Exception e4) {
this.zza.zza(e4);
} catch (Throwable th) {
this.zza.zza(new RuntimeException(th));
}
}
}