Initial commit
This commit is contained in:
@@ -0,0 +1,324 @@
|
||||
package com.google.android.gms.ads.identifier;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.os.RemoteException;
|
||||
import android.os.SystemClock;
|
||||
import android.util.Log;
|
||||
import com.baidu.cloud.media.player.BDCloudMediaPlayer;
|
||||
import com.google.android.gms.common.BlockingServiceConnection;
|
||||
import com.google.android.gms.common.GoogleApiAvailabilityLight;
|
||||
import com.google.android.gms.common.GooglePlayServicesNotAvailableException;
|
||||
import com.google.android.gms.common.GooglePlayServicesRepairableException;
|
||||
import com.google.android.gms.common.GooglePlayServicesUtilLight;
|
||||
import com.google.android.gms.common.internal.Preconditions;
|
||||
import com.google.android.gms.common.stats.ConnectionTracker;
|
||||
import com.google.android.gms.internal.ads_identifier.zze;
|
||||
import com.google.android.gms.internal.ads_identifier.zzf;
|
||||
import java.io.IOException;
|
||||
import java.lang.ref.WeakReference;
|
||||
import java.util.HashMap;
|
||||
import java.util.concurrent.CountDownLatch;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class AdvertisingIdClient {
|
||||
private final Context mContext;
|
||||
private BlockingServiceConnection zze;
|
||||
private zze zzf;
|
||||
private boolean zzg;
|
||||
private final Object zzh;
|
||||
private zza zzi;
|
||||
private final boolean zzj;
|
||||
private final long zzk;
|
||||
|
||||
public static final class Info {
|
||||
private final String zzq;
|
||||
private final boolean zzr;
|
||||
|
||||
public Info(String str, boolean z) {
|
||||
this.zzq = str;
|
||||
this.zzr = z;
|
||||
}
|
||||
|
||||
public final String getId() {
|
||||
return this.zzq;
|
||||
}
|
||||
|
||||
public final boolean isLimitAdTrackingEnabled() {
|
||||
return this.zzr;
|
||||
}
|
||||
|
||||
public final String toString() {
|
||||
String str = this.zzq;
|
||||
boolean z = this.zzr;
|
||||
StringBuilder sb = new StringBuilder(String.valueOf(str).length() + 7);
|
||||
sb.append("{");
|
||||
sb.append(str);
|
||||
sb.append("}");
|
||||
sb.append(z);
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
||||
|
||||
static class zza extends Thread {
|
||||
private WeakReference<AdvertisingIdClient> a;
|
||||
private long b;
|
||||
CountDownLatch c = new CountDownLatch(1);
|
||||
boolean d = false;
|
||||
|
||||
public zza(AdvertisingIdClient advertisingIdClient, long j) {
|
||||
this.a = new WeakReference<>(advertisingIdClient);
|
||||
this.b = j;
|
||||
start();
|
||||
}
|
||||
|
||||
private final void a() {
|
||||
AdvertisingIdClient advertisingIdClient = this.a.get();
|
||||
if (advertisingIdClient != null) {
|
||||
advertisingIdClient.finish();
|
||||
this.d = true;
|
||||
}
|
||||
}
|
||||
|
||||
@Override // java.lang.Thread, java.lang.Runnable
|
||||
public final void run() {
|
||||
try {
|
||||
if (this.c.await(this.b, TimeUnit.MILLISECONDS)) {
|
||||
return;
|
||||
}
|
||||
a();
|
||||
} catch (InterruptedException unused) {
|
||||
a();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public AdvertisingIdClient(Context context) {
|
||||
this(context, 30000L, false, false);
|
||||
}
|
||||
|
||||
private AdvertisingIdClient(Context context, long j, boolean z, boolean z2) {
|
||||
Context applicationContext;
|
||||
this.zzh = new Object();
|
||||
Preconditions.a(context);
|
||||
if (z && (applicationContext = context.getApplicationContext()) != null) {
|
||||
context = applicationContext;
|
||||
}
|
||||
this.mContext = context;
|
||||
this.zzg = false;
|
||||
this.zzk = j;
|
||||
this.zzj = z2;
|
||||
}
|
||||
|
||||
public static Info getAdvertisingIdInfo(Context context) throws IOException, IllegalStateException, GooglePlayServicesNotAvailableException, GooglePlayServicesRepairableException {
|
||||
zzb zzbVar = new zzb(context);
|
||||
boolean a = zzbVar.a("gads:ad_id_app_context:enabled", false);
|
||||
float a2 = zzbVar.a("gads:ad_id_app_context:ping_ratio", 0.0f);
|
||||
String a3 = zzbVar.a("gads:ad_id_use_shared_preference:experiment_id", "");
|
||||
AdvertisingIdClient advertisingIdClient = new AdvertisingIdClient(context, -1L, a, zzbVar.a("gads:ad_id_use_persistent_service:enabled", false));
|
||||
try {
|
||||
long elapsedRealtime = SystemClock.elapsedRealtime();
|
||||
advertisingIdClient.zza(false);
|
||||
Info info = advertisingIdClient.getInfo();
|
||||
advertisingIdClient.zza(info, a, a2, SystemClock.elapsedRealtime() - elapsedRealtime, a3, null);
|
||||
return info;
|
||||
} finally {
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean getIsAdIdFakeForDebugLogging(Context context) throws IOException, GooglePlayServicesNotAvailableException, GooglePlayServicesRepairableException {
|
||||
zzb zzbVar = new zzb(context);
|
||||
AdvertisingIdClient advertisingIdClient = new AdvertisingIdClient(context, -1L, zzbVar.a("gads:ad_id_app_context:enabled", false), zzbVar.a("com.google.android.gms.ads.identifier.service.PERSISTENT_START", false));
|
||||
try {
|
||||
advertisingIdClient.zza(false);
|
||||
return advertisingIdClient.zzb();
|
||||
} finally {
|
||||
advertisingIdClient.finish();
|
||||
}
|
||||
}
|
||||
|
||||
public static void setShouldSkipGmsCoreVersionCheck(boolean z) {
|
||||
}
|
||||
|
||||
private static BlockingServiceConnection zza(Context context, boolean z) throws IOException, GooglePlayServicesNotAvailableException, GooglePlayServicesRepairableException {
|
||||
try {
|
||||
context.getPackageManager().getPackageInfo("com.android.vending", 0);
|
||||
int a = GoogleApiAvailabilityLight.a().a(context, GooglePlayServicesUtilLight.GOOGLE_PLAY_SERVICES_VERSION_CODE);
|
||||
if (a != 0 && a != 2) {
|
||||
throw new IOException("Google Play services not available");
|
||||
}
|
||||
String str = z ? "com.google.android.gms.ads.identifier.service.PERSISTENT_START" : "com.google.android.gms.ads.identifier.service.START";
|
||||
BlockingServiceConnection blockingServiceConnection = new BlockingServiceConnection();
|
||||
Intent intent = new Intent(str);
|
||||
intent.setPackage("com.google.android.gms");
|
||||
try {
|
||||
if (ConnectionTracker.a().a(context, intent, blockingServiceConnection, 1)) {
|
||||
return blockingServiceConnection;
|
||||
}
|
||||
throw new IOException("Connection failure");
|
||||
} catch (Throwable th) {
|
||||
throw new IOException(th);
|
||||
}
|
||||
} catch (PackageManager.NameNotFoundException unused) {
|
||||
throw new GooglePlayServicesNotAvailableException(9);
|
||||
}
|
||||
}
|
||||
|
||||
private static zze zza(Context context, BlockingServiceConnection blockingServiceConnection) throws IOException {
|
||||
try {
|
||||
return zzf.a(blockingServiceConnection.a(10000L, TimeUnit.MILLISECONDS));
|
||||
} catch (InterruptedException unused) {
|
||||
throw new IOException("Interrupted exception");
|
||||
} catch (Throwable th) {
|
||||
throw new IOException(th);
|
||||
}
|
||||
}
|
||||
|
||||
private final void zza() {
|
||||
synchronized (this.zzh) {
|
||||
if (this.zzi != null) {
|
||||
this.zzi.c.countDown();
|
||||
try {
|
||||
this.zzi.join();
|
||||
} catch (InterruptedException unused) {
|
||||
}
|
||||
}
|
||||
if (this.zzk > 0) {
|
||||
this.zzi = new zza(this, this.zzk);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private final void zza(boolean z) throws IOException, IllegalStateException, GooglePlayServicesNotAvailableException, GooglePlayServicesRepairableException {
|
||||
Preconditions.c("Calling this from your main thread can lead to deadlock");
|
||||
synchronized (this) {
|
||||
if (this.zzg) {
|
||||
finish();
|
||||
}
|
||||
this.zze = zza(this.mContext, this.zzj);
|
||||
this.zzf = zza(this.mContext, this.zze);
|
||||
this.zzg = true;
|
||||
if (z) {
|
||||
zza();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private final boolean zza(Info info, boolean z, float f, long j, String str, Throwable th) {
|
||||
if (Math.random() > f) {
|
||||
return false;
|
||||
}
|
||||
HashMap hashMap = new HashMap();
|
||||
hashMap.put("app_context", z ? "1" : "0");
|
||||
if (info != null) {
|
||||
hashMap.put("limit_ad_tracking", info.isLimitAdTrackingEnabled() ? "1" : "0");
|
||||
}
|
||||
if (info != null && info.getId() != null) {
|
||||
hashMap.put("ad_id_size", Integer.toString(info.getId().length()));
|
||||
}
|
||||
if (th != null) {
|
||||
hashMap.put(BDCloudMediaPlayer.OnNativeInvokeListener.ARG_ERROR, th.getClass().getName());
|
||||
}
|
||||
if (str != null && !str.isEmpty()) {
|
||||
hashMap.put("experiment_id", str);
|
||||
}
|
||||
hashMap.put("tag", "AdvertisingIdClient");
|
||||
hashMap.put("time_spent", Long.toString(j));
|
||||
new com.google.android.gms.ads.identifier.zza(this, hashMap).start();
|
||||
return true;
|
||||
}
|
||||
|
||||
private final boolean zzb() throws IOException {
|
||||
boolean zzc;
|
||||
Preconditions.c("Calling this from your main thread can lead to deadlock");
|
||||
synchronized (this) {
|
||||
if (!this.zzg) {
|
||||
synchronized (this.zzh) {
|
||||
if (this.zzi == null || !this.zzi.d) {
|
||||
throw new IOException("AdvertisingIdClient is not connected.");
|
||||
}
|
||||
}
|
||||
try {
|
||||
zza(false);
|
||||
if (!this.zzg) {
|
||||
throw new IOException("AdvertisingIdClient cannot reconnect.");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
throw new IOException("AdvertisingIdClient cannot reconnect.", e);
|
||||
}
|
||||
}
|
||||
Preconditions.a(this.zze);
|
||||
Preconditions.a(this.zzf);
|
||||
try {
|
||||
zzc = this.zzf.zzc();
|
||||
} catch (RemoteException e2) {
|
||||
Log.i("AdvertisingIdClient", "GMS remote exception ", e2);
|
||||
throw new IOException("Remote exception");
|
||||
}
|
||||
}
|
||||
zza();
|
||||
return zzc;
|
||||
}
|
||||
|
||||
protected void finalize() throws Throwable {
|
||||
finish();
|
||||
super.finalize();
|
||||
}
|
||||
|
||||
public final void finish() {
|
||||
Preconditions.c("Calling this from your main thread can lead to deadlock");
|
||||
synchronized (this) {
|
||||
if (this.mContext == null || this.zze == null) {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
if (this.zzg) {
|
||||
ConnectionTracker.a().a(this.mContext, this.zze);
|
||||
}
|
||||
} catch (Throwable th) {
|
||||
Log.i("AdvertisingIdClient", "AdvertisingIdClient unbindService failed.", th);
|
||||
}
|
||||
this.zzg = false;
|
||||
this.zzf = null;
|
||||
this.zze = null;
|
||||
}
|
||||
}
|
||||
|
||||
public Info getInfo() throws IOException {
|
||||
Info info;
|
||||
Preconditions.c("Calling this from your main thread can lead to deadlock");
|
||||
synchronized (this) {
|
||||
if (!this.zzg) {
|
||||
synchronized (this.zzh) {
|
||||
if (this.zzi == null || !this.zzi.d) {
|
||||
throw new IOException("AdvertisingIdClient is not connected.");
|
||||
}
|
||||
}
|
||||
try {
|
||||
zza(false);
|
||||
if (!this.zzg) {
|
||||
throw new IOException("AdvertisingIdClient cannot reconnect.");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
throw new IOException("AdvertisingIdClient cannot reconnect.", e);
|
||||
}
|
||||
}
|
||||
Preconditions.a(this.zze);
|
||||
Preconditions.a(this.zzf);
|
||||
try {
|
||||
info = new Info(this.zzf.getId(), this.zzf.d(true));
|
||||
} catch (RemoteException e2) {
|
||||
Log.i("AdvertisingIdClient", "GMS remote exception ", e2);
|
||||
throw new IOException("Remote exception");
|
||||
}
|
||||
}
|
||||
zza();
|
||||
return info;
|
||||
}
|
||||
|
||||
public void start() throws IOException, IllegalStateException, GooglePlayServicesNotAvailableException, GooglePlayServicesRepairableException {
|
||||
zza(true);
|
||||
}
|
||||
}
|
80
sources/com/google/android/gms/ads/identifier/zza.java
Normal file
80
sources/com/google/android/gms/ads/identifier/zza.java
Normal file
@@ -0,0 +1,80 @@
|
||||
package com.google.android.gms.ads.identifier;
|
||||
|
||||
import android.net.Uri;
|
||||
import android.util.Log;
|
||||
import java.io.IOException;
|
||||
import java.net.HttpURLConnection;
|
||||
import java.net.URL;
|
||||
import java.util.Map;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
final class zza extends Thread {
|
||||
private final /* synthetic */ Map a;
|
||||
|
||||
zza(AdvertisingIdClient advertisingIdClient, Map map) {
|
||||
this.a = map;
|
||||
}
|
||||
|
||||
@Override // java.lang.Thread, java.lang.Runnable
|
||||
public final void run() {
|
||||
String message;
|
||||
StringBuilder sb;
|
||||
String str;
|
||||
Exception exc;
|
||||
new zzc();
|
||||
Map map = this.a;
|
||||
Uri.Builder buildUpon = Uri.parse("https://pagead2.googlesyndication.com/pagead/gen_204?id=gmob-apps").buildUpon();
|
||||
for (String str2 : map.keySet()) {
|
||||
buildUpon.appendQueryParameter(str2, (String) map.get(str2));
|
||||
}
|
||||
String uri = buildUpon.build().toString();
|
||||
try {
|
||||
HttpURLConnection httpURLConnection = (HttpURLConnection) new URL(uri).openConnection();
|
||||
try {
|
||||
int responseCode = httpURLConnection.getResponseCode();
|
||||
if (responseCode < 200 || responseCode >= 300) {
|
||||
StringBuilder sb2 = new StringBuilder(String.valueOf(uri).length() + 65);
|
||||
sb2.append("Received non-success response code ");
|
||||
sb2.append(responseCode);
|
||||
sb2.append(" from pinging URL: ");
|
||||
sb2.append(uri);
|
||||
Log.w("HttpUrlPinger", sb2.toString());
|
||||
}
|
||||
} finally {
|
||||
httpURLConnection.disconnect();
|
||||
}
|
||||
} catch (IOException e) {
|
||||
e = e;
|
||||
message = e.getMessage();
|
||||
sb = new StringBuilder(String.valueOf(uri).length() + 27 + String.valueOf(message).length());
|
||||
str = "Error while pinging URL: ";
|
||||
exc = e;
|
||||
sb.append(str);
|
||||
sb.append(uri);
|
||||
sb.append(". ");
|
||||
sb.append(message);
|
||||
Log.w("HttpUrlPinger", sb.toString(), exc);
|
||||
} catch (IndexOutOfBoundsException e2) {
|
||||
message = e2.getMessage();
|
||||
sb = new StringBuilder(String.valueOf(uri).length() + 32 + String.valueOf(message).length());
|
||||
str = "Error while parsing ping URL: ";
|
||||
exc = e2;
|
||||
sb.append(str);
|
||||
sb.append(uri);
|
||||
sb.append(". ");
|
||||
sb.append(message);
|
||||
Log.w("HttpUrlPinger", sb.toString(), exc);
|
||||
} catch (RuntimeException e3) {
|
||||
e = e3;
|
||||
message = e.getMessage();
|
||||
sb = new StringBuilder(String.valueOf(uri).length() + 27 + String.valueOf(message).length());
|
||||
str = "Error while pinging URL: ";
|
||||
exc = e;
|
||||
sb.append(str);
|
||||
sb.append(uri);
|
||||
sb.append(". ");
|
||||
sb.append(message);
|
||||
Log.w("HttpUrlPinger", sb.toString(), exc);
|
||||
}
|
||||
}
|
||||
}
|
54
sources/com/google/android/gms/ads/identifier/zzb.java
Normal file
54
sources/com/google/android/gms/ads/identifier/zzb.java
Normal file
@@ -0,0 +1,54 @@
|
||||
package com.google.android.gms.ads.identifier;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
import android.util.Log;
|
||||
import com.google.android.gms.common.GooglePlayServicesUtilLight;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class zzb {
|
||||
private SharedPreferences a;
|
||||
|
||||
public zzb(Context context) {
|
||||
try {
|
||||
Context remoteContext = GooglePlayServicesUtilLight.getRemoteContext(context);
|
||||
this.a = remoteContext == null ? null : remoteContext.getSharedPreferences("google_ads_flags", 0);
|
||||
} catch (Throwable th) {
|
||||
Log.w("GmscoreFlag", "Error while getting SharedPreferences ", th);
|
||||
this.a = null;
|
||||
}
|
||||
}
|
||||
|
||||
final float a(String str, float f) {
|
||||
try {
|
||||
if (this.a == null) {
|
||||
return 0.0f;
|
||||
}
|
||||
return this.a.getFloat(str, 0.0f);
|
||||
} catch (Throwable th) {
|
||||
Log.w("GmscoreFlag", "Error while reading from SharedPreferences ", th);
|
||||
return 0.0f;
|
||||
}
|
||||
}
|
||||
|
||||
final String a(String str, String str2) {
|
||||
try {
|
||||
return this.a == null ? str2 : this.a.getString(str, str2);
|
||||
} catch (Throwable th) {
|
||||
Log.w("GmscoreFlag", "Error while reading from SharedPreferences ", th);
|
||||
return str2;
|
||||
}
|
||||
}
|
||||
|
||||
public final boolean a(String str, boolean z) {
|
||||
try {
|
||||
if (this.a == null) {
|
||||
return false;
|
||||
}
|
||||
return this.a.getBoolean(str, false);
|
||||
} catch (Throwable th) {
|
||||
Log.w("GmscoreFlag", "Error while reading from SharedPreferences ", th);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
5
sources/com/google/android/gms/ads/identifier/zzc.java
Normal file
5
sources/com/google/android/gms/ads/identifier/zzc.java
Normal file
@@ -0,0 +1,5 @@
|
||||
package com.google.android.gms.ads.identifier;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class zzc {
|
||||
}
|
@@ -0,0 +1,235 @@
|
||||
package com.google.android.gms.auth.api.signin;
|
||||
|
||||
import android.accounts.Account;
|
||||
import android.net.Uri;
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
import android.text.TextUtils;
|
||||
import com.google.android.gms.common.api.Scope;
|
||||
import com.google.android.gms.common.internal.Preconditions;
|
||||
import com.google.android.gms.common.internal.ReflectedParcelable;
|
||||
import com.google.android.gms.common.internal.safeparcel.AbstractSafeParcelable;
|
||||
import com.google.android.gms.common.internal.safeparcel.SafeParcelWriter;
|
||||
import com.google.android.gms.common.util.Clock;
|
||||
import com.google.android.gms.common.util.DefaultClock;
|
||||
import com.ubt.jimu.controller.data.widget.JockstickDataConverter;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class GoogleSignInAccount extends AbstractSafeParcelable implements ReflectedParcelable {
|
||||
public static final Parcelable.Creator<GoogleSignInAccount> CREATOR = new zab();
|
||||
private static Clock zae = DefaultClock.d();
|
||||
private String mId;
|
||||
private final int versionCode;
|
||||
private String zaf;
|
||||
private String zag;
|
||||
private String zah;
|
||||
private Uri zai;
|
||||
private String zaj;
|
||||
private long zak;
|
||||
private String zal;
|
||||
private List<Scope> zam;
|
||||
private String zan;
|
||||
private String zao;
|
||||
private Set<Scope> zap = new HashSet();
|
||||
|
||||
GoogleSignInAccount(int i, String str, String str2, String str3, String str4, Uri uri, String str5, long j, String str6, List<Scope> list, String str7, String str8) {
|
||||
this.versionCode = i;
|
||||
this.mId = str;
|
||||
this.zaf = str2;
|
||||
this.zag = str3;
|
||||
this.zah = str4;
|
||||
this.zai = uri;
|
||||
this.zaj = str5;
|
||||
this.zak = j;
|
||||
this.zal = str6;
|
||||
this.zam = list;
|
||||
this.zan = str7;
|
||||
this.zao = str8;
|
||||
}
|
||||
|
||||
public static GoogleSignInAccount createDefault() {
|
||||
Account account = new Account("<<default account>>", "com.google");
|
||||
return zaa(null, null, account.name, null, null, null, null, 0L, account.name, new HashSet());
|
||||
}
|
||||
|
||||
public static GoogleSignInAccount zaa(String str) throws JSONException {
|
||||
if (TextUtils.isEmpty(str)) {
|
||||
return null;
|
||||
}
|
||||
JSONObject jSONObject = new JSONObject(str);
|
||||
String optString = jSONObject.optString("photoUrl", null);
|
||||
Uri parse = !TextUtils.isEmpty(optString) ? Uri.parse(optString) : null;
|
||||
long parseLong = Long.parseLong(jSONObject.getString("expirationTime"));
|
||||
HashSet hashSet = new HashSet();
|
||||
JSONArray jSONArray = jSONObject.getJSONArray("grantedScopes");
|
||||
int length = jSONArray.length();
|
||||
for (int i = 0; i < length; i++) {
|
||||
hashSet.add(new Scope(jSONArray.getString(i)));
|
||||
}
|
||||
GoogleSignInAccount zaa = zaa(jSONObject.optString(JockstickDataConverter.ID), jSONObject.optString("tokenId", null), jSONObject.optString("email", null), jSONObject.optString("displayName", null), jSONObject.optString("givenName", null), jSONObject.optString("familyName", null), parse, Long.valueOf(parseLong), jSONObject.getString("obfuscatedIdentifier"), hashSet);
|
||||
zaa.zaj = jSONObject.optString("serverAuthCode", null);
|
||||
return zaa;
|
||||
}
|
||||
|
||||
private final JSONObject zad() {
|
||||
JSONObject jSONObject = new JSONObject();
|
||||
try {
|
||||
if (getId() != null) {
|
||||
jSONObject.put(JockstickDataConverter.ID, getId());
|
||||
}
|
||||
if (getIdToken() != null) {
|
||||
jSONObject.put("tokenId", getIdToken());
|
||||
}
|
||||
if (getEmail() != null) {
|
||||
jSONObject.put("email", getEmail());
|
||||
}
|
||||
if (getDisplayName() != null) {
|
||||
jSONObject.put("displayName", getDisplayName());
|
||||
}
|
||||
if (getGivenName() != null) {
|
||||
jSONObject.put("givenName", getGivenName());
|
||||
}
|
||||
if (getFamilyName() != null) {
|
||||
jSONObject.put("familyName", getFamilyName());
|
||||
}
|
||||
if (getPhotoUrl() != null) {
|
||||
jSONObject.put("photoUrl", getPhotoUrl().toString());
|
||||
}
|
||||
if (getServerAuthCode() != null) {
|
||||
jSONObject.put("serverAuthCode", getServerAuthCode());
|
||||
}
|
||||
jSONObject.put("expirationTime", this.zak);
|
||||
jSONObject.put("obfuscatedIdentifier", this.zal);
|
||||
JSONArray jSONArray = new JSONArray();
|
||||
Scope[] scopeArr = (Scope[]) this.zam.toArray(new Scope[this.zam.size()]);
|
||||
Arrays.sort(scopeArr, zaa.a);
|
||||
for (Scope scope : scopeArr) {
|
||||
jSONArray.put(scope.getScopeUri());
|
||||
}
|
||||
jSONObject.put("grantedScopes", jSONArray);
|
||||
return jSONObject;
|
||||
} catch (JSONException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
public boolean equals(Object obj) {
|
||||
if (obj == this) {
|
||||
return true;
|
||||
}
|
||||
if (!(obj instanceof GoogleSignInAccount)) {
|
||||
return false;
|
||||
}
|
||||
GoogleSignInAccount googleSignInAccount = (GoogleSignInAccount) obj;
|
||||
return googleSignInAccount.zal.equals(this.zal) && googleSignInAccount.getRequestedScopes().equals(getRequestedScopes());
|
||||
}
|
||||
|
||||
public Account getAccount() {
|
||||
String str = this.zag;
|
||||
if (str == null) {
|
||||
return null;
|
||||
}
|
||||
return new Account(str, "com.google");
|
||||
}
|
||||
|
||||
public String getDisplayName() {
|
||||
return this.zah;
|
||||
}
|
||||
|
||||
public String getEmail() {
|
||||
return this.zag;
|
||||
}
|
||||
|
||||
public String getFamilyName() {
|
||||
return this.zao;
|
||||
}
|
||||
|
||||
public String getGivenName() {
|
||||
return this.zan;
|
||||
}
|
||||
|
||||
public Set<Scope> getGrantedScopes() {
|
||||
return new HashSet(this.zam);
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return this.mId;
|
||||
}
|
||||
|
||||
public String getIdToken() {
|
||||
return this.zaf;
|
||||
}
|
||||
|
||||
public Uri getPhotoUrl() {
|
||||
return this.zai;
|
||||
}
|
||||
|
||||
public Set<Scope> getRequestedScopes() {
|
||||
HashSet hashSet = new HashSet(this.zam);
|
||||
hashSet.addAll(this.zap);
|
||||
return hashSet;
|
||||
}
|
||||
|
||||
public String getServerAuthCode() {
|
||||
return this.zaj;
|
||||
}
|
||||
|
||||
public int hashCode() {
|
||||
return ((this.zal.hashCode() + 527) * 31) + getRequestedScopes().hashCode();
|
||||
}
|
||||
|
||||
public boolean isExpired() {
|
||||
return zae.a() / 1000 >= this.zak - 300;
|
||||
}
|
||||
|
||||
public GoogleSignInAccount requestExtraScopes(Scope... scopeArr) {
|
||||
if (scopeArr != null) {
|
||||
Collections.addAll(this.zap, scopeArr);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override // android.os.Parcelable
|
||||
public void writeToParcel(Parcel parcel, int i) {
|
||||
int a = SafeParcelWriter.a(parcel);
|
||||
SafeParcelWriter.a(parcel, 1, this.versionCode);
|
||||
SafeParcelWriter.a(parcel, 2, getId(), false);
|
||||
SafeParcelWriter.a(parcel, 3, getIdToken(), false);
|
||||
SafeParcelWriter.a(parcel, 4, getEmail(), false);
|
||||
SafeParcelWriter.a(parcel, 5, getDisplayName(), false);
|
||||
SafeParcelWriter.a(parcel, 6, (Parcelable) getPhotoUrl(), i, false);
|
||||
SafeParcelWriter.a(parcel, 7, getServerAuthCode(), false);
|
||||
SafeParcelWriter.a(parcel, 8, this.zak);
|
||||
SafeParcelWriter.a(parcel, 9, this.zal, false);
|
||||
SafeParcelWriter.c(parcel, 10, this.zam, false);
|
||||
SafeParcelWriter.a(parcel, 11, getGivenName(), false);
|
||||
SafeParcelWriter.a(parcel, 12, getFamilyName(), false);
|
||||
SafeParcelWriter.a(parcel, a);
|
||||
}
|
||||
|
||||
public final String zab() {
|
||||
return this.zal;
|
||||
}
|
||||
|
||||
public final String zac() {
|
||||
JSONObject zad = zad();
|
||||
zad.remove("serverAuthCode");
|
||||
return zad.toString();
|
||||
}
|
||||
|
||||
private static GoogleSignInAccount zaa(String str, String str2, String str3, String str4, String str5, String str6, Uri uri, Long l, String str7, Set<Scope> set) {
|
||||
long longValue = (l == null ? Long.valueOf(zae.a() / 1000) : l).longValue();
|
||||
Preconditions.b(str7);
|
||||
Preconditions.a(set);
|
||||
return new GoogleSignInAccount(3, str, str2, str3, str4, uri, null, longValue, str7, new ArrayList(set), str5, str6);
|
||||
}
|
||||
}
|
@@ -0,0 +1,330 @@
|
||||
package com.google.android.gms.auth.api.signin;
|
||||
|
||||
import android.accounts.Account;
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
import android.text.TextUtils;
|
||||
import com.google.android.gms.auth.api.signin.internal.GoogleSignInOptionsExtensionParcelable;
|
||||
import com.google.android.gms.auth.api.signin.internal.HashAccumulator;
|
||||
import com.google.android.gms.common.api.Api;
|
||||
import com.google.android.gms.common.api.Scope;
|
||||
import com.google.android.gms.common.internal.ReflectedParcelable;
|
||||
import com.google.android.gms.common.internal.safeparcel.AbstractSafeParcelable;
|
||||
import com.google.android.gms.common.internal.safeparcel.SafeParcelWriter;
|
||||
import com.tencent.open.SocialConstants;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class GoogleSignInOptions extends AbstractSafeParcelable implements Api.ApiOptions.Optional, ReflectedParcelable {
|
||||
public static final Parcelable.Creator<GoogleSignInOptions> CREATOR;
|
||||
public static final GoogleSignInOptions DEFAULT_GAMES_SIGN_IN;
|
||||
public static final GoogleSignInOptions DEFAULT_SIGN_IN;
|
||||
private static Comparator<Scope> zaaf;
|
||||
public static final Scope zar = new Scope("profile");
|
||||
public static final Scope zas = new Scope("email");
|
||||
public static final Scope zat = new Scope(SocialConstants.PARAM_OPEN_ID);
|
||||
public static final Scope zau = new Scope("https://www.googleapis.com/auth/games_lite");
|
||||
public static final Scope zav = new Scope("https://www.googleapis.com/auth/games");
|
||||
private final int versionCode;
|
||||
private final boolean zaaa;
|
||||
private String zaab;
|
||||
private String zaac;
|
||||
private ArrayList<GoogleSignInOptionsExtensionParcelable> zaad;
|
||||
private Map<Integer, GoogleSignInOptionsExtensionParcelable> zaae;
|
||||
private final ArrayList<Scope> zaw;
|
||||
private Account zax;
|
||||
private boolean zay;
|
||||
private final boolean zaz;
|
||||
|
||||
static {
|
||||
Builder b = new Builder().b();
|
||||
b.c();
|
||||
DEFAULT_SIGN_IN = b.a();
|
||||
Builder builder = new Builder();
|
||||
builder.a(zau, new Scope[0]);
|
||||
DEFAULT_GAMES_SIGN_IN = builder.a();
|
||||
CREATOR = new zad();
|
||||
zaaf = new zac();
|
||||
}
|
||||
|
||||
GoogleSignInOptions(int i, ArrayList<Scope> arrayList, Account account, boolean z, boolean z2, boolean z3, String str, String str2, ArrayList<GoogleSignInOptionsExtensionParcelable> arrayList2) {
|
||||
this(i, arrayList, account, z, z2, z3, str, str2, zaa(arrayList2));
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: private */
|
||||
public static Map<Integer, GoogleSignInOptionsExtensionParcelable> zaa(List<GoogleSignInOptionsExtensionParcelable> list) {
|
||||
HashMap hashMap = new HashMap();
|
||||
if (list == null) {
|
||||
return hashMap;
|
||||
}
|
||||
for (GoogleSignInOptionsExtensionParcelable googleSignInOptionsExtensionParcelable : list) {
|
||||
hashMap.put(Integer.valueOf(googleSignInOptionsExtensionParcelable.getType()), googleSignInOptionsExtensionParcelable);
|
||||
}
|
||||
return hashMap;
|
||||
}
|
||||
|
||||
public static GoogleSignInOptions zab(String str) throws JSONException {
|
||||
if (TextUtils.isEmpty(str)) {
|
||||
return null;
|
||||
}
|
||||
JSONObject jSONObject = new JSONObject(str);
|
||||
HashSet hashSet = new HashSet();
|
||||
JSONArray jSONArray = jSONObject.getJSONArray("scopes");
|
||||
int length = jSONArray.length();
|
||||
for (int i = 0; i < length; i++) {
|
||||
hashSet.add(new Scope(jSONArray.getString(i)));
|
||||
}
|
||||
String optString = jSONObject.optString("accountName", null);
|
||||
return new GoogleSignInOptions(3, (ArrayList<Scope>) new ArrayList(hashSet), !TextUtils.isEmpty(optString) ? new Account(optString, "com.google") : null, jSONObject.getBoolean("idTokenRequested"), jSONObject.getBoolean("serverAuthRequested"), jSONObject.getBoolean("forceCodeForRefreshToken"), jSONObject.optString("serverClientId", null), jSONObject.optString("hostedDomain", null), new HashMap());
|
||||
}
|
||||
|
||||
private final JSONObject zad() {
|
||||
JSONObject jSONObject = new JSONObject();
|
||||
try {
|
||||
JSONArray jSONArray = new JSONArray();
|
||||
Collections.sort(this.zaw, zaaf);
|
||||
ArrayList<Scope> arrayList = this.zaw;
|
||||
int size = arrayList.size();
|
||||
int i = 0;
|
||||
while (i < size) {
|
||||
Scope scope = arrayList.get(i);
|
||||
i++;
|
||||
jSONArray.put(scope.getScopeUri());
|
||||
}
|
||||
jSONObject.put("scopes", jSONArray);
|
||||
if (this.zax != null) {
|
||||
jSONObject.put("accountName", this.zax.name);
|
||||
}
|
||||
jSONObject.put("idTokenRequested", this.zay);
|
||||
jSONObject.put("forceCodeForRefreshToken", this.zaaa);
|
||||
jSONObject.put("serverAuthRequested", this.zaz);
|
||||
if (!TextUtils.isEmpty(this.zaab)) {
|
||||
jSONObject.put("serverClientId", this.zaab);
|
||||
}
|
||||
if (!TextUtils.isEmpty(this.zaac)) {
|
||||
jSONObject.put("hostedDomain", this.zaac);
|
||||
}
|
||||
return jSONObject;
|
||||
} catch (JSONException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
/* JADX WARN: Code restructure failed: missing block: B:35:0x0069, code lost:
|
||||
|
||||
if (r3.zaab.equals(r4.getServerClientId()) != false) goto L29;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:37:0x004a, code lost:
|
||||
|
||||
if (r3.zax.equals(r4.getAccount()) != false) goto L22;
|
||||
*/
|
||||
/*
|
||||
Code decompiled incorrectly, please refer to instructions dump.
|
||||
To view partially-correct code enable 'Show inconsistent code' option in preferences
|
||||
*/
|
||||
public boolean equals(java.lang.Object r4) {
|
||||
/*
|
||||
r3 = this;
|
||||
r0 = 0
|
||||
if (r4 != 0) goto L4
|
||||
return r0
|
||||
L4:
|
||||
com.google.android.gms.auth.api.signin.GoogleSignInOptions r4 = (com.google.android.gms.auth.api.signin.GoogleSignInOptions) r4 // Catch: java.lang.ClassCastException -> L85
|
||||
java.util.ArrayList<com.google.android.gms.auth.api.signin.internal.GoogleSignInOptionsExtensionParcelable> r1 = r3.zaad // Catch: java.lang.ClassCastException -> L85
|
||||
int r1 = r1.size() // Catch: java.lang.ClassCastException -> L85
|
||||
if (r1 > 0) goto L85
|
||||
java.util.ArrayList<com.google.android.gms.auth.api.signin.internal.GoogleSignInOptionsExtensionParcelable> r1 = r4.zaad // Catch: java.lang.ClassCastException -> L85
|
||||
int r1 = r1.size() // Catch: java.lang.ClassCastException -> L85
|
||||
if (r1 <= 0) goto L18
|
||||
goto L85
|
||||
L18:
|
||||
java.util.ArrayList<com.google.android.gms.common.api.Scope> r1 = r3.zaw // Catch: java.lang.ClassCastException -> L85
|
||||
int r1 = r1.size() // Catch: java.lang.ClassCastException -> L85
|
||||
java.util.ArrayList r2 = r4.getScopes() // Catch: java.lang.ClassCastException -> L85
|
||||
int r2 = r2.size() // Catch: java.lang.ClassCastException -> L85
|
||||
if (r1 != r2) goto L85
|
||||
java.util.ArrayList<com.google.android.gms.common.api.Scope> r1 = r3.zaw // Catch: java.lang.ClassCastException -> L85
|
||||
java.util.ArrayList r2 = r4.getScopes() // Catch: java.lang.ClassCastException -> L85
|
||||
boolean r1 = r1.containsAll(r2) // Catch: java.lang.ClassCastException -> L85
|
||||
if (r1 != 0) goto L35
|
||||
goto L85
|
||||
L35:
|
||||
android.accounts.Account r1 = r3.zax // Catch: java.lang.ClassCastException -> L85
|
||||
if (r1 != 0) goto L40
|
||||
android.accounts.Account r1 = r4.getAccount() // Catch: java.lang.ClassCastException -> L85
|
||||
if (r1 != 0) goto L85
|
||||
goto L4c
|
||||
L40:
|
||||
android.accounts.Account r1 = r3.zax // Catch: java.lang.ClassCastException -> L85
|
||||
android.accounts.Account r2 = r4.getAccount() // Catch: java.lang.ClassCastException -> L85
|
||||
boolean r1 = r1.equals(r2) // Catch: java.lang.ClassCastException -> L85
|
||||
if (r1 == 0) goto L85
|
||||
L4c:
|
||||
java.lang.String r1 = r3.zaab // Catch: java.lang.ClassCastException -> L85
|
||||
boolean r1 = android.text.TextUtils.isEmpty(r1) // Catch: java.lang.ClassCastException -> L85
|
||||
if (r1 == 0) goto L5f
|
||||
java.lang.String r1 = r4.getServerClientId() // Catch: java.lang.ClassCastException -> L85
|
||||
boolean r1 = android.text.TextUtils.isEmpty(r1) // Catch: java.lang.ClassCastException -> L85
|
||||
if (r1 == 0) goto L85
|
||||
goto L6b
|
||||
L5f:
|
||||
java.lang.String r1 = r3.zaab // Catch: java.lang.ClassCastException -> L85
|
||||
java.lang.String r2 = r4.getServerClientId() // Catch: java.lang.ClassCastException -> L85
|
||||
boolean r1 = r1.equals(r2) // Catch: java.lang.ClassCastException -> L85
|
||||
if (r1 == 0) goto L85
|
||||
L6b:
|
||||
boolean r1 = r3.zaaa // Catch: java.lang.ClassCastException -> L85
|
||||
boolean r2 = r4.isForceCodeForRefreshToken() // Catch: java.lang.ClassCastException -> L85
|
||||
if (r1 != r2) goto L85
|
||||
boolean r1 = r3.zay // Catch: java.lang.ClassCastException -> L85
|
||||
boolean r2 = r4.isIdTokenRequested() // Catch: java.lang.ClassCastException -> L85
|
||||
if (r1 != r2) goto L85
|
||||
boolean r1 = r3.zaz // Catch: java.lang.ClassCastException -> L85
|
||||
boolean r4 = r4.isServerAuthCodeRequested() // Catch: java.lang.ClassCastException -> L85
|
||||
if (r1 != r4) goto L85
|
||||
r4 = 1
|
||||
return r4
|
||||
L85:
|
||||
return r0
|
||||
*/
|
||||
throw new UnsupportedOperationException("Method not decompiled: com.google.android.gms.auth.api.signin.GoogleSignInOptions.equals(java.lang.Object):boolean");
|
||||
}
|
||||
|
||||
public Account getAccount() {
|
||||
return this.zax;
|
||||
}
|
||||
|
||||
public ArrayList<GoogleSignInOptionsExtensionParcelable> getExtensions() {
|
||||
return this.zaad;
|
||||
}
|
||||
|
||||
public Scope[] getScopeArray() {
|
||||
ArrayList<Scope> arrayList = this.zaw;
|
||||
return (Scope[]) arrayList.toArray(new Scope[arrayList.size()]);
|
||||
}
|
||||
|
||||
public ArrayList<Scope> getScopes() {
|
||||
return new ArrayList<>(this.zaw);
|
||||
}
|
||||
|
||||
public String getServerClientId() {
|
||||
return this.zaab;
|
||||
}
|
||||
|
||||
public int hashCode() {
|
||||
ArrayList arrayList = new ArrayList();
|
||||
ArrayList<Scope> arrayList2 = this.zaw;
|
||||
int size = arrayList2.size();
|
||||
int i = 0;
|
||||
while (i < size) {
|
||||
Scope scope = arrayList2.get(i);
|
||||
i++;
|
||||
arrayList.add(scope.getScopeUri());
|
||||
}
|
||||
Collections.sort(arrayList);
|
||||
HashAccumulator hashAccumulator = new HashAccumulator();
|
||||
hashAccumulator.a(arrayList);
|
||||
hashAccumulator.a(this.zax);
|
||||
hashAccumulator.a(this.zaab);
|
||||
hashAccumulator.a(this.zaaa);
|
||||
hashAccumulator.a(this.zay);
|
||||
hashAccumulator.a(this.zaz);
|
||||
return hashAccumulator.a();
|
||||
}
|
||||
|
||||
public boolean isForceCodeForRefreshToken() {
|
||||
return this.zaaa;
|
||||
}
|
||||
|
||||
public boolean isIdTokenRequested() {
|
||||
return this.zay;
|
||||
}
|
||||
|
||||
public boolean isServerAuthCodeRequested() {
|
||||
return this.zaz;
|
||||
}
|
||||
|
||||
@Override // android.os.Parcelable
|
||||
public void writeToParcel(Parcel parcel, int i) {
|
||||
int a = SafeParcelWriter.a(parcel);
|
||||
SafeParcelWriter.a(parcel, 1, this.versionCode);
|
||||
SafeParcelWriter.c(parcel, 2, getScopes(), false);
|
||||
SafeParcelWriter.a(parcel, 3, (Parcelable) getAccount(), i, false);
|
||||
SafeParcelWriter.a(parcel, 4, isIdTokenRequested());
|
||||
SafeParcelWriter.a(parcel, 5, isServerAuthCodeRequested());
|
||||
SafeParcelWriter.a(parcel, 6, isForceCodeForRefreshToken());
|
||||
SafeParcelWriter.a(parcel, 7, getServerClientId(), false);
|
||||
SafeParcelWriter.a(parcel, 8, this.zaac, false);
|
||||
SafeParcelWriter.c(parcel, 9, getExtensions(), false);
|
||||
SafeParcelWriter.a(parcel, a);
|
||||
}
|
||||
|
||||
public final String zae() {
|
||||
return zad().toString();
|
||||
}
|
||||
|
||||
public static final class Builder {
|
||||
private boolean b;
|
||||
private boolean c;
|
||||
private boolean d;
|
||||
private String e;
|
||||
private Account f;
|
||||
private String g;
|
||||
private Set<Scope> a = new HashSet();
|
||||
private Map<Integer, GoogleSignInOptionsExtensionParcelable> h = new HashMap();
|
||||
|
||||
public final Builder a(Scope scope, Scope... scopeArr) {
|
||||
this.a.add(scope);
|
||||
this.a.addAll(Arrays.asList(scopeArr));
|
||||
return this;
|
||||
}
|
||||
|
||||
public final Builder b() {
|
||||
this.a.add(GoogleSignInOptions.zat);
|
||||
return this;
|
||||
}
|
||||
|
||||
public final Builder c() {
|
||||
this.a.add(GoogleSignInOptions.zar);
|
||||
return this;
|
||||
}
|
||||
|
||||
public final GoogleSignInOptions a() {
|
||||
if (this.a.contains(GoogleSignInOptions.zav) && this.a.contains(GoogleSignInOptions.zau)) {
|
||||
this.a.remove(GoogleSignInOptions.zau);
|
||||
}
|
||||
if (this.d && (this.f == null || !this.a.isEmpty())) {
|
||||
b();
|
||||
}
|
||||
return new GoogleSignInOptions(3, new ArrayList(this.a), this.f, this.d, this.b, this.c, this.e, this.g, this.h, null);
|
||||
}
|
||||
}
|
||||
|
||||
private GoogleSignInOptions(int i, ArrayList<Scope> arrayList, Account account, boolean z, boolean z2, boolean z3, String str, String str2, Map<Integer, GoogleSignInOptionsExtensionParcelable> map) {
|
||||
this.versionCode = i;
|
||||
this.zaw = arrayList;
|
||||
this.zax = account;
|
||||
this.zay = z;
|
||||
this.zaz = z2;
|
||||
this.zaaa = z3;
|
||||
this.zaab = str;
|
||||
this.zaac = str2;
|
||||
this.zaad = new ArrayList<>(map.values());
|
||||
this.zaae = map;
|
||||
}
|
||||
|
||||
/* synthetic */ GoogleSignInOptions(int i, ArrayList arrayList, Account account, boolean z, boolean z2, boolean z3, String str, String str2, Map map, zac zacVar) {
|
||||
this(3, (ArrayList<Scope>) arrayList, account, z, z2, z3, str, str2, (Map<Integer, GoogleSignInOptionsExtensionParcelable>) map);
|
||||
}
|
||||
}
|
@@ -0,0 +1,10 @@
|
||||
package com.google.android.gms.auth.api.signin;
|
||||
|
||||
import android.os.Bundle;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public interface GoogleSignInOptionsExtension {
|
||||
int a();
|
||||
|
||||
Bundle b();
|
||||
}
|
@@ -0,0 +1,39 @@
|
||||
package com.google.android.gms.auth.api.signin.internal;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
import com.google.android.gms.auth.api.signin.GoogleSignInOptionsExtension;
|
||||
import com.google.android.gms.common.internal.safeparcel.AbstractSafeParcelable;
|
||||
import com.google.android.gms.common.internal.safeparcel.SafeParcelWriter;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class GoogleSignInOptionsExtensionParcelable extends AbstractSafeParcelable {
|
||||
public static final Parcelable.Creator<GoogleSignInOptionsExtensionParcelable> CREATOR = new zaa();
|
||||
private Bundle mBundle;
|
||||
private int mType;
|
||||
private final int versionCode;
|
||||
|
||||
GoogleSignInOptionsExtensionParcelable(int i, int i2, Bundle bundle) {
|
||||
this.versionCode = i;
|
||||
this.mType = i2;
|
||||
this.mBundle = bundle;
|
||||
}
|
||||
|
||||
public int getType() {
|
||||
return this.mType;
|
||||
}
|
||||
|
||||
@Override // android.os.Parcelable
|
||||
public void writeToParcel(Parcel parcel, int i) {
|
||||
int a = SafeParcelWriter.a(parcel);
|
||||
SafeParcelWriter.a(parcel, 1, this.versionCode);
|
||||
SafeParcelWriter.a(parcel, 2, getType());
|
||||
SafeParcelWriter.a(parcel, 3, this.mBundle, false);
|
||||
SafeParcelWriter.a(parcel, a);
|
||||
}
|
||||
|
||||
public GoogleSignInOptionsExtensionParcelable(GoogleSignInOptionsExtension googleSignInOptionsExtension) {
|
||||
this(1, googleSignInOptionsExtension.a(), googleSignInOptionsExtension.b());
|
||||
}
|
||||
}
|
@@ -0,0 +1,21 @@
|
||||
package com.google.android.gms.auth.api.signin.internal;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class HashAccumulator {
|
||||
private static int b = 31;
|
||||
private int a = 1;
|
||||
|
||||
public HashAccumulator a(Object obj) {
|
||||
this.a = (b * this.a) + (obj == null ? 0 : obj.hashCode());
|
||||
return this;
|
||||
}
|
||||
|
||||
public final HashAccumulator a(boolean z) {
|
||||
this.a = (b * this.a) + (z ? 1 : 0);
|
||||
return this;
|
||||
}
|
||||
|
||||
public int a() {
|
||||
return this.a;
|
||||
}
|
||||
}
|
@@ -0,0 +1,67 @@
|
||||
package com.google.android.gms.auth.api.signin.internal;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
import android.text.TextUtils;
|
||||
import com.google.android.gms.auth.api.signin.GoogleSignInAccount;
|
||||
import com.google.android.gms.common.internal.Preconditions;
|
||||
import java.util.concurrent.locks.Lock;
|
||||
import java.util.concurrent.locks.ReentrantLock;
|
||||
import org.json.JSONException;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class Storage {
|
||||
private static final Lock c = new ReentrantLock();
|
||||
private static Storage d;
|
||||
private final Lock a = new ReentrantLock();
|
||||
private final SharedPreferences b;
|
||||
|
||||
private Storage(Context context) {
|
||||
this.b = context.getSharedPreferences("com.google.android.gms.signin", 0);
|
||||
}
|
||||
|
||||
public static Storage a(Context context) {
|
||||
Preconditions.a(context);
|
||||
c.lock();
|
||||
try {
|
||||
if (d == null) {
|
||||
d = new Storage(context.getApplicationContext());
|
||||
}
|
||||
return d;
|
||||
} finally {
|
||||
c.unlock();
|
||||
}
|
||||
}
|
||||
|
||||
private final String b(String str) {
|
||||
this.a.lock();
|
||||
try {
|
||||
return this.b.getString(str, null);
|
||||
} finally {
|
||||
this.a.unlock();
|
||||
}
|
||||
}
|
||||
|
||||
public GoogleSignInAccount a() {
|
||||
return a(b("defaultGoogleSignInAccount"));
|
||||
}
|
||||
|
||||
private final GoogleSignInAccount a(String str) {
|
||||
String b;
|
||||
if (!TextUtils.isEmpty(str) && (b = b(a("googleSignInAccount", str))) != null) {
|
||||
try {
|
||||
return GoogleSignInAccount.zaa(b);
|
||||
} catch (JSONException unused) {
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private static String a(String str, String str2) {
|
||||
StringBuilder sb = new StringBuilder(String.valueOf(str).length() + 1 + String.valueOf(str2).length());
|
||||
sb.append(str);
|
||||
sb.append(":");
|
||||
sb.append(str2);
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
@@ -0,0 +1,37 @@
|
||||
package com.google.android.gms.auth.api.signin.internal;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
import com.google.android.gms.common.internal.safeparcel.SafeParcelReader;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class zaa implements Parcelable.Creator<GoogleSignInOptionsExtensionParcelable> {
|
||||
@Override // android.os.Parcelable.Creator
|
||||
public final /* synthetic */ GoogleSignInOptionsExtensionParcelable createFromParcel(Parcel parcel) {
|
||||
int b = SafeParcelReader.b(parcel);
|
||||
int i = 0;
|
||||
Bundle bundle = null;
|
||||
int i2 = 0;
|
||||
while (parcel.dataPosition() < b) {
|
||||
int a = SafeParcelReader.a(parcel);
|
||||
int a2 = SafeParcelReader.a(a);
|
||||
if (a2 == 1) {
|
||||
i = SafeParcelReader.x(parcel, a);
|
||||
} else if (a2 == 2) {
|
||||
i2 = SafeParcelReader.x(parcel, a);
|
||||
} else if (a2 != 3) {
|
||||
SafeParcelReader.C(parcel, a);
|
||||
} else {
|
||||
bundle = SafeParcelReader.f(parcel, a);
|
||||
}
|
||||
}
|
||||
SafeParcelReader.q(parcel, b);
|
||||
return new GoogleSignInOptionsExtensionParcelable(i, i2, bundle);
|
||||
}
|
||||
|
||||
@Override // android.os.Parcelable.Creator
|
||||
public final /* synthetic */ GoogleSignInOptionsExtensionParcelable[] newArray(int i) {
|
||||
return new GoogleSignInOptionsExtensionParcelable[i];
|
||||
}
|
||||
}
|
19
sources/com/google/android/gms/auth/api/signin/zaa.java
Normal file
19
sources/com/google/android/gms/auth/api/signin/zaa.java
Normal file
@@ -0,0 +1,19 @@
|
||||
package com.google.android.gms.auth.api.signin;
|
||||
|
||||
import com.google.android.gms.common.api.Scope;
|
||||
import java.util.Comparator;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
final /* synthetic */ class zaa implements Comparator {
|
||||
static final Comparator a = new zaa();
|
||||
|
||||
private zaa() {
|
||||
}
|
||||
|
||||
@Override // java.util.Comparator
|
||||
public final int compare(Object obj, Object obj2) {
|
||||
int compareTo;
|
||||
compareTo = ((Scope) obj).getScopeUri().compareTo(((Scope) obj2).getScopeUri());
|
||||
return compareTo;
|
||||
}
|
||||
}
|
79
sources/com/google/android/gms/auth/api/signin/zab.java
Normal file
79
sources/com/google/android/gms/auth/api/signin/zab.java
Normal file
@@ -0,0 +1,79 @@
|
||||
package com.google.android.gms.auth.api.signin;
|
||||
|
||||
import android.net.Uri;
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
import com.google.android.gms.common.api.Scope;
|
||||
import com.google.android.gms.common.internal.safeparcel.SafeParcelReader;
|
||||
import java.util.ArrayList;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class zab implements Parcelable.Creator<GoogleSignInAccount> {
|
||||
@Override // android.os.Parcelable.Creator
|
||||
public final /* synthetic */ GoogleSignInAccount createFromParcel(Parcel parcel) {
|
||||
int b = SafeParcelReader.b(parcel);
|
||||
String str = null;
|
||||
String str2 = null;
|
||||
String str3 = null;
|
||||
String str4 = null;
|
||||
Uri uri = null;
|
||||
String str5 = null;
|
||||
String str6 = null;
|
||||
ArrayList arrayList = null;
|
||||
String str7 = null;
|
||||
String str8 = null;
|
||||
long j = 0;
|
||||
int i = 0;
|
||||
while (parcel.dataPosition() < b) {
|
||||
int a = SafeParcelReader.a(parcel);
|
||||
switch (SafeParcelReader.a(a)) {
|
||||
case 1:
|
||||
i = SafeParcelReader.x(parcel, a);
|
||||
break;
|
||||
case 2:
|
||||
str = SafeParcelReader.n(parcel, a);
|
||||
break;
|
||||
case 3:
|
||||
str2 = SafeParcelReader.n(parcel, a);
|
||||
break;
|
||||
case 4:
|
||||
str3 = SafeParcelReader.n(parcel, a);
|
||||
break;
|
||||
case 5:
|
||||
str4 = SafeParcelReader.n(parcel, a);
|
||||
break;
|
||||
case 6:
|
||||
uri = (Uri) SafeParcelReader.a(parcel, a, Uri.CREATOR);
|
||||
break;
|
||||
case 7:
|
||||
str5 = SafeParcelReader.n(parcel, a);
|
||||
break;
|
||||
case 8:
|
||||
j = SafeParcelReader.z(parcel, a);
|
||||
break;
|
||||
case 9:
|
||||
str6 = SafeParcelReader.n(parcel, a);
|
||||
break;
|
||||
case 10:
|
||||
arrayList = SafeParcelReader.c(parcel, a, Scope.CREATOR);
|
||||
break;
|
||||
case 11:
|
||||
str7 = SafeParcelReader.n(parcel, a);
|
||||
break;
|
||||
case 12:
|
||||
str8 = SafeParcelReader.n(parcel, a);
|
||||
break;
|
||||
default:
|
||||
SafeParcelReader.C(parcel, a);
|
||||
break;
|
||||
}
|
||||
}
|
||||
SafeParcelReader.q(parcel, b);
|
||||
return new GoogleSignInAccount(i, str, str2, str3, str4, uri, str5, j, str6, arrayList, str7, str8);
|
||||
}
|
||||
|
||||
@Override // android.os.Parcelable.Creator
|
||||
public final /* synthetic */ GoogleSignInAccount[] newArray(int i) {
|
||||
return new GoogleSignInAccount[i];
|
||||
}
|
||||
}
|
15
sources/com/google/android/gms/auth/api/signin/zac.java
Normal file
15
sources/com/google/android/gms/auth/api/signin/zac.java
Normal file
@@ -0,0 +1,15 @@
|
||||
package com.google.android.gms.auth.api.signin;
|
||||
|
||||
import com.google.android.gms.common.api.Scope;
|
||||
import java.util.Comparator;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
final class zac implements Comparator<Scope> {
|
||||
zac() {
|
||||
}
|
||||
|
||||
@Override // java.util.Comparator
|
||||
public final /* synthetic */ int compare(Scope scope, Scope scope2) {
|
||||
return scope.getScopeUri().compareTo(scope2.getScopeUri());
|
||||
}
|
||||
}
|
68
sources/com/google/android/gms/auth/api/signin/zad.java
Normal file
68
sources/com/google/android/gms/auth/api/signin/zad.java
Normal file
@@ -0,0 +1,68 @@
|
||||
package com.google.android.gms.auth.api.signin;
|
||||
|
||||
import android.accounts.Account;
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
import com.google.android.gms.auth.api.signin.internal.GoogleSignInOptionsExtensionParcelable;
|
||||
import com.google.android.gms.common.api.Scope;
|
||||
import com.google.android.gms.common.internal.safeparcel.SafeParcelReader;
|
||||
import java.util.ArrayList;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class zad implements Parcelable.Creator<GoogleSignInOptions> {
|
||||
@Override // android.os.Parcelable.Creator
|
||||
public final /* synthetic */ GoogleSignInOptions createFromParcel(Parcel parcel) {
|
||||
int b = SafeParcelReader.b(parcel);
|
||||
ArrayList arrayList = null;
|
||||
Account account = null;
|
||||
String str = null;
|
||||
String str2 = null;
|
||||
ArrayList arrayList2 = null;
|
||||
int i = 0;
|
||||
boolean z = false;
|
||||
boolean z2 = false;
|
||||
boolean z3 = false;
|
||||
while (parcel.dataPosition() < b) {
|
||||
int a = SafeParcelReader.a(parcel);
|
||||
switch (SafeParcelReader.a(a)) {
|
||||
case 1:
|
||||
i = SafeParcelReader.x(parcel, a);
|
||||
break;
|
||||
case 2:
|
||||
arrayList = SafeParcelReader.c(parcel, a, Scope.CREATOR);
|
||||
break;
|
||||
case 3:
|
||||
account = (Account) SafeParcelReader.a(parcel, a, Account.CREATOR);
|
||||
break;
|
||||
case 4:
|
||||
z = SafeParcelReader.r(parcel, a);
|
||||
break;
|
||||
case 5:
|
||||
z2 = SafeParcelReader.r(parcel, a);
|
||||
break;
|
||||
case 6:
|
||||
z3 = SafeParcelReader.r(parcel, a);
|
||||
break;
|
||||
case 7:
|
||||
str = SafeParcelReader.n(parcel, a);
|
||||
break;
|
||||
case 8:
|
||||
str2 = SafeParcelReader.n(parcel, a);
|
||||
break;
|
||||
case 9:
|
||||
arrayList2 = SafeParcelReader.c(parcel, a, GoogleSignInOptionsExtensionParcelable.CREATOR);
|
||||
break;
|
||||
default:
|
||||
SafeParcelReader.C(parcel, a);
|
||||
break;
|
||||
}
|
||||
}
|
||||
SafeParcelReader.q(parcel, b);
|
||||
return new GoogleSignInOptions(i, (ArrayList<Scope>) arrayList, account, z, z2, z3, str, str2, (ArrayList<GoogleSignInOptionsExtensionParcelable>) arrayList2);
|
||||
}
|
||||
|
||||
@Override // android.os.Parcelable.Creator
|
||||
public final /* synthetic */ GoogleSignInOptions[] newArray(int i) {
|
||||
return new GoogleSignInOptions[i];
|
||||
}
|
||||
}
|
26
sources/com/google/android/gms/base/R$drawable.java
Normal file
26
sources/com/google/android/gms/base/R$drawable.java
Normal file
@@ -0,0 +1,26 @@
|
||||
package com.google.android.gms.base;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class R$drawable {
|
||||
public static final int common_full_open_on_phone = 2131230976;
|
||||
public static final int common_google_signin_btn_icon_dark = 2131230977;
|
||||
public static final int common_google_signin_btn_icon_dark_focused = 2131230978;
|
||||
public static final int common_google_signin_btn_icon_dark_normal = 2131230979;
|
||||
public static final int common_google_signin_btn_icon_dark_normal_background = 2131230980;
|
||||
public static final int common_google_signin_btn_icon_disabled = 2131230981;
|
||||
public static final int common_google_signin_btn_icon_light = 2131230982;
|
||||
public static final int common_google_signin_btn_icon_light_focused = 2131230983;
|
||||
public static final int common_google_signin_btn_icon_light_normal = 2131230984;
|
||||
public static final int common_google_signin_btn_icon_light_normal_background = 2131230985;
|
||||
public static final int common_google_signin_btn_text_dark = 2131230986;
|
||||
public static final int common_google_signin_btn_text_dark_focused = 2131230987;
|
||||
public static final int common_google_signin_btn_text_dark_normal = 2131230988;
|
||||
public static final int common_google_signin_btn_text_dark_normal_background = 2131230989;
|
||||
public static final int common_google_signin_btn_text_disabled = 2131230990;
|
||||
public static final int common_google_signin_btn_text_light = 2131230991;
|
||||
public static final int common_google_signin_btn_text_light_focused = 2131230992;
|
||||
public static final int common_google_signin_btn_text_light_normal = 2131230993;
|
||||
public static final int common_google_signin_btn_text_light_normal_background = 2131230994;
|
||||
public static final int googleg_disabled_color_18 = 2131231200;
|
||||
public static final int googleg_standard_color_18 = 2131231201;
|
||||
}
|
22
sources/com/google/android/gms/base/R$string.java
Normal file
22
sources/com/google/android/gms/base/R$string.java
Normal file
@@ -0,0 +1,22 @@
|
||||
package com.google.android.gms.base;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class R$string {
|
||||
public static final int common_google_play_services_enable_button = 2131820814;
|
||||
public static final int common_google_play_services_enable_text = 2131820815;
|
||||
public static final int common_google_play_services_enable_title = 2131820816;
|
||||
public static final int common_google_play_services_install_button = 2131820817;
|
||||
public static final int common_google_play_services_install_text = 2131820818;
|
||||
public static final int common_google_play_services_install_title = 2131820819;
|
||||
public static final int common_google_play_services_notification_channel_name = 2131820820;
|
||||
public static final int common_google_play_services_notification_ticker = 2131820821;
|
||||
public static final int common_google_play_services_unsupported_text = 2131820823;
|
||||
public static final int common_google_play_services_update_button = 2131820824;
|
||||
public static final int common_google_play_services_update_text = 2131820825;
|
||||
public static final int common_google_play_services_update_title = 2131820826;
|
||||
public static final int common_google_play_services_updating_text = 2131820827;
|
||||
public static final int common_google_play_services_wear_update_text = 2131820828;
|
||||
public static final int common_open_on_phone = 2131820829;
|
||||
public static final int common_signin_button_text = 2131820830;
|
||||
public static final int common_signin_button_text_long = 2131820831;
|
||||
}
|
@@ -0,0 +1,38 @@
|
||||
package com.google.android.gms.common;
|
||||
|
||||
import android.content.ComponentName;
|
||||
import android.content.ServiceConnection;
|
||||
import android.os.IBinder;
|
||||
import com.google.android.gms.common.internal.Preconditions;
|
||||
import java.util.concurrent.BlockingQueue;
|
||||
import java.util.concurrent.LinkedBlockingQueue;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.concurrent.TimeoutException;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class BlockingServiceConnection implements ServiceConnection {
|
||||
private boolean a = false;
|
||||
private final BlockingQueue<IBinder> b = new LinkedBlockingQueue();
|
||||
|
||||
public IBinder a(long j, TimeUnit timeUnit) throws InterruptedException, TimeoutException {
|
||||
Preconditions.c("BlockingServiceConnection.getServiceWithTimeout() called on main thread");
|
||||
if (this.a) {
|
||||
throw new IllegalStateException("Cannot call get on this connection more than once");
|
||||
}
|
||||
this.a = true;
|
||||
IBinder poll = this.b.poll(j, timeUnit);
|
||||
if (poll != null) {
|
||||
return poll;
|
||||
}
|
||||
throw new TimeoutException("Timed out waiting for the service connection");
|
||||
}
|
||||
|
||||
@Override // android.content.ServiceConnection
|
||||
public void onServiceConnected(ComponentName componentName, IBinder iBinder) {
|
||||
this.b.add(iBinder);
|
||||
}
|
||||
|
||||
@Override // android.content.ServiceConnection
|
||||
public void onServiceDisconnected(ComponentName componentName) {
|
||||
}
|
||||
}
|
186
sources/com/google/android/gms/common/ConnectionResult.java
Normal file
186
sources/com/google/android/gms/common/ConnectionResult.java
Normal file
@@ -0,0 +1,186 @@
|
||||
package com.google.android.gms.common;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.PendingIntent;
|
||||
import android.content.IntentSender;
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
import com.google.android.gms.common.internal.Objects;
|
||||
import com.google.android.gms.common.internal.safeparcel.AbstractSafeParcelable;
|
||||
import com.google.android.gms.common.internal.safeparcel.SafeParcelWriter;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class ConnectionResult extends AbstractSafeParcelable {
|
||||
public static final int API_UNAVAILABLE = 16;
|
||||
public static final int CANCELED = 13;
|
||||
public static final int DEVELOPER_ERROR = 10;
|
||||
|
||||
@Deprecated
|
||||
public static final int DRIVE_EXTERNAL_STORAGE_REQUIRED = 1500;
|
||||
public static final int INTERNAL_ERROR = 8;
|
||||
public static final int INTERRUPTED = 15;
|
||||
public static final int INVALID_ACCOUNT = 5;
|
||||
public static final int LICENSE_CHECK_FAILED = 11;
|
||||
public static final int NETWORK_ERROR = 7;
|
||||
public static final int RESOLUTION_REQUIRED = 6;
|
||||
public static final int RESTRICTED_PROFILE = 20;
|
||||
public static final int SERVICE_DISABLED = 3;
|
||||
public static final int SERVICE_INVALID = 9;
|
||||
public static final int SERVICE_MISSING = 1;
|
||||
public static final int SERVICE_MISSING_PERMISSION = 19;
|
||||
public static final int SERVICE_UPDATING = 18;
|
||||
public static final int SERVICE_VERSION_UPDATE_REQUIRED = 2;
|
||||
public static final int SIGN_IN_FAILED = 17;
|
||||
public static final int SIGN_IN_REQUIRED = 4;
|
||||
public static final int SUCCESS = 0;
|
||||
public static final int TIMEOUT = 14;
|
||||
public static final int UNKNOWN = -1;
|
||||
private final int zzg;
|
||||
private final int zzh;
|
||||
private final PendingIntent zzi;
|
||||
private final String zzj;
|
||||
public static final ConnectionResult RESULT_SUCCESS = new ConnectionResult(0);
|
||||
public static final Parcelable.Creator<ConnectionResult> CREATOR = new zza();
|
||||
|
||||
ConnectionResult(int i, int i2, PendingIntent pendingIntent, String str) {
|
||||
this.zzg = i;
|
||||
this.zzh = i2;
|
||||
this.zzi = pendingIntent;
|
||||
this.zzj = str;
|
||||
}
|
||||
|
||||
static String zza(int i) {
|
||||
if (i == 99) {
|
||||
return "UNFINISHED";
|
||||
}
|
||||
if (i == 1500) {
|
||||
return "DRIVE_EXTERNAL_STORAGE_REQUIRED";
|
||||
}
|
||||
switch (i) {
|
||||
case -1:
|
||||
return "UNKNOWN";
|
||||
case 0:
|
||||
return "SUCCESS";
|
||||
case 1:
|
||||
return "SERVICE_MISSING";
|
||||
case 2:
|
||||
return "SERVICE_VERSION_UPDATE_REQUIRED";
|
||||
case 3:
|
||||
return "SERVICE_DISABLED";
|
||||
case 4:
|
||||
return "SIGN_IN_REQUIRED";
|
||||
case 5:
|
||||
return "INVALID_ACCOUNT";
|
||||
case 6:
|
||||
return "RESOLUTION_REQUIRED";
|
||||
case 7:
|
||||
return "NETWORK_ERROR";
|
||||
case 8:
|
||||
return "INTERNAL_ERROR";
|
||||
case 9:
|
||||
return "SERVICE_INVALID";
|
||||
case 10:
|
||||
return "DEVELOPER_ERROR";
|
||||
case 11:
|
||||
return "LICENSE_CHECK_FAILED";
|
||||
default:
|
||||
switch (i) {
|
||||
case 13:
|
||||
return "CANCELED";
|
||||
case 14:
|
||||
return "TIMEOUT";
|
||||
case 15:
|
||||
return "INTERRUPTED";
|
||||
case 16:
|
||||
return "API_UNAVAILABLE";
|
||||
case 17:
|
||||
return "SIGN_IN_FAILED";
|
||||
case 18:
|
||||
return "SERVICE_UPDATING";
|
||||
case 19:
|
||||
return "SERVICE_MISSING_PERMISSION";
|
||||
case 20:
|
||||
return "RESTRICTED_PROFILE";
|
||||
case 21:
|
||||
return "API_VERSION_UPDATE_REQUIRED";
|
||||
default:
|
||||
StringBuilder sb = new StringBuilder(31);
|
||||
sb.append("UNKNOWN_ERROR_CODE(");
|
||||
sb.append(i);
|
||||
sb.append(")");
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public final boolean equals(Object obj) {
|
||||
if (obj == this) {
|
||||
return true;
|
||||
}
|
||||
if (!(obj instanceof ConnectionResult)) {
|
||||
return false;
|
||||
}
|
||||
ConnectionResult connectionResult = (ConnectionResult) obj;
|
||||
return this.zzh == connectionResult.zzh && Objects.a(this.zzi, connectionResult.zzi) && Objects.a(this.zzj, connectionResult.zzj);
|
||||
}
|
||||
|
||||
public final int getErrorCode() {
|
||||
return this.zzh;
|
||||
}
|
||||
|
||||
public final String getErrorMessage() {
|
||||
return this.zzj;
|
||||
}
|
||||
|
||||
public final PendingIntent getResolution() {
|
||||
return this.zzi;
|
||||
}
|
||||
|
||||
public final boolean hasResolution() {
|
||||
return (this.zzh == 0 || this.zzi == null) ? false : true;
|
||||
}
|
||||
|
||||
public final int hashCode() {
|
||||
return Objects.a(Integer.valueOf(this.zzh), this.zzi, this.zzj);
|
||||
}
|
||||
|
||||
public final boolean isSuccess() {
|
||||
return this.zzh == 0;
|
||||
}
|
||||
|
||||
public final void startResolutionForResult(Activity activity, int i) throws IntentSender.SendIntentException {
|
||||
if (hasResolution()) {
|
||||
activity.startIntentSenderForResult(this.zzi.getIntentSender(), i, null, 0, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
public final String toString() {
|
||||
Objects.ToStringHelper a = Objects.a(this);
|
||||
a.a("statusCode", zza(this.zzh));
|
||||
a.a("resolution", this.zzi);
|
||||
a.a("message", this.zzj);
|
||||
return a.toString();
|
||||
}
|
||||
|
||||
@Override // android.os.Parcelable
|
||||
public final void writeToParcel(Parcel parcel, int i) {
|
||||
int a = SafeParcelWriter.a(parcel);
|
||||
SafeParcelWriter.a(parcel, 1, this.zzg);
|
||||
SafeParcelWriter.a(parcel, 2, getErrorCode());
|
||||
SafeParcelWriter.a(parcel, 3, (Parcelable) getResolution(), i, false);
|
||||
SafeParcelWriter.a(parcel, 4, getErrorMessage(), false);
|
||||
SafeParcelWriter.a(parcel, a);
|
||||
}
|
||||
|
||||
public ConnectionResult(int i) {
|
||||
this(i, null, null);
|
||||
}
|
||||
|
||||
public ConnectionResult(int i, PendingIntent pendingIntent) {
|
||||
this(i, pendingIntent, null);
|
||||
}
|
||||
|
||||
public ConnectionResult(int i, PendingIntent pendingIntent, String str) {
|
||||
this(1, i, pendingIntent, str);
|
||||
}
|
||||
}
|
@@ -0,0 +1,48 @@
|
||||
package com.google.android.gms.common;
|
||||
|
||||
import android.app.Dialog;
|
||||
import android.app.DialogFragment;
|
||||
import android.app.FragmentManager;
|
||||
import android.content.DialogInterface;
|
||||
import android.os.Bundle;
|
||||
import com.google.android.gms.common.internal.Preconditions;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class ErrorDialogFragment extends DialogFragment {
|
||||
private Dialog a = null;
|
||||
private DialogInterface.OnCancelListener b = null;
|
||||
|
||||
public static ErrorDialogFragment a(Dialog dialog, DialogInterface.OnCancelListener onCancelListener) {
|
||||
ErrorDialogFragment errorDialogFragment = new ErrorDialogFragment();
|
||||
Preconditions.a(dialog, "Cannot display null dialog");
|
||||
Dialog dialog2 = dialog;
|
||||
dialog2.setOnCancelListener(null);
|
||||
dialog2.setOnDismissListener(null);
|
||||
errorDialogFragment.a = dialog2;
|
||||
if (onCancelListener != null) {
|
||||
errorDialogFragment.b = onCancelListener;
|
||||
}
|
||||
return errorDialogFragment;
|
||||
}
|
||||
|
||||
@Override // android.app.DialogFragment, android.content.DialogInterface.OnCancelListener
|
||||
public void onCancel(DialogInterface dialogInterface) {
|
||||
DialogInterface.OnCancelListener onCancelListener = this.b;
|
||||
if (onCancelListener != null) {
|
||||
onCancelListener.onCancel(dialogInterface);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.app.DialogFragment
|
||||
public Dialog onCreateDialog(Bundle bundle) {
|
||||
if (this.a == null) {
|
||||
setShowsDialog(false);
|
||||
}
|
||||
return this.a;
|
||||
}
|
||||
|
||||
@Override // android.app.DialogFragment
|
||||
public void show(FragmentManager fragmentManager, String str) {
|
||||
super.show(fragmentManager, str);
|
||||
}
|
||||
}
|
69
sources/com/google/android/gms/common/Feature.java
Normal file
69
sources/com/google/android/gms/common/Feature.java
Normal file
@@ -0,0 +1,69 @@
|
||||
package com.google.android.gms.common;
|
||||
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
import com.google.android.gms.common.internal.Objects;
|
||||
import com.google.android.gms.common.internal.safeparcel.AbstractSafeParcelable;
|
||||
import com.google.android.gms.common.internal.safeparcel.SafeParcelWriter;
|
||||
import com.unity3d.ads.metadata.MediationMetaData;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class Feature extends AbstractSafeParcelable {
|
||||
public static final Parcelable.Creator<Feature> CREATOR = new zzb();
|
||||
private final String name;
|
||||
|
||||
@Deprecated
|
||||
private final int zzk;
|
||||
private final long zzl;
|
||||
|
||||
public Feature(String str, long j) {
|
||||
this.name = str;
|
||||
this.zzl = j;
|
||||
this.zzk = -1;
|
||||
}
|
||||
|
||||
public boolean equals(Object obj) {
|
||||
if (obj instanceof Feature) {
|
||||
Feature feature = (Feature) obj;
|
||||
if (((getName() != null && getName().equals(feature.getName())) || (getName() == null && feature.getName() == null)) && getVersion() == feature.getVersion()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return this.name;
|
||||
}
|
||||
|
||||
public long getVersion() {
|
||||
long j = this.zzl;
|
||||
return j == -1 ? this.zzk : j;
|
||||
}
|
||||
|
||||
public int hashCode() {
|
||||
return Objects.a(getName(), Long.valueOf(getVersion()));
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
Objects.ToStringHelper a = Objects.a(this);
|
||||
a.a(MediationMetaData.KEY_NAME, getName());
|
||||
a.a(MediationMetaData.KEY_VERSION, Long.valueOf(getVersion()));
|
||||
return a.toString();
|
||||
}
|
||||
|
||||
@Override // android.os.Parcelable
|
||||
public void writeToParcel(Parcel parcel, int i) {
|
||||
int a = SafeParcelWriter.a(parcel);
|
||||
SafeParcelWriter.a(parcel, 1, getName(), false);
|
||||
SafeParcelWriter.a(parcel, 2, this.zzk);
|
||||
SafeParcelWriter.a(parcel, 3, getVersion());
|
||||
SafeParcelWriter.a(parcel, a);
|
||||
}
|
||||
|
||||
public Feature(String str, int i, long j) {
|
||||
this.name = str;
|
||||
this.zzk = i;
|
||||
this.zzl = j;
|
||||
}
|
||||
}
|
245
sources/com/google/android/gms/common/GoogleApiAvailability.java
Normal file
245
sources/com/google/android/gms/common/GoogleApiAvailability.java
Normal file
@@ -0,0 +1,245 @@
|
||||
package com.google.android.gms.common;
|
||||
|
||||
import android.R;
|
||||
import android.annotation.SuppressLint;
|
||||
import android.annotation.TargetApi;
|
||||
import android.app.Activity;
|
||||
import android.app.AlertDialog;
|
||||
import android.app.Dialog;
|
||||
import android.app.Notification;
|
||||
import android.app.NotificationChannel;
|
||||
import android.app.NotificationManager;
|
||||
import android.app.PendingIntent;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
import android.content.res.Resources;
|
||||
import android.os.Looper;
|
||||
import android.os.Message;
|
||||
import android.util.Log;
|
||||
import android.util.TypedValue;
|
||||
import androidx.core.app.NotificationCompat;
|
||||
import androidx.fragment.app.FragmentActivity;
|
||||
import com.google.android.gms.base.R$drawable;
|
||||
import com.google.android.gms.common.api.GoogleApiActivity;
|
||||
import com.google.android.gms.common.internal.ConnectionErrorMessages;
|
||||
import com.google.android.gms.common.internal.DialogRedirect;
|
||||
import com.google.android.gms.common.internal.Preconditions;
|
||||
import com.google.android.gms.common.util.DeviceProperties;
|
||||
import com.google.android.gms.common.util.PlatformVersion;
|
||||
import com.google.android.gms.internal.base.zal;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class GoogleApiAvailability extends GoogleApiAvailabilityLight {
|
||||
private static final Object d = new Object();
|
||||
private static final GoogleApiAvailability e = new GoogleApiAvailability();
|
||||
private String c;
|
||||
|
||||
@SuppressLint({"HandlerLeak"})
|
||||
private class zaa extends zal {
|
||||
private final Context a;
|
||||
|
||||
public zaa(Context context) {
|
||||
super(Looper.myLooper() == null ? Looper.getMainLooper() : Looper.myLooper());
|
||||
this.a = context.getApplicationContext();
|
||||
}
|
||||
|
||||
@Override // android.os.Handler
|
||||
public final void handleMessage(Message message) {
|
||||
int i = message.what;
|
||||
if (i != 1) {
|
||||
StringBuilder sb = new StringBuilder(50);
|
||||
sb.append("Don't know how to handle this message: ");
|
||||
sb.append(i);
|
||||
Log.w("GoogleApiAvailability", sb.toString());
|
||||
return;
|
||||
}
|
||||
int b = GoogleApiAvailability.this.b(this.a);
|
||||
if (GoogleApiAvailability.this.b(b)) {
|
||||
GoogleApiAvailability.this.b(this.a, b);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
GoogleApiAvailability() {
|
||||
}
|
||||
|
||||
public static GoogleApiAvailability a() {
|
||||
return e;
|
||||
}
|
||||
|
||||
public boolean b(Activity activity, int i, int i2, DialogInterface.OnCancelListener onCancelListener) {
|
||||
Dialog a = a(activity, i, i2, onCancelListener);
|
||||
if (a == null) {
|
||||
return false;
|
||||
}
|
||||
a(activity, a, GooglePlayServicesUtil.GMS_ERROR_DIALOG, onCancelListener);
|
||||
return true;
|
||||
}
|
||||
|
||||
final void c(Context context) {
|
||||
new zaa(context).sendEmptyMessageDelayed(1, 120000L);
|
||||
}
|
||||
|
||||
public Dialog a(Activity activity, int i, int i2, DialogInterface.OnCancelListener onCancelListener) {
|
||||
return a(activity, i, DialogRedirect.a(activity, a(activity, i, "d"), i2), onCancelListener);
|
||||
}
|
||||
|
||||
public void b(Context context, int i) {
|
||||
a(context, i, (String) null, a(context, i, 0, "n"));
|
||||
}
|
||||
|
||||
private final String b() {
|
||||
String str;
|
||||
synchronized (d) {
|
||||
str = this.c;
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
||||
public final boolean a(Context context, ConnectionResult connectionResult, int i) {
|
||||
PendingIntent a = a(context, connectionResult);
|
||||
if (a == null) {
|
||||
return false;
|
||||
}
|
||||
a(context, connectionResult.getErrorCode(), (String) null, GoogleApiActivity.a(context, a, i));
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override // com.google.android.gms.common.GoogleApiAvailabilityLight
|
||||
public int b(Context context) {
|
||||
return super.b(context);
|
||||
}
|
||||
|
||||
@Override // com.google.android.gms.common.GoogleApiAvailabilityLight
|
||||
public int a(Context context, int i) {
|
||||
return super.a(context, i);
|
||||
}
|
||||
|
||||
@Override // com.google.android.gms.common.GoogleApiAvailabilityLight
|
||||
public final boolean b(int i) {
|
||||
return super.b(i);
|
||||
}
|
||||
|
||||
@Override // com.google.android.gms.common.GoogleApiAvailabilityLight
|
||||
public Intent a(Context context, int i, String str) {
|
||||
return super.a(context, i, str);
|
||||
}
|
||||
|
||||
@Override // com.google.android.gms.common.GoogleApiAvailabilityLight
|
||||
public PendingIntent a(Context context, int i, int i2) {
|
||||
return super.a(context, i, i2);
|
||||
}
|
||||
|
||||
public PendingIntent a(Context context, ConnectionResult connectionResult) {
|
||||
if (connectionResult.hasResolution()) {
|
||||
return connectionResult.getResolution();
|
||||
}
|
||||
return a(context, connectionResult.getErrorCode(), 0);
|
||||
}
|
||||
|
||||
@Override // com.google.android.gms.common.GoogleApiAvailabilityLight
|
||||
public final String a(int i) {
|
||||
return super.a(i);
|
||||
}
|
||||
|
||||
static Dialog a(Context context, int i, DialogRedirect dialogRedirect, DialogInterface.OnCancelListener onCancelListener) {
|
||||
if (i == 0) {
|
||||
return null;
|
||||
}
|
||||
TypedValue typedValue = new TypedValue();
|
||||
context.getTheme().resolveAttribute(R.attr.alertDialogTheme, typedValue, true);
|
||||
AlertDialog.Builder builder = "Theme.Dialog.Alert".equals(context.getResources().getResourceEntryName(typedValue.resourceId)) ? new AlertDialog.Builder(context, 5) : null;
|
||||
if (builder == null) {
|
||||
builder = new AlertDialog.Builder(context);
|
||||
}
|
||||
builder.setMessage(ConnectionErrorMessages.b(context, i));
|
||||
if (onCancelListener != null) {
|
||||
builder.setOnCancelListener(onCancelListener);
|
||||
}
|
||||
String a = ConnectionErrorMessages.a(context, i);
|
||||
if (a != null) {
|
||||
builder.setPositiveButton(a, dialogRedirect);
|
||||
}
|
||||
String e2 = ConnectionErrorMessages.e(context, i);
|
||||
if (e2 != null) {
|
||||
builder.setTitle(e2);
|
||||
}
|
||||
return builder.create();
|
||||
}
|
||||
|
||||
static void a(Activity activity, Dialog dialog, String str, DialogInterface.OnCancelListener onCancelListener) {
|
||||
if (activity instanceof FragmentActivity) {
|
||||
SupportErrorDialogFragment.a(dialog, onCancelListener).a(((FragmentActivity) activity).getSupportFragmentManager(), str);
|
||||
} else {
|
||||
ErrorDialogFragment.a(dialog, onCancelListener).show(activity.getFragmentManager(), str);
|
||||
}
|
||||
}
|
||||
|
||||
@TargetApi(20)
|
||||
private final void a(Context context, int i, String str, PendingIntent pendingIntent) {
|
||||
int i2;
|
||||
if (i == 18) {
|
||||
c(context);
|
||||
return;
|
||||
}
|
||||
if (pendingIntent == null) {
|
||||
if (i == 6) {
|
||||
Log.w("GoogleApiAvailability", "Missing resolution for ConnectionResult.RESOLUTION_REQUIRED. Call GoogleApiAvailability#showErrorNotification(Context, ConnectionResult) instead.");
|
||||
return;
|
||||
}
|
||||
return;
|
||||
}
|
||||
String d2 = ConnectionErrorMessages.d(context, i);
|
||||
String c = ConnectionErrorMessages.c(context, i);
|
||||
Resources resources = context.getResources();
|
||||
NotificationManager notificationManager = (NotificationManager) context.getSystemService("notification");
|
||||
NotificationCompat.Builder builder = new NotificationCompat.Builder(context);
|
||||
builder.b(true);
|
||||
builder.a(true);
|
||||
builder.b(d2);
|
||||
NotificationCompat.BigTextStyle bigTextStyle = new NotificationCompat.BigTextStyle();
|
||||
bigTextStyle.a(c);
|
||||
builder.a(bigTextStyle);
|
||||
if (DeviceProperties.b(context)) {
|
||||
Preconditions.b(PlatformVersion.f());
|
||||
builder.b(context.getApplicationInfo().icon);
|
||||
builder.a(2);
|
||||
if (DeviceProperties.c(context)) {
|
||||
builder.a(R$drawable.common_full_open_on_phone, resources.getString(com.google.android.gms.base.R$string.common_open_on_phone), pendingIntent);
|
||||
} else {
|
||||
builder.a(pendingIntent);
|
||||
}
|
||||
} else {
|
||||
builder.b(R.drawable.stat_sys_warning);
|
||||
builder.c(resources.getString(com.google.android.gms.base.R$string.common_google_play_services_notification_ticker));
|
||||
builder.a(System.currentTimeMillis());
|
||||
builder.a(pendingIntent);
|
||||
builder.a((CharSequence) c);
|
||||
}
|
||||
if (PlatformVersion.i()) {
|
||||
Preconditions.b(PlatformVersion.i());
|
||||
String b = b();
|
||||
if (b == null) {
|
||||
b = "com.google.android.gms.availability";
|
||||
NotificationChannel notificationChannel = notificationManager.getNotificationChannel("com.google.android.gms.availability");
|
||||
String b2 = ConnectionErrorMessages.b(context);
|
||||
if (notificationChannel == null) {
|
||||
notificationManager.createNotificationChannel(new NotificationChannel("com.google.android.gms.availability", b2, 4));
|
||||
} else if (!b2.equals(notificationChannel.getName())) {
|
||||
notificationChannel.setName(b2);
|
||||
notificationManager.createNotificationChannel(notificationChannel);
|
||||
}
|
||||
}
|
||||
builder.a(b);
|
||||
}
|
||||
Notification a = builder.a();
|
||||
if (i == 1 || i == 2 || i == 3) {
|
||||
i2 = 10436;
|
||||
GooglePlayServicesUtilLight.sCanceledAvailabilityNotification.set(false);
|
||||
} else {
|
||||
i2 = 39789;
|
||||
}
|
||||
notificationManager.notify(i2, a);
|
||||
}
|
||||
}
|
@@ -0,0 +1,93 @@
|
||||
package com.google.android.gms.common;
|
||||
|
||||
import android.app.PendingIntent;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.text.TextUtils;
|
||||
import com.google.android.gms.common.util.DeviceProperties;
|
||||
import com.google.android.gms.common.wrappers.Wrappers;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class GoogleApiAvailabilityLight {
|
||||
public static final int a = GooglePlayServicesUtilLight.GOOGLE_PLAY_SERVICES_VERSION_CODE;
|
||||
private static final GoogleApiAvailabilityLight b = new GoogleApiAvailabilityLight();
|
||||
|
||||
GoogleApiAvailabilityLight() {
|
||||
}
|
||||
|
||||
public static GoogleApiAvailabilityLight a() {
|
||||
return b;
|
||||
}
|
||||
|
||||
public int b(Context context) {
|
||||
return a(context, a);
|
||||
}
|
||||
|
||||
public int a(Context context, int i) {
|
||||
int isGooglePlayServicesAvailable = GooglePlayServicesUtilLight.isGooglePlayServicesAvailable(context, i);
|
||||
if (GooglePlayServicesUtilLight.isPlayServicesPossiblyUpdating(context, isGooglePlayServicesAvailable)) {
|
||||
return 18;
|
||||
}
|
||||
return isGooglePlayServicesAvailable;
|
||||
}
|
||||
|
||||
public boolean b(int i) {
|
||||
return GooglePlayServicesUtilLight.isUserRecoverableError(i);
|
||||
}
|
||||
|
||||
public Intent a(Context context, int i, String str) {
|
||||
if (i != 1 && i != 2) {
|
||||
if (i != 3) {
|
||||
return null;
|
||||
}
|
||||
return com.google.android.gms.common.internal.zzg.a("com.google.android.gms");
|
||||
}
|
||||
if (context != null && DeviceProperties.c(context)) {
|
||||
return com.google.android.gms.common.internal.zzg.a();
|
||||
}
|
||||
return com.google.android.gms.common.internal.zzg.a("com.google.android.gms", a(context, str));
|
||||
}
|
||||
|
||||
public PendingIntent a(Context context, int i, int i2) {
|
||||
return a(context, i, i2, null);
|
||||
}
|
||||
|
||||
public PendingIntent a(Context context, int i, int i2, String str) {
|
||||
Intent a2 = a(context, i, str);
|
||||
if (a2 == null) {
|
||||
return null;
|
||||
}
|
||||
return PendingIntent.getActivity(context, i2, a2, 134217728);
|
||||
}
|
||||
|
||||
public int a(Context context) {
|
||||
return GooglePlayServicesUtilLight.getApkVersion(context);
|
||||
}
|
||||
|
||||
public String a(int i) {
|
||||
return GooglePlayServicesUtilLight.getErrorString(i);
|
||||
}
|
||||
|
||||
private static String a(Context context, String str) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("gcore_");
|
||||
sb.append(a);
|
||||
sb.append("-");
|
||||
if (!TextUtils.isEmpty(str)) {
|
||||
sb.append(str);
|
||||
}
|
||||
sb.append("-");
|
||||
if (context != null) {
|
||||
sb.append(context.getPackageName());
|
||||
}
|
||||
sb.append("-");
|
||||
if (context != null) {
|
||||
try {
|
||||
sb.append(Wrappers.a(context).b(context.getPackageName(), 0).versionCode);
|
||||
} catch (PackageManager.NameNotFoundException unused) {
|
||||
}
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
@@ -0,0 +1,10 @@
|
||||
package com.google.android.gms.common;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class GooglePlayServicesNotAvailableException extends Exception {
|
||||
public final int errorCode;
|
||||
|
||||
public GooglePlayServicesNotAvailableException(int i) {
|
||||
this.errorCode = i;
|
||||
}
|
||||
}
|
@@ -0,0 +1,17 @@
|
||||
package com.google.android.gms.common;
|
||||
|
||||
import android.content.Intent;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class GooglePlayServicesRepairableException extends UserRecoverableException {
|
||||
private final int zzaf;
|
||||
|
||||
public GooglePlayServicesRepairableException(int i, String str, Intent intent) {
|
||||
super(str, intent);
|
||||
this.zzaf = i;
|
||||
}
|
||||
|
||||
public int getConnectionStatusCode() {
|
||||
return this.zzaf;
|
||||
}
|
||||
}
|
@@ -0,0 +1,107 @@
|
||||
package com.google.android.gms.common;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.Dialog;
|
||||
import android.app.PendingIntent;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.res.Resources;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import com.google.android.gms.common.internal.DialogRedirect;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class GooglePlayServicesUtil extends GooglePlayServicesUtilLight {
|
||||
public static final String GMS_ERROR_DIALOG = "GooglePlayServicesErrorDialog";
|
||||
|
||||
@Deprecated
|
||||
public static final String GOOGLE_PLAY_SERVICES_PACKAGE = "com.google.android.gms";
|
||||
|
||||
@Deprecated
|
||||
public static final int GOOGLE_PLAY_SERVICES_VERSION_CODE = GooglePlayServicesUtilLight.GOOGLE_PLAY_SERVICES_VERSION_CODE;
|
||||
public static final String GOOGLE_PLAY_STORE_PACKAGE = "com.android.vending";
|
||||
|
||||
private GooglePlayServicesUtil() {
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public static Dialog getErrorDialog(int i, Activity activity, int i2) {
|
||||
return getErrorDialog(i, activity, i2, null);
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public static PendingIntent getErrorPendingIntent(int i, Context context, int i2) {
|
||||
return GooglePlayServicesUtilLight.getErrorPendingIntent(i, context, i2);
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public static String getErrorString(int i) {
|
||||
return GooglePlayServicesUtilLight.getErrorString(i);
|
||||
}
|
||||
|
||||
public static Context getRemoteContext(Context context) {
|
||||
return GooglePlayServicesUtilLight.getRemoteContext(context);
|
||||
}
|
||||
|
||||
public static Resources getRemoteResource(Context context) {
|
||||
return GooglePlayServicesUtilLight.getRemoteResource(context);
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public static int isGooglePlayServicesAvailable(Context context) {
|
||||
return GooglePlayServicesUtilLight.isGooglePlayServicesAvailable(context);
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public static boolean isUserRecoverableError(int i) {
|
||||
return GooglePlayServicesUtilLight.isUserRecoverableError(i);
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public static boolean showErrorDialogFragment(int i, Activity activity, int i2, DialogInterface.OnCancelListener onCancelListener) {
|
||||
return showErrorDialogFragment(i, activity, null, i2, onCancelListener);
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public static void showErrorNotification(int i, Context context) {
|
||||
GoogleApiAvailability a = GoogleApiAvailability.a();
|
||||
if (GooglePlayServicesUtilLight.isPlayServicesPossiblyUpdating(context, i) || GooglePlayServicesUtilLight.isPlayStorePossiblyUpdating(context, i)) {
|
||||
a.c(context);
|
||||
} else {
|
||||
a.b(context, i);
|
||||
}
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public static Dialog getErrorDialog(int i, Activity activity, int i2, DialogInterface.OnCancelListener onCancelListener) {
|
||||
if (GooglePlayServicesUtilLight.isPlayServicesPossiblyUpdating(activity, i)) {
|
||||
i = 18;
|
||||
}
|
||||
return GoogleApiAvailability.a().a(activity, i, i2, onCancelListener);
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public static int isGooglePlayServicesAvailable(Context context, int i) {
|
||||
return GooglePlayServicesUtilLight.isGooglePlayServicesAvailable(context, i);
|
||||
}
|
||||
|
||||
public static boolean showErrorDialogFragment(int i, Activity activity, Fragment fragment, int i2, DialogInterface.OnCancelListener onCancelListener) {
|
||||
if (GooglePlayServicesUtilLight.isPlayServicesPossiblyUpdating(activity, i)) {
|
||||
i = 18;
|
||||
}
|
||||
GoogleApiAvailability a = GoogleApiAvailability.a();
|
||||
if (fragment == null) {
|
||||
return a.b(activity, i, i2, onCancelListener);
|
||||
}
|
||||
Dialog a2 = GoogleApiAvailability.a(activity, i, DialogRedirect.a(fragment, GoogleApiAvailability.a().a(activity, i, "d"), i2), onCancelListener);
|
||||
if (a2 == null) {
|
||||
return false;
|
||||
}
|
||||
GoogleApiAvailability.a(activity, a2, GMS_ERROR_DIALOG, onCancelListener);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public static boolean showErrorDialogFragment(int i, Activity activity, int i2) {
|
||||
return showErrorDialogFragment(i, activity, i2, null);
|
||||
}
|
||||
}
|
@@ -0,0 +1,297 @@
|
||||
package com.google.android.gms.common;
|
||||
|
||||
import android.annotation.TargetApi;
|
||||
import android.app.NotificationManager;
|
||||
import android.app.PendingIntent;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.ApplicationInfo;
|
||||
import android.content.pm.PackageInfo;
|
||||
import android.content.pm.PackageInstaller;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.content.res.Resources;
|
||||
import android.os.Bundle;
|
||||
import android.os.UserManager;
|
||||
import android.util.Log;
|
||||
import com.google.android.gms.common.internal.Preconditions;
|
||||
import com.google.android.gms.common.internal.zzp;
|
||||
import com.google.android.gms.common.util.ClientLibraryUtils;
|
||||
import com.google.android.gms.common.util.DeviceProperties;
|
||||
import com.google.android.gms.common.util.PlatformVersion;
|
||||
import com.google.android.gms.common.util.UidVerifier;
|
||||
import com.google.android.gms.common.wrappers.Wrappers;
|
||||
import com.ubt.jimu.unity.bluetooth.UnityActivity;
|
||||
import java.util.Iterator;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class GooglePlayServicesUtilLight {
|
||||
static final int GMS_AVAILABILITY_NOTIFICATION_ID = 10436;
|
||||
static final int GMS_GENERAL_ERROR_NOTIFICATION_ID = 39789;
|
||||
public static final String GOOGLE_PLAY_GAMES_PACKAGE = "com.google.android.play.games";
|
||||
|
||||
@Deprecated
|
||||
public static final String GOOGLE_PLAY_SERVICES_PACKAGE = "com.google.android.gms";
|
||||
|
||||
@Deprecated
|
||||
public static final int GOOGLE_PLAY_SERVICES_VERSION_CODE = 12451000;
|
||||
public static final String GOOGLE_PLAY_STORE_PACKAGE = "com.android.vending";
|
||||
private static boolean zzag = false;
|
||||
private static boolean zzah = false;
|
||||
private static boolean zzai = false;
|
||||
private static boolean zzaj = false;
|
||||
static final AtomicBoolean sCanceledAvailabilityNotification = new AtomicBoolean();
|
||||
private static final AtomicBoolean zzak = new AtomicBoolean();
|
||||
|
||||
GooglePlayServicesUtilLight() {
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public static void cancelAvailabilityErrorNotifications(Context context) {
|
||||
if (sCanceledAvailabilityNotification.getAndSet(true)) {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
NotificationManager notificationManager = (NotificationManager) context.getSystemService("notification");
|
||||
if (notificationManager != null) {
|
||||
notificationManager.cancel(GMS_AVAILABILITY_NOTIFICATION_ID);
|
||||
}
|
||||
} catch (SecurityException unused) {
|
||||
}
|
||||
}
|
||||
|
||||
public static void enableUsingApkIndependentContext() {
|
||||
zzak.set(true);
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public static void ensurePlayServicesAvailable(Context context, int i) throws GooglePlayServicesRepairableException, GooglePlayServicesNotAvailableException {
|
||||
int a = GoogleApiAvailabilityLight.a().a(context, i);
|
||||
if (a != 0) {
|
||||
Intent a2 = GoogleApiAvailabilityLight.a().a(context, a, "e");
|
||||
StringBuilder sb = new StringBuilder(57);
|
||||
sb.append("GooglePlayServices not available due to error ");
|
||||
sb.append(a);
|
||||
Log.e("GooglePlayServicesUtil", sb.toString());
|
||||
if (a2 != null) {
|
||||
throw new GooglePlayServicesRepairableException(a, "Google Play Services not available", a2);
|
||||
}
|
||||
throw new GooglePlayServicesNotAvailableException(a);
|
||||
}
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public static int getApkVersion(Context context) {
|
||||
try {
|
||||
return context.getPackageManager().getPackageInfo("com.google.android.gms", 0).versionCode;
|
||||
} catch (PackageManager.NameNotFoundException unused) {
|
||||
Log.w("GooglePlayServicesUtil", "Google Play services is missing.");
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public static int getClientVersion(Context context) {
|
||||
Preconditions.b(true);
|
||||
return ClientLibraryUtils.a(context, context.getPackageName());
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public static PendingIntent getErrorPendingIntent(int i, Context context, int i2) {
|
||||
return GoogleApiAvailabilityLight.a().a(context, i, i2);
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public static String getErrorString(int i) {
|
||||
return ConnectionResult.zza(i);
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public static Intent getGooglePlayServicesAvailabilityRecoveryIntent(int i) {
|
||||
return GoogleApiAvailabilityLight.a().a((Context) null, i, (String) null);
|
||||
}
|
||||
|
||||
public static Context getRemoteContext(Context context) {
|
||||
try {
|
||||
return context.createPackageContext("com.google.android.gms", 3);
|
||||
} catch (PackageManager.NameNotFoundException unused) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public static Resources getRemoteResource(Context context) {
|
||||
try {
|
||||
return context.getPackageManager().getResourcesForApplication("com.google.android.gms");
|
||||
} catch (PackageManager.NameNotFoundException unused) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean honorsDebugCertificates(Context context) {
|
||||
try {
|
||||
if (!zzaj) {
|
||||
PackageInfo b = Wrappers.a(context).b("com.google.android.gms", 64);
|
||||
GoogleSignatureVerifier.a(context);
|
||||
if (b == null || GoogleSignatureVerifier.a(b, false) || !GoogleSignatureVerifier.a(b, true)) {
|
||||
zzai = false;
|
||||
} else {
|
||||
zzai = true;
|
||||
}
|
||||
}
|
||||
} catch (PackageManager.NameNotFoundException e) {
|
||||
Log.w("GooglePlayServicesUtil", "Cannot find Google Play services package name.", e);
|
||||
} finally {
|
||||
zzaj = true;
|
||||
}
|
||||
return zzai || !DeviceProperties.a();
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public static int isGooglePlayServicesAvailable(Context context) {
|
||||
return isGooglePlayServicesAvailable(context, GOOGLE_PLAY_SERVICES_VERSION_CODE);
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public static boolean isGooglePlayServicesUid(Context context, int i) {
|
||||
return UidVerifier.a(context, i);
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public static boolean isPlayServicesPossiblyUpdating(Context context, int i) {
|
||||
if (i == 18) {
|
||||
return true;
|
||||
}
|
||||
if (i == 1) {
|
||||
return isUninstalledAppPossiblyUpdating(context, "com.google.android.gms");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public static boolean isPlayStorePossiblyUpdating(Context context, int i) {
|
||||
if (i == 9) {
|
||||
return isUninstalledAppPossiblyUpdating(context, "com.android.vending");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@TargetApi(18)
|
||||
public static boolean isRestrictedUserProfile(Context context) {
|
||||
Bundle applicationRestrictions;
|
||||
return PlatformVersion.d() && (applicationRestrictions = ((UserManager) context.getSystemService("user")).getApplicationRestrictions(context.getPackageName())) != null && "true".equals(applicationRestrictions.getString("restricted_profile"));
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public static boolean isSidewinderDevice(Context context) {
|
||||
return DeviceProperties.a(context);
|
||||
}
|
||||
|
||||
@TargetApi(21)
|
||||
static boolean isUninstalledAppPossiblyUpdating(Context context, String str) {
|
||||
ApplicationInfo applicationInfo;
|
||||
boolean equals = str.equals("com.google.android.gms");
|
||||
if (PlatformVersion.g()) {
|
||||
try {
|
||||
Iterator<PackageInstaller.SessionInfo> it = context.getPackageManager().getPackageInstaller().getAllSessions().iterator();
|
||||
while (it.hasNext()) {
|
||||
if (str.equals(it.next().getAppPackageName())) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
} catch (Exception unused) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
try {
|
||||
applicationInfo = context.getPackageManager().getApplicationInfo(str, UnityActivity.BLOCKLY_TYPE_NONE);
|
||||
} catch (PackageManager.NameNotFoundException unused2) {
|
||||
}
|
||||
return equals ? applicationInfo.enabled : applicationInfo.enabled && !isRestrictedUserProfile(context);
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public static boolean isUserRecoverableError(int i) {
|
||||
return i == 1 || i == 2 || i == 3 || i == 9;
|
||||
}
|
||||
|
||||
@TargetApi(19)
|
||||
@Deprecated
|
||||
public static boolean uidHasPackageName(Context context, int i, String str) {
|
||||
return UidVerifier.a(context, i, str);
|
||||
}
|
||||
|
||||
private static int zza(Context context, boolean z, int i) {
|
||||
Preconditions.a(i >= 0);
|
||||
PackageManager packageManager = context.getPackageManager();
|
||||
PackageInfo packageInfo = null;
|
||||
if (z) {
|
||||
try {
|
||||
packageInfo = packageManager.getPackageInfo("com.android.vending", 8256);
|
||||
} catch (PackageManager.NameNotFoundException unused) {
|
||||
Log.w("GooglePlayServicesUtil", "Google Play Store is missing.");
|
||||
return 9;
|
||||
}
|
||||
}
|
||||
try {
|
||||
PackageInfo packageInfo2 = packageManager.getPackageInfo("com.google.android.gms", 64);
|
||||
GoogleSignatureVerifier.a(context);
|
||||
if (!GoogleSignatureVerifier.a(packageInfo2, true)) {
|
||||
Log.w("GooglePlayServicesUtil", "Google Play services signature invalid.");
|
||||
return 9;
|
||||
}
|
||||
if (z && (!GoogleSignatureVerifier.a(packageInfo, true) || !packageInfo.signatures[0].equals(packageInfo2.signatures[0]))) {
|
||||
Log.w("GooglePlayServicesUtil", "Google Play Store signature invalid.");
|
||||
return 9;
|
||||
}
|
||||
if (com.google.android.gms.common.util.zzb.a(packageInfo2.versionCode) >= com.google.android.gms.common.util.zzb.a(i)) {
|
||||
ApplicationInfo applicationInfo = packageInfo2.applicationInfo;
|
||||
if (applicationInfo == null) {
|
||||
try {
|
||||
applicationInfo = packageManager.getApplicationInfo("com.google.android.gms", 0);
|
||||
} catch (PackageManager.NameNotFoundException e) {
|
||||
Log.wtf("GooglePlayServicesUtil", "Google Play services missing when getting application info.", e);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
return !applicationInfo.enabled ? 3 : 0;
|
||||
}
|
||||
int i2 = packageInfo2.versionCode;
|
||||
StringBuilder sb = new StringBuilder(77);
|
||||
sb.append("Google Play services out of date. Requires ");
|
||||
sb.append(i);
|
||||
sb.append(" but found ");
|
||||
sb.append(i2);
|
||||
Log.w("GooglePlayServicesUtil", sb.toString());
|
||||
return 2;
|
||||
} catch (PackageManager.NameNotFoundException unused2) {
|
||||
Log.w("GooglePlayServicesUtil", "Google Play services is missing.");
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public static int isGooglePlayServicesAvailable(Context context, int i) {
|
||||
try {
|
||||
context.getResources().getString(R$string.common_google_play_services_unknown_issue);
|
||||
} catch (Throwable unused) {
|
||||
Log.e("GooglePlayServicesUtil", "The Google Play services resources were not found. Check your project configuration to ensure that the resources are included.");
|
||||
}
|
||||
if (!"com.google.android.gms".equals(context.getPackageName()) && !zzak.get()) {
|
||||
int b = zzp.b(context);
|
||||
if (b == 0) {
|
||||
throw new IllegalStateException("A required meta-data tag in your app's AndroidManifest.xml does not exist. You must have the following declaration within the <application> element: <meta-data android:name=\"com.google.android.gms.version\" android:value=\"@integer/google_play_services_version\" />");
|
||||
}
|
||||
int i2 = GOOGLE_PLAY_SERVICES_VERSION_CODE;
|
||||
if (b != i2) {
|
||||
StringBuilder sb = new StringBuilder(320);
|
||||
sb.append("The meta-data tag in your app's AndroidManifest.xml does not have the right value. Expected ");
|
||||
sb.append(i2);
|
||||
sb.append(" but found ");
|
||||
sb.append(b);
|
||||
sb.append(". You must have the following declaration within the <application> element: <meta-data android:name=\"com.google.android.gms.version\" android:value=\"@integer/google_play_services_version\" />");
|
||||
throw new IllegalStateException(sb.toString());
|
||||
}
|
||||
}
|
||||
return zza(context, (DeviceProperties.c(context) || DeviceProperties.d(context)) ? false : true, i);
|
||||
}
|
||||
}
|
@@ -0,0 +1,117 @@
|
||||
package com.google.android.gms.common;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.pm.ApplicationInfo;
|
||||
import android.content.pm.PackageInfo;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.content.pm.Signature;
|
||||
import android.util.Log;
|
||||
import com.google.android.gms.common.internal.Preconditions;
|
||||
import com.google.android.gms.common.wrappers.Wrappers;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class GoogleSignatureVerifier {
|
||||
private static GoogleSignatureVerifier b;
|
||||
private final Context a;
|
||||
|
||||
private GoogleSignatureVerifier(Context context) {
|
||||
this.a = context.getApplicationContext();
|
||||
}
|
||||
|
||||
public static GoogleSignatureVerifier a(Context context) {
|
||||
Preconditions.a(context);
|
||||
synchronized (GoogleSignatureVerifier.class) {
|
||||
if (b == null) {
|
||||
zzc.a(context);
|
||||
b = new GoogleSignatureVerifier(context);
|
||||
}
|
||||
}
|
||||
return b;
|
||||
}
|
||||
|
||||
private final zzm b(PackageInfo packageInfo) {
|
||||
ApplicationInfo applicationInfo;
|
||||
boolean honorsDebugCertificates = GooglePlayServicesUtilLight.honorsDebugCertificates(this.a);
|
||||
if (packageInfo == null) {
|
||||
return zzm.a("null pkg");
|
||||
}
|
||||
Signature[] signatureArr = packageInfo.signatures;
|
||||
if (signatureArr.length != 1) {
|
||||
return zzm.a("single cert required");
|
||||
}
|
||||
zzf zzfVar = new zzf(signatureArr[0].toByteArray());
|
||||
String str = packageInfo.packageName;
|
||||
zzm a = zzc.a(str, zzfVar, honorsDebugCertificates);
|
||||
return (!a.a || (applicationInfo = packageInfo.applicationInfo) == null || (applicationInfo.flags & 2) == 0 || (honorsDebugCertificates && !zzc.a(str, (zze) zzfVar, false).a)) ? a : zzm.a("debuggable release cert app rejected");
|
||||
}
|
||||
|
||||
public boolean a(int i) {
|
||||
zzm a;
|
||||
String[] a2 = Wrappers.a(this.a).a(i);
|
||||
if (a2 == null || a2.length == 0) {
|
||||
a = zzm.a("no pkgs");
|
||||
} else {
|
||||
a = null;
|
||||
for (String str : a2) {
|
||||
a = a(str, i);
|
||||
if (a.a) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
a.b();
|
||||
return a.a;
|
||||
}
|
||||
|
||||
public static boolean a(PackageInfo packageInfo, boolean z) {
|
||||
if (packageInfo != null && packageInfo.signatures != null) {
|
||||
if ((z ? a(packageInfo, zzh.a) : a(packageInfo, zzh.a[0])) != null) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean a(PackageInfo packageInfo) {
|
||||
if (packageInfo == null) {
|
||||
return false;
|
||||
}
|
||||
if (a(packageInfo, false)) {
|
||||
return true;
|
||||
}
|
||||
if (a(packageInfo, true)) {
|
||||
if (GooglePlayServicesUtilLight.honorsDebugCertificates(this.a)) {
|
||||
return true;
|
||||
}
|
||||
Log.w("GoogleSignatureVerifier", "Test-keys aren't accepted on this build.");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private final zzm a(String str, int i) {
|
||||
try {
|
||||
return b(Wrappers.a(this.a).a(str, 64, i));
|
||||
} catch (PackageManager.NameNotFoundException unused) {
|
||||
String valueOf = String.valueOf(str);
|
||||
return zzm.a(valueOf.length() != 0 ? "no pkg ".concat(valueOf) : new String("no pkg "));
|
||||
}
|
||||
}
|
||||
|
||||
private static zze a(PackageInfo packageInfo, zze... zzeVarArr) {
|
||||
Signature[] signatureArr = packageInfo.signatures;
|
||||
if (signatureArr == null) {
|
||||
return null;
|
||||
}
|
||||
if (signatureArr.length != 1) {
|
||||
Log.w("GoogleSignatureVerifier", "Package has more than one signature.");
|
||||
return null;
|
||||
}
|
||||
zzf zzfVar = new zzf(signatureArr[0].toByteArray());
|
||||
for (int i = 0; i < zzeVarArr.length; i++) {
|
||||
if (zzeVarArr[i].equals(zzfVar)) {
|
||||
return zzeVarArr[i];
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
6
sources/com/google/android/gms/common/R$string.java
Normal file
6
sources/com/google/android/gms/common/R$string.java
Normal file
@@ -0,0 +1,6 @@
|
||||
package com.google.android.gms.common;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class R$string {
|
||||
public static final int common_google_play_services_unknown_issue = 2131820822;
|
||||
}
|
@@ -0,0 +1,48 @@
|
||||
package com.google.android.gms.common;
|
||||
|
||||
import android.app.Dialog;
|
||||
import android.content.DialogInterface;
|
||||
import android.os.Bundle;
|
||||
import androidx.fragment.app.DialogFragment;
|
||||
import androidx.fragment.app.FragmentManager;
|
||||
import com.google.android.gms.common.internal.Preconditions;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class SupportErrorDialogFragment extends DialogFragment {
|
||||
private Dialog j = null;
|
||||
private DialogInterface.OnCancelListener k = null;
|
||||
|
||||
@Override // androidx.fragment.app.DialogFragment
|
||||
public Dialog a(Bundle bundle) {
|
||||
if (this.j == null) {
|
||||
b(false);
|
||||
}
|
||||
return this.j;
|
||||
}
|
||||
|
||||
@Override // androidx.fragment.app.DialogFragment, android.content.DialogInterface.OnCancelListener
|
||||
public void onCancel(DialogInterface dialogInterface) {
|
||||
DialogInterface.OnCancelListener onCancelListener = this.k;
|
||||
if (onCancelListener != null) {
|
||||
onCancelListener.onCancel(dialogInterface);
|
||||
}
|
||||
}
|
||||
|
||||
public static SupportErrorDialogFragment a(Dialog dialog, DialogInterface.OnCancelListener onCancelListener) {
|
||||
SupportErrorDialogFragment supportErrorDialogFragment = new SupportErrorDialogFragment();
|
||||
Preconditions.a(dialog, "Cannot display null dialog");
|
||||
Dialog dialog2 = dialog;
|
||||
dialog2.setOnCancelListener(null);
|
||||
dialog2.setOnDismissListener(null);
|
||||
supportErrorDialogFragment.j = dialog2;
|
||||
if (onCancelListener != null) {
|
||||
supportErrorDialogFragment.k = onCancelListener;
|
||||
}
|
||||
return supportErrorDialogFragment;
|
||||
}
|
||||
|
||||
@Override // androidx.fragment.app.DialogFragment
|
||||
public void a(FragmentManager fragmentManager, String str) {
|
||||
super.a(fragmentManager, str);
|
||||
}
|
||||
}
|
@@ -0,0 +1,17 @@
|
||||
package com.google.android.gms.common;
|
||||
|
||||
import android.content.Intent;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class UserRecoverableException extends Exception {
|
||||
private final Intent mIntent;
|
||||
|
||||
public UserRecoverableException(String str, Intent intent) {
|
||||
super(str);
|
||||
this.mIntent = intent;
|
||||
}
|
||||
|
||||
public Intent getIntent() {
|
||||
return new Intent(this.mIntent);
|
||||
}
|
||||
}
|
@@ -0,0 +1,11 @@
|
||||
package com.google.android.gms.common.annotation;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Target({ElementType.TYPE, ElementType.FIELD, ElementType.METHOD, ElementType.CONSTRUCTOR})
|
||||
@Documented
|
||||
/* loaded from: classes.dex */
|
||||
public @interface KeepName {
|
||||
}
|
108
sources/com/google/android/gms/common/api/Api.java
Normal file
108
sources/com/google/android/gms/common/api/Api.java
Normal file
@@ -0,0 +1,108 @@
|
||||
package com.google.android.gms.common.api;
|
||||
|
||||
import android.accounts.Account;
|
||||
import android.content.Context;
|
||||
import android.os.IBinder;
|
||||
import android.os.IInterface;
|
||||
import android.os.Looper;
|
||||
import com.google.android.gms.auth.api.signin.GoogleSignInAccount;
|
||||
import com.google.android.gms.common.Feature;
|
||||
import com.google.android.gms.common.api.Api.ApiOptions;
|
||||
import com.google.android.gms.common.internal.BaseGmsClient;
|
||||
import com.google.android.gms.common.internal.ClientSettings;
|
||||
import com.google.android.gms.common.internal.IAccountAccessor;
|
||||
import com.google.android.gms.common.internal.Preconditions;
|
||||
import java.util.Set;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class Api<O extends ApiOptions> {
|
||||
private final AbstractClientBuilder<?, O> a;
|
||||
private final String b;
|
||||
|
||||
public static abstract class AbstractClientBuilder<T extends Client, O> extends BaseClientBuilder<T, O> {
|
||||
public abstract T a(Context context, Looper looper, ClientSettings clientSettings, O o, GoogleApiClient$ConnectionCallbacks googleApiClient$ConnectionCallbacks, GoogleApiClient$OnConnectionFailedListener googleApiClient$OnConnectionFailedListener);
|
||||
}
|
||||
|
||||
public interface AnyClient {
|
||||
}
|
||||
|
||||
public static class AnyClientKey<C extends AnyClient> {
|
||||
}
|
||||
|
||||
public interface ApiOptions {
|
||||
|
||||
public interface HasAccountOptions extends HasOptions, NotRequiredOptions {
|
||||
Account a();
|
||||
}
|
||||
|
||||
public interface HasGoogleSignInAccountOptions extends HasOptions {
|
||||
GoogleSignInAccount b();
|
||||
}
|
||||
|
||||
public interface HasOptions extends ApiOptions {
|
||||
}
|
||||
|
||||
public interface NotRequiredOptions extends ApiOptions {
|
||||
}
|
||||
|
||||
public interface Optional extends HasOptions, NotRequiredOptions {
|
||||
}
|
||||
}
|
||||
|
||||
public static abstract class BaseClientBuilder<T extends AnyClient, O> {
|
||||
}
|
||||
|
||||
public interface Client extends AnyClient {
|
||||
void a();
|
||||
|
||||
void a(BaseGmsClient.ConnectionProgressReportCallbacks connectionProgressReportCallbacks);
|
||||
|
||||
void a(BaseGmsClient.SignOutCallbacks signOutCallbacks);
|
||||
|
||||
void a(IAccountAccessor iAccountAccessor, Set<Scope> set);
|
||||
|
||||
boolean b();
|
||||
|
||||
boolean d();
|
||||
|
||||
String e();
|
||||
|
||||
boolean f();
|
||||
|
||||
int g();
|
||||
|
||||
Feature[] h();
|
||||
|
||||
boolean i();
|
||||
}
|
||||
|
||||
public static final class ClientKey<C extends Client> extends AnyClientKey<C> {
|
||||
}
|
||||
|
||||
public interface SimpleClient<T extends IInterface> extends AnyClient {
|
||||
T a(IBinder iBinder);
|
||||
|
||||
void a(int i, T t);
|
||||
|
||||
String j();
|
||||
|
||||
String k();
|
||||
}
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
public <C extends Client> Api(String str, AbstractClientBuilder<C, O> abstractClientBuilder, ClientKey<C> clientKey) {
|
||||
Preconditions.a(abstractClientBuilder, "Cannot construct an Api with a null ClientBuilder");
|
||||
Preconditions.a(clientKey, "Cannot construct an Api with a null ClientKey");
|
||||
this.b = str;
|
||||
this.a = abstractClientBuilder;
|
||||
}
|
||||
|
||||
public final String a() {
|
||||
return this.b;
|
||||
}
|
||||
|
||||
public final AbstractClientBuilder<?, O> b() {
|
||||
Preconditions.b(this.a != null, "This API was constructed with a SimpleClientBuilder. Use getSimpleClientBuilder");
|
||||
return this.a;
|
||||
}
|
||||
}
|
48
sources/com/google/android/gms/common/api/ApiException.java
Normal file
48
sources/com/google/android/gms/common/api/ApiException.java
Normal file
@@ -0,0 +1,48 @@
|
||||
package com.google.android.gms.common.api;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class ApiException extends Exception {
|
||||
protected final Status mStatus;
|
||||
|
||||
/* JADX WARN: Illegal instructions before constructor call */
|
||||
/*
|
||||
Code decompiled incorrectly, please refer to instructions dump.
|
||||
To view partially-correct code enable 'Show inconsistent code' option in preferences
|
||||
*/
|
||||
public ApiException(com.google.android.gms.common.api.Status r5) {
|
||||
/*
|
||||
r4 = this;
|
||||
int r0 = r5.getStatusCode()
|
||||
java.lang.String r1 = r5.getStatusMessage()
|
||||
if (r1 == 0) goto Lf
|
||||
java.lang.String r1 = r5.getStatusMessage()
|
||||
goto L11
|
||||
Lf:
|
||||
java.lang.String r1 = ""
|
||||
L11:
|
||||
java.lang.String r2 = java.lang.String.valueOf(r1)
|
||||
int r2 = r2.length()
|
||||
int r2 = r2 + 13
|
||||
java.lang.StringBuilder r3 = new java.lang.StringBuilder
|
||||
r3.<init>(r2)
|
||||
r3.append(r0)
|
||||
java.lang.String r0 = ": "
|
||||
r3.append(r0)
|
||||
r3.append(r1)
|
||||
java.lang.String r0 = r3.toString()
|
||||
r4.<init>(r0)
|
||||
r4.mStatus = r5
|
||||
return
|
||||
*/
|
||||
throw new UnsupportedOperationException("Method not decompiled: com.google.android.gms.common.api.ApiException.<init>(com.google.android.gms.common.api.Status):void");
|
||||
}
|
||||
|
||||
public int getStatusCode() {
|
||||
return this.mStatus.getStatusCode();
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public String getStatusMessage() {
|
||||
return this.mStatus.getStatusMessage();
|
||||
}
|
||||
}
|
@@ -0,0 +1,55 @@
|
||||
package com.google.android.gms.common.api;
|
||||
|
||||
import android.text.TextUtils;
|
||||
import androidx.collection.ArrayMap;
|
||||
import com.google.android.gms.common.ConnectionResult;
|
||||
import com.google.android.gms.common.api.Api;
|
||||
import com.google.android.gms.common.api.internal.zai;
|
||||
import com.google.android.gms.common.internal.Preconditions;
|
||||
import java.util.ArrayList;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class AvailabilityException extends Exception {
|
||||
private final ArrayMap<zai<?>, ConnectionResult> zaay;
|
||||
|
||||
public AvailabilityException(ArrayMap<zai<?>, ConnectionResult> arrayMap) {
|
||||
this.zaay = arrayMap;
|
||||
}
|
||||
|
||||
public ConnectionResult getConnectionResult(GoogleApi<? extends Api.ApiOptions> googleApi) {
|
||||
zai<? extends Api.ApiOptions> c = googleApi.c();
|
||||
Preconditions.a(this.zaay.get(c) != null, "The given API was not part of the availability request.");
|
||||
return this.zaay.get(c);
|
||||
}
|
||||
|
||||
@Override // java.lang.Throwable
|
||||
public String getMessage() {
|
||||
ArrayList arrayList = new ArrayList();
|
||||
boolean z = true;
|
||||
for (zai<?> zaiVar : this.zaay.keySet()) {
|
||||
ConnectionResult connectionResult = this.zaay.get(zaiVar);
|
||||
if (connectionResult.isSuccess()) {
|
||||
z = false;
|
||||
}
|
||||
String a = zaiVar.a();
|
||||
String valueOf = String.valueOf(connectionResult);
|
||||
StringBuilder sb = new StringBuilder(String.valueOf(a).length() + 2 + String.valueOf(valueOf).length());
|
||||
sb.append(a);
|
||||
sb.append(": ");
|
||||
sb.append(valueOf);
|
||||
arrayList.add(sb.toString());
|
||||
}
|
||||
StringBuilder sb2 = new StringBuilder();
|
||||
if (z) {
|
||||
sb2.append("None of the queried APIs are available. ");
|
||||
} else {
|
||||
sb2.append("Some of the queried APIs are unavailable. ");
|
||||
}
|
||||
sb2.append(TextUtils.join("; ", arrayList));
|
||||
return sb2.toString();
|
||||
}
|
||||
|
||||
public final ArrayMap<zai<?>, ConnectionResult> zaj() {
|
||||
return this.zaay;
|
||||
}
|
||||
}
|
@@ -0,0 +1,50 @@
|
||||
package com.google.android.gms.common.api;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class CommonStatusCodes {
|
||||
public static String a(int i) {
|
||||
switch (i) {
|
||||
case -1:
|
||||
return "SUCCESS_CACHE";
|
||||
case 0:
|
||||
return "SUCCESS";
|
||||
case 1:
|
||||
case 9:
|
||||
case 11:
|
||||
case 12:
|
||||
default:
|
||||
StringBuilder sb = new StringBuilder(32);
|
||||
sb.append("unknown status code: ");
|
||||
sb.append(i);
|
||||
return sb.toString();
|
||||
case 2:
|
||||
return "SERVICE_VERSION_UPDATE_REQUIRED";
|
||||
case 3:
|
||||
return "SERVICE_DISABLED";
|
||||
case 4:
|
||||
return "SIGN_IN_REQUIRED";
|
||||
case 5:
|
||||
return "INVALID_ACCOUNT";
|
||||
case 6:
|
||||
return "RESOLUTION_REQUIRED";
|
||||
case 7:
|
||||
return "NETWORK_ERROR";
|
||||
case 8:
|
||||
return "INTERNAL_ERROR";
|
||||
case 10:
|
||||
return "DEVELOPER_ERROR";
|
||||
case 13:
|
||||
return "ERROR";
|
||||
case 14:
|
||||
return "INTERRUPTED";
|
||||
case 15:
|
||||
return "TIMEOUT";
|
||||
case 16:
|
||||
return "CANCELED";
|
||||
case 17:
|
||||
return "API_NOT_CONNECTED";
|
||||
case 18:
|
||||
return "DEAD_CLIENT";
|
||||
}
|
||||
}
|
||||
}
|
67
sources/com/google/android/gms/common/api/GoogleApi.java
Normal file
67
sources/com/google/android/gms/common/api/GoogleApi.java
Normal file
@@ -0,0 +1,67 @@
|
||||
package com.google.android.gms.common.api;
|
||||
|
||||
import android.accounts.Account;
|
||||
import android.content.Context;
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import com.google.android.gms.auth.api.signin.GoogleSignInAccount;
|
||||
import com.google.android.gms.common.api.Api;
|
||||
import com.google.android.gms.common.api.Api.ApiOptions;
|
||||
import com.google.android.gms.common.api.internal.GoogleApiManager;
|
||||
import com.google.android.gms.common.api.internal.zace;
|
||||
import com.google.android.gms.common.api.internal.zai;
|
||||
import com.google.android.gms.common.internal.ClientSettings;
|
||||
import java.util.Collections;
|
||||
import java.util.Set;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class GoogleApi<O extends Api.ApiOptions> {
|
||||
private final Context a;
|
||||
private final Api<O> b;
|
||||
private final O c;
|
||||
private final zai<O> d;
|
||||
private final int e;
|
||||
|
||||
/* JADX WARN: Type inference failed for: r9v1, types: [com.google.android.gms.common.api.Api$Client] */
|
||||
public Api.Client a(Looper looper, GoogleApiManager.zaa<O> zaaVar) {
|
||||
return this.b.b().a(this.a, looper, a().a(), this.c, zaaVar, zaaVar);
|
||||
}
|
||||
|
||||
public final int b() {
|
||||
return this.e;
|
||||
}
|
||||
|
||||
public final zai<O> c() {
|
||||
return this.d;
|
||||
}
|
||||
|
||||
protected ClientSettings.Builder a() {
|
||||
Account a;
|
||||
Set<Scope> emptySet;
|
||||
GoogleSignInAccount b;
|
||||
GoogleSignInAccount b2;
|
||||
ClientSettings.Builder builder = new ClientSettings.Builder();
|
||||
O o = this.c;
|
||||
if ((o instanceof Api.ApiOptions.HasGoogleSignInAccountOptions) && (b2 = ((Api.ApiOptions.HasGoogleSignInAccountOptions) o).b()) != null) {
|
||||
a = b2.getAccount();
|
||||
} else {
|
||||
O o2 = this.c;
|
||||
a = o2 instanceof Api.ApiOptions.HasAccountOptions ? ((Api.ApiOptions.HasAccountOptions) o2).a() : null;
|
||||
}
|
||||
builder.a(a);
|
||||
O o3 = this.c;
|
||||
if ((o3 instanceof Api.ApiOptions.HasGoogleSignInAccountOptions) && (b = ((Api.ApiOptions.HasGoogleSignInAccountOptions) o3).b()) != null) {
|
||||
emptySet = b.getRequestedScopes();
|
||||
} else {
|
||||
emptySet = Collections.emptySet();
|
||||
}
|
||||
builder.a(emptySet);
|
||||
builder.a(this.a.getClass().getName());
|
||||
builder.b(this.a.getPackageName());
|
||||
return builder;
|
||||
}
|
||||
|
||||
public zace a(Context context, Handler handler) {
|
||||
return new zace(context, handler, a().a());
|
||||
}
|
||||
}
|
102
sources/com/google/android/gms/common/api/GoogleApiActivity.java
Normal file
102
sources/com/google/android/gms/common/api/GoogleApiActivity.java
Normal file
@@ -0,0 +1,102 @@
|
||||
package com.google.android.gms.common.api;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.PendingIntent;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
import android.content.IntentSender;
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
import com.google.android.gms.common.ConnectionResult;
|
||||
import com.google.android.gms.common.GoogleApiAvailability;
|
||||
import com.google.android.gms.common.annotation.KeepName;
|
||||
import com.google.android.gms.common.api.internal.GoogleApiManager;
|
||||
|
||||
@KeepName
|
||||
/* loaded from: classes.dex */
|
||||
public class GoogleApiActivity extends Activity implements DialogInterface.OnCancelListener {
|
||||
private int a = 0;
|
||||
|
||||
public static PendingIntent a(Context context, PendingIntent pendingIntent, int i) {
|
||||
return PendingIntent.getActivity(context, 0, a(context, pendingIntent, i, true), 134217728);
|
||||
}
|
||||
|
||||
@Override // android.app.Activity
|
||||
protected void onActivityResult(int i, int i2, Intent intent) {
|
||||
super.onActivityResult(i, i2, intent);
|
||||
if (i == 1) {
|
||||
boolean booleanExtra = getIntent().getBooleanExtra("notify_manager", true);
|
||||
this.a = 0;
|
||||
setResult(i2, intent);
|
||||
if (booleanExtra) {
|
||||
GoogleApiManager a = GoogleApiManager.a(this);
|
||||
if (i2 == -1) {
|
||||
a.a();
|
||||
} else if (i2 == 0) {
|
||||
a.a(new ConnectionResult(13, null), getIntent().getIntExtra("failing_client_id", -1));
|
||||
}
|
||||
}
|
||||
} else if (i == 2) {
|
||||
this.a = 0;
|
||||
setResult(i2, intent);
|
||||
}
|
||||
finish();
|
||||
}
|
||||
|
||||
@Override // android.content.DialogInterface.OnCancelListener
|
||||
public void onCancel(DialogInterface dialogInterface) {
|
||||
this.a = 0;
|
||||
setResult(0);
|
||||
finish();
|
||||
}
|
||||
|
||||
@Override // android.app.Activity
|
||||
protected void onCreate(Bundle bundle) {
|
||||
super.onCreate(bundle);
|
||||
if (bundle != null) {
|
||||
this.a = bundle.getInt("resolution");
|
||||
}
|
||||
if (this.a != 1) {
|
||||
Bundle extras = getIntent().getExtras();
|
||||
if (extras == null) {
|
||||
Log.e("GoogleApiActivity", "Activity started without extras");
|
||||
finish();
|
||||
return;
|
||||
}
|
||||
PendingIntent pendingIntent = (PendingIntent) extras.get("pending_intent");
|
||||
Integer num = (Integer) extras.get("error_code");
|
||||
if (pendingIntent == null && num == null) {
|
||||
Log.e("GoogleApiActivity", "Activity started without resolution");
|
||||
finish();
|
||||
} else {
|
||||
if (pendingIntent == null) {
|
||||
GoogleApiAvailability.a().b(this, num.intValue(), 2, this);
|
||||
this.a = 1;
|
||||
return;
|
||||
}
|
||||
try {
|
||||
startIntentSenderForResult(pendingIntent.getIntentSender(), 1, null, 0, 0, 0);
|
||||
this.a = 1;
|
||||
} catch (IntentSender.SendIntentException e) {
|
||||
Log.e("GoogleApiActivity", "Failed to launch pendingIntent", e);
|
||||
finish();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.app.Activity
|
||||
protected void onSaveInstanceState(Bundle bundle) {
|
||||
bundle.putInt("resolution", this.a);
|
||||
super.onSaveInstanceState(bundle);
|
||||
}
|
||||
|
||||
public static Intent a(Context context, PendingIntent pendingIntent, int i, boolean z) {
|
||||
Intent intent = new Intent(context, (Class<?>) GoogleApiActivity.class);
|
||||
intent.putExtra("pending_intent", pendingIntent);
|
||||
intent.putExtra("failing_client_id", i);
|
||||
intent.putExtra("notify_manager", z);
|
||||
return intent;
|
||||
}
|
||||
}
|
@@ -0,0 +1,10 @@
|
||||
package com.google.android.gms.common.api;
|
||||
|
||||
import android.os.Bundle;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public interface GoogleApiClient$ConnectionCallbacks {
|
||||
void d(Bundle bundle);
|
||||
|
||||
void i(int i);
|
||||
}
|
@@ -0,0 +1,8 @@
|
||||
package com.google.android.gms.common.api;
|
||||
|
||||
import com.google.android.gms.common.ConnectionResult;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public interface GoogleApiClient$OnConnectionFailedListener {
|
||||
void a(ConnectionResult connectionResult);
|
||||
}
|
11
sources/com/google/android/gms/common/api/PendingResult.java
Normal file
11
sources/com/google/android/gms/common/api/PendingResult.java
Normal file
@@ -0,0 +1,11 @@
|
||||
package com.google.android.gms.common.api;
|
||||
|
||||
import com.google.android.gms.common.api.Result;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public abstract class PendingResult<R extends Result> {
|
||||
|
||||
public interface StatusListener {
|
||||
void a(Status status);
|
||||
}
|
||||
}
|
@@ -0,0 +1,6 @@
|
||||
package com.google.android.gms.common.api;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public interface Releasable {
|
||||
void release();
|
||||
}
|
@@ -0,0 +1,20 @@
|
||||
package com.google.android.gms.common.api;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.PendingIntent;
|
||||
import android.content.IntentSender;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class ResolvableApiException extends ApiException {
|
||||
public ResolvableApiException(Status status) {
|
||||
super(status);
|
||||
}
|
||||
|
||||
public PendingIntent getResolution() {
|
||||
return this.mStatus.getResolution();
|
||||
}
|
||||
|
||||
public void startResolutionForResult(Activity activity, int i) throws IntentSender.SendIntentException {
|
||||
this.mStatus.startResolutionForResult(activity, i);
|
||||
}
|
||||
}
|
6
sources/com/google/android/gms/common/api/Result.java
Normal file
6
sources/com/google/android/gms/common/api/Result.java
Normal file
@@ -0,0 +1,6 @@
|
||||
package com.google.android.gms.common.api;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public interface Result {
|
||||
Status getStatus();
|
||||
}
|
@@ -0,0 +1,8 @@
|
||||
package com.google.android.gms.common.api;
|
||||
|
||||
import com.google.android.gms.common.api.Result;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public interface ResultCallback<R extends Result> {
|
||||
void a(R r);
|
||||
}
|
55
sources/com/google/android/gms/common/api/Scope.java
Normal file
55
sources/com/google/android/gms/common/api/Scope.java
Normal file
@@ -0,0 +1,55 @@
|
||||
package com.google.android.gms.common.api;
|
||||
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
import com.google.android.gms.common.internal.Preconditions;
|
||||
import com.google.android.gms.common.internal.ReflectedParcelable;
|
||||
import com.google.android.gms.common.internal.safeparcel.AbstractSafeParcelable;
|
||||
import com.google.android.gms.common.internal.safeparcel.SafeParcelWriter;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class Scope extends AbstractSafeParcelable implements ReflectedParcelable {
|
||||
public static final Parcelable.Creator<Scope> CREATOR = new zza();
|
||||
private final String zzap;
|
||||
private final int zzg;
|
||||
|
||||
Scope(int i, String str) {
|
||||
Preconditions.a(str, (Object) "scopeUri must not be null or empty");
|
||||
this.zzg = i;
|
||||
this.zzap = str;
|
||||
}
|
||||
|
||||
public final boolean equals(Object obj) {
|
||||
if (this == obj) {
|
||||
return true;
|
||||
}
|
||||
if (obj instanceof Scope) {
|
||||
return this.zzap.equals(((Scope) obj).zzap);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public final String getScopeUri() {
|
||||
return this.zzap;
|
||||
}
|
||||
|
||||
public final int hashCode() {
|
||||
return this.zzap.hashCode();
|
||||
}
|
||||
|
||||
public final String toString() {
|
||||
return this.zzap;
|
||||
}
|
||||
|
||||
@Override // android.os.Parcelable
|
||||
public final void writeToParcel(Parcel parcel, int i) {
|
||||
int a = SafeParcelWriter.a(parcel);
|
||||
SafeParcelWriter.a(parcel, 1, this.zzg);
|
||||
SafeParcelWriter.a(parcel, 2, getScopeUri(), false);
|
||||
SafeParcelWriter.a(parcel, a);
|
||||
}
|
||||
|
||||
public Scope(String str) {
|
||||
this(1, str);
|
||||
}
|
||||
}
|
119
sources/com/google/android/gms/common/api/Status.java
Normal file
119
sources/com/google/android/gms/common/api/Status.java
Normal file
@@ -0,0 +1,119 @@
|
||||
package com.google.android.gms.common.api;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.PendingIntent;
|
||||
import android.content.IntentSender;
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
import com.google.android.gms.common.internal.Objects;
|
||||
import com.google.android.gms.common.internal.ReflectedParcelable;
|
||||
import com.google.android.gms.common.internal.safeparcel.AbstractSafeParcelable;
|
||||
import com.google.android.gms.common.internal.safeparcel.SafeParcelWriter;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class Status extends AbstractSafeParcelable implements Result, ReflectedParcelable {
|
||||
private final int zzg;
|
||||
private final int zzh;
|
||||
private final PendingIntent zzi;
|
||||
private final String zzj;
|
||||
public static final Status RESULT_SUCCESS = new Status(0);
|
||||
public static final Status RESULT_INTERRUPTED = new Status(14);
|
||||
public static final Status RESULT_INTERNAL_ERROR = new Status(8);
|
||||
public static final Status RESULT_TIMEOUT = new Status(15);
|
||||
public static final Status RESULT_CANCELED = new Status(16);
|
||||
private static final Status zzaq = new Status(17);
|
||||
public static final Status RESULT_DEAD_CLIENT = new Status(18);
|
||||
public static final Parcelable.Creator<Status> CREATOR = new zzb();
|
||||
|
||||
Status(int i, int i2, String str, PendingIntent pendingIntent) {
|
||||
this.zzg = i;
|
||||
this.zzh = i2;
|
||||
this.zzj = str;
|
||||
this.zzi = pendingIntent;
|
||||
}
|
||||
|
||||
public final boolean equals(Object obj) {
|
||||
if (!(obj instanceof Status)) {
|
||||
return false;
|
||||
}
|
||||
Status status = (Status) obj;
|
||||
return this.zzg == status.zzg && this.zzh == status.zzh && Objects.a(this.zzj, status.zzj) && Objects.a(this.zzi, status.zzi);
|
||||
}
|
||||
|
||||
public final PendingIntent getResolution() {
|
||||
return this.zzi;
|
||||
}
|
||||
|
||||
@Override // com.google.android.gms.common.api.Result
|
||||
public final Status getStatus() {
|
||||
return this;
|
||||
}
|
||||
|
||||
public final int getStatusCode() {
|
||||
return this.zzh;
|
||||
}
|
||||
|
||||
public final String getStatusMessage() {
|
||||
return this.zzj;
|
||||
}
|
||||
|
||||
public final boolean hasResolution() {
|
||||
return this.zzi != null;
|
||||
}
|
||||
|
||||
public final int hashCode() {
|
||||
return Objects.a(Integer.valueOf(this.zzg), Integer.valueOf(this.zzh), this.zzj, this.zzi);
|
||||
}
|
||||
|
||||
public final boolean isCanceled() {
|
||||
return this.zzh == 16;
|
||||
}
|
||||
|
||||
public final boolean isInterrupted() {
|
||||
return this.zzh == 14;
|
||||
}
|
||||
|
||||
public final boolean isSuccess() {
|
||||
return this.zzh <= 0;
|
||||
}
|
||||
|
||||
public final void startResolutionForResult(Activity activity, int i) throws IntentSender.SendIntentException {
|
||||
if (hasResolution()) {
|
||||
activity.startIntentSenderForResult(this.zzi.getIntentSender(), i, null, 0, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
public final String toString() {
|
||||
Objects.ToStringHelper a = Objects.a(this);
|
||||
a.a("statusCode", zzg());
|
||||
a.a("resolution", this.zzi);
|
||||
return a.toString();
|
||||
}
|
||||
|
||||
@Override // android.os.Parcelable
|
||||
public final void writeToParcel(Parcel parcel, int i) {
|
||||
int a = SafeParcelWriter.a(parcel);
|
||||
SafeParcelWriter.a(parcel, 1, getStatusCode());
|
||||
SafeParcelWriter.a(parcel, 2, getStatusMessage(), false);
|
||||
SafeParcelWriter.a(parcel, 3, (Parcelable) this.zzi, i, false);
|
||||
SafeParcelWriter.a(parcel, 1000, this.zzg);
|
||||
SafeParcelWriter.a(parcel, a);
|
||||
}
|
||||
|
||||
public final String zzg() {
|
||||
String str = this.zzj;
|
||||
return str != null ? str : CommonStatusCodes.a(this.zzh);
|
||||
}
|
||||
|
||||
public Status(int i) {
|
||||
this(i, null);
|
||||
}
|
||||
|
||||
public Status(int i, String str) {
|
||||
this(1, i, str, null);
|
||||
}
|
||||
|
||||
public Status(int i, String str, PendingIntent pendingIntent) {
|
||||
this(1, i, str, pendingIntent);
|
||||
}
|
||||
}
|
@@ -0,0 +1,21 @@
|
||||
package com.google.android.gms.common.api;
|
||||
|
||||
import com.google.android.gms.common.Feature;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class UnsupportedApiCallException extends UnsupportedOperationException {
|
||||
private final Feature zzar;
|
||||
|
||||
public UnsupportedApiCallException(Feature feature) {
|
||||
this.zzar = feature;
|
||||
}
|
||||
|
||||
@Override // java.lang.Throwable
|
||||
public final String getMessage() {
|
||||
String valueOf = String.valueOf(this.zzar);
|
||||
StringBuilder sb = new StringBuilder(String.valueOf(valueOf).length() + 8);
|
||||
sb.append("Missing ");
|
||||
sb.append(valueOf);
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
@@ -0,0 +1,134 @@
|
||||
package com.google.android.gms.common.api.internal;
|
||||
|
||||
import android.annotation.TargetApi;
|
||||
import android.app.Activity;
|
||||
import android.app.ActivityManager;
|
||||
import android.app.Application;
|
||||
import android.content.ComponentCallbacks2;
|
||||
import android.content.res.Configuration;
|
||||
import android.os.Bundle;
|
||||
import com.google.android.gms.common.util.PlatformVersion;
|
||||
import java.util.ArrayList;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class BackgroundDetector implements Application.ActivityLifecycleCallbacks, ComponentCallbacks2 {
|
||||
private static final BackgroundDetector e = new BackgroundDetector();
|
||||
private final AtomicBoolean a = new AtomicBoolean();
|
||||
private final AtomicBoolean b = new AtomicBoolean();
|
||||
private final ArrayList<BackgroundStateChangeListener> c = new ArrayList<>();
|
||||
private boolean d = false;
|
||||
|
||||
public interface BackgroundStateChangeListener {
|
||||
void a(boolean z);
|
||||
}
|
||||
|
||||
private BackgroundDetector() {
|
||||
}
|
||||
|
||||
public static void a(Application application) {
|
||||
synchronized (e) {
|
||||
if (!e.d) {
|
||||
application.registerActivityLifecycleCallbacks(e);
|
||||
application.registerComponentCallbacks(e);
|
||||
e.d = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static BackgroundDetector b() {
|
||||
return e;
|
||||
}
|
||||
|
||||
@Override // android.app.Application.ActivityLifecycleCallbacks
|
||||
public final void onActivityCreated(Activity activity, Bundle bundle) {
|
||||
boolean compareAndSet = this.a.compareAndSet(true, false);
|
||||
this.b.set(true);
|
||||
if (compareAndSet) {
|
||||
b(false);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.app.Application.ActivityLifecycleCallbacks
|
||||
public final void onActivityDestroyed(Activity activity) {
|
||||
}
|
||||
|
||||
@Override // android.app.Application.ActivityLifecycleCallbacks
|
||||
public final void onActivityPaused(Activity activity) {
|
||||
}
|
||||
|
||||
@Override // android.app.Application.ActivityLifecycleCallbacks
|
||||
public final void onActivityResumed(Activity activity) {
|
||||
boolean compareAndSet = this.a.compareAndSet(true, false);
|
||||
this.b.set(true);
|
||||
if (compareAndSet) {
|
||||
b(false);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.app.Application.ActivityLifecycleCallbacks
|
||||
public final void onActivitySaveInstanceState(Activity activity, Bundle bundle) {
|
||||
}
|
||||
|
||||
@Override // android.app.Application.ActivityLifecycleCallbacks
|
||||
public final void onActivityStarted(Activity activity) {
|
||||
}
|
||||
|
||||
@Override // android.app.Application.ActivityLifecycleCallbacks
|
||||
public final void onActivityStopped(Activity activity) {
|
||||
}
|
||||
|
||||
@Override // android.content.ComponentCallbacks
|
||||
public final void onConfigurationChanged(Configuration configuration) {
|
||||
}
|
||||
|
||||
@Override // android.content.ComponentCallbacks
|
||||
public final void onLowMemory() {
|
||||
}
|
||||
|
||||
@Override // android.content.ComponentCallbacks2
|
||||
public final void onTrimMemory(int i) {
|
||||
if (i == 20 && this.a.compareAndSet(false, true)) {
|
||||
this.b.set(true);
|
||||
b(true);
|
||||
}
|
||||
}
|
||||
|
||||
private final void b(boolean z) {
|
||||
synchronized (e) {
|
||||
ArrayList<BackgroundStateChangeListener> arrayList = this.c;
|
||||
int size = arrayList.size();
|
||||
int i = 0;
|
||||
while (i < size) {
|
||||
BackgroundStateChangeListener backgroundStateChangeListener = arrayList.get(i);
|
||||
i++;
|
||||
backgroundStateChangeListener.a(z);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@TargetApi(16)
|
||||
public final boolean a(boolean z) {
|
||||
if (!this.b.get()) {
|
||||
if (!PlatformVersion.c()) {
|
||||
return z;
|
||||
}
|
||||
ActivityManager.RunningAppProcessInfo runningAppProcessInfo = new ActivityManager.RunningAppProcessInfo();
|
||||
ActivityManager.getMyMemoryState(runningAppProcessInfo);
|
||||
if (!this.b.getAndSet(true) && runningAppProcessInfo.importance > 100) {
|
||||
this.a.set(true);
|
||||
}
|
||||
}
|
||||
return a();
|
||||
}
|
||||
|
||||
public final boolean a() {
|
||||
return this.a.get();
|
||||
}
|
||||
|
||||
public final void a(BackgroundStateChangeListener backgroundStateChangeListener) {
|
||||
synchronized (e) {
|
||||
this.c.add(backgroundStateChangeListener);
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,181 @@
|
||||
package com.google.android.gms.common.api.internal;
|
||||
|
||||
import android.os.Looper;
|
||||
import android.os.Message;
|
||||
import android.util.Log;
|
||||
import android.util.Pair;
|
||||
import com.google.android.gms.common.annotation.KeepName;
|
||||
import com.google.android.gms.common.api.PendingResult;
|
||||
import com.google.android.gms.common.api.Releasable;
|
||||
import com.google.android.gms.common.api.Result;
|
||||
import com.google.android.gms.common.api.ResultCallback;
|
||||
import com.google.android.gms.common.api.Status;
|
||||
import com.google.android.gms.common.internal.Preconditions;
|
||||
import java.lang.ref.WeakReference;
|
||||
import java.util.ArrayList;
|
||||
import java.util.concurrent.CountDownLatch;
|
||||
import java.util.concurrent.atomic.AtomicReference;
|
||||
|
||||
@KeepName
|
||||
/* loaded from: classes.dex */
|
||||
public abstract class BasePendingResult<R extends Result> extends PendingResult<R> {
|
||||
private ResultCallback<? super R> e;
|
||||
private R g;
|
||||
private Status h;
|
||||
private volatile boolean i;
|
||||
private boolean j;
|
||||
private boolean k;
|
||||
private final Object a = new Object();
|
||||
private final CountDownLatch c = new CountDownLatch(1);
|
||||
private final ArrayList<PendingResult.StatusListener> d = new ArrayList<>();
|
||||
private final AtomicReference<zacs> f = new AtomicReference<>();
|
||||
private final CallbackHandler<R> b = new CallbackHandler<>(Looper.getMainLooper());
|
||||
|
||||
public static class CallbackHandler<R extends Result> extends com.google.android.gms.internal.base.zal {
|
||||
public CallbackHandler(Looper looper) {
|
||||
super(looper);
|
||||
}
|
||||
|
||||
public final void a(ResultCallback<? super R> resultCallback, R r) {
|
||||
sendMessage(obtainMessage(1, new Pair(resultCallback, r)));
|
||||
}
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
@Override // android.os.Handler
|
||||
public void handleMessage(Message message) {
|
||||
int i = message.what;
|
||||
if (i != 1) {
|
||||
if (i == 2) {
|
||||
((BasePendingResult) message.obj).b(Status.RESULT_TIMEOUT);
|
||||
return;
|
||||
}
|
||||
StringBuilder sb = new StringBuilder(45);
|
||||
sb.append("Don't know how to handle message: ");
|
||||
sb.append(i);
|
||||
Log.wtf("BasePendingResult", sb.toString(), new Exception());
|
||||
return;
|
||||
}
|
||||
Pair pair = (Pair) message.obj;
|
||||
ResultCallback resultCallback = (ResultCallback) pair.first;
|
||||
Result result = (Result) pair.second;
|
||||
try {
|
||||
resultCallback.a(result);
|
||||
} catch (RuntimeException e) {
|
||||
BasePendingResult.c(result);
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private final class zaa {
|
||||
private zaa() {
|
||||
}
|
||||
|
||||
protected final void finalize() throws Throwable {
|
||||
BasePendingResult.c(BasePendingResult.this.g);
|
||||
super.finalize();
|
||||
}
|
||||
|
||||
/* synthetic */ zaa(BasePendingResult basePendingResult, zap zapVar) {
|
||||
this();
|
||||
}
|
||||
}
|
||||
|
||||
static {
|
||||
new zap();
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
BasePendingResult() {
|
||||
new WeakReference(null);
|
||||
}
|
||||
|
||||
public static void c(Result result) {
|
||||
if (result instanceof Releasable) {
|
||||
try {
|
||||
((Releasable) result).release();
|
||||
} catch (RuntimeException e) {
|
||||
String valueOf = String.valueOf(result);
|
||||
StringBuilder sb = new StringBuilder(String.valueOf(valueOf).length() + 18);
|
||||
sb.append("Unable to release ");
|
||||
sb.append(valueOf);
|
||||
Log.w("BasePendingResult", sb.toString(), e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected abstract R a(Status status);
|
||||
|
||||
public final boolean a() {
|
||||
return this.c.getCount() == 0;
|
||||
}
|
||||
|
||||
public final void b(Status status) {
|
||||
synchronized (this.a) {
|
||||
if (!a()) {
|
||||
a((BasePendingResult<R>) a(status));
|
||||
this.k = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public final void a(R r) {
|
||||
synchronized (this.a) {
|
||||
if (this.k || this.j) {
|
||||
c(r);
|
||||
return;
|
||||
}
|
||||
a();
|
||||
boolean z = true;
|
||||
Preconditions.b(!a(), "Results have already been set");
|
||||
if (this.i) {
|
||||
z = false;
|
||||
}
|
||||
Preconditions.b(z, "Result has already been consumed");
|
||||
b((BasePendingResult<R>) r);
|
||||
}
|
||||
}
|
||||
|
||||
private final R b() {
|
||||
R r;
|
||||
synchronized (this.a) {
|
||||
Preconditions.b(!this.i, "Result has already been consumed.");
|
||||
Preconditions.b(a(), "Result is not ready.");
|
||||
r = this.g;
|
||||
this.g = null;
|
||||
this.e = null;
|
||||
this.i = true;
|
||||
}
|
||||
zacs andSet = this.f.getAndSet(null);
|
||||
if (andSet != null) {
|
||||
andSet.a(this);
|
||||
}
|
||||
return r;
|
||||
}
|
||||
|
||||
private final void b(R r) {
|
||||
this.g = r;
|
||||
this.c.countDown();
|
||||
this.h = this.g.getStatus();
|
||||
zap zapVar = null;
|
||||
if (this.j) {
|
||||
this.e = null;
|
||||
} else if (this.e == null) {
|
||||
if (this.g instanceof Releasable) {
|
||||
new zaa(this, zapVar);
|
||||
}
|
||||
} else {
|
||||
this.b.removeMessages(2);
|
||||
this.b.a(this.e, b());
|
||||
}
|
||||
ArrayList<PendingResult.StatusListener> arrayList = this.d;
|
||||
int size = arrayList.size();
|
||||
int i = 0;
|
||||
while (i < size) {
|
||||
PendingResult.StatusListener statusListener = arrayList.get(i);
|
||||
i++;
|
||||
statusListener.a(this.h);
|
||||
}
|
||||
this.d.clear();
|
||||
}
|
||||
}
|
@@ -0,0 +1,768 @@
|
||||
package com.google.android.gms.common.api.internal;
|
||||
|
||||
import android.app.Application;
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import android.os.DeadObjectException;
|
||||
import android.os.Handler;
|
||||
import android.os.HandlerThread;
|
||||
import android.os.Looper;
|
||||
import android.os.Message;
|
||||
import android.os.RemoteException;
|
||||
import android.util.Log;
|
||||
import androidx.collection.ArrayMap;
|
||||
import androidx.collection.ArraySet;
|
||||
import com.google.android.gms.common.ConnectionResult;
|
||||
import com.google.android.gms.common.Feature;
|
||||
import com.google.android.gms.common.GoogleApiAvailability;
|
||||
import com.google.android.gms.common.api.Api;
|
||||
import com.google.android.gms.common.api.GoogleApi;
|
||||
import com.google.android.gms.common.api.GoogleApiClient$ConnectionCallbacks;
|
||||
import com.google.android.gms.common.api.GoogleApiClient$OnConnectionFailedListener;
|
||||
import com.google.android.gms.common.api.Scope;
|
||||
import com.google.android.gms.common.api.Status;
|
||||
import com.google.android.gms.common.api.UnsupportedApiCallException;
|
||||
import com.google.android.gms.common.internal.BaseGmsClient;
|
||||
import com.google.android.gms.common.internal.GoogleApiAvailabilityCache;
|
||||
import com.google.android.gms.common.internal.IAccountAccessor;
|
||||
import com.google.android.gms.common.internal.Objects;
|
||||
import com.google.android.gms.common.internal.Preconditions;
|
||||
import com.google.android.gms.common.internal.SimpleClientAdapter;
|
||||
import com.google.android.gms.common.util.ArrayUtils;
|
||||
import com.google.android.gms.common.util.PlatformVersion;
|
||||
import com.google.android.gms.tasks.TaskCompletionSource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Queue;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class GoogleApiManager implements Handler.Callback {
|
||||
public static final Status m = new Status(4, "Sign-out occurred while this API call was in progress.");
|
||||
private static final Status n = new Status(4, "The user must be signed in to make this API call.");
|
||||
private static final Object o = new Object();
|
||||
private static GoogleApiManager p;
|
||||
private long a = 5000;
|
||||
private long b = 120000;
|
||||
private long c = 10000;
|
||||
private final Context d;
|
||||
private final GoogleApiAvailability e;
|
||||
private final GoogleApiAvailabilityCache f;
|
||||
private final AtomicInteger g;
|
||||
private final Map<zai<?>, zaa<?>> h;
|
||||
private zaae i;
|
||||
private final Set<zai<?>> j;
|
||||
private final Set<zai<?>> k;
|
||||
private final Handler l;
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: private */
|
||||
class zac implements zach, BaseGmsClient.ConnectionProgressReportCallbacks {
|
||||
private final Api.Client a;
|
||||
private final zai<?> b;
|
||||
private IAccountAccessor c = null;
|
||||
private Set<Scope> d = null;
|
||||
private boolean e = false;
|
||||
|
||||
public zac(Api.Client client, zai<?> zaiVar) {
|
||||
this.a = client;
|
||||
this.b = zaiVar;
|
||||
}
|
||||
|
||||
@Override // com.google.android.gms.common.internal.BaseGmsClient.ConnectionProgressReportCallbacks
|
||||
public final void a(ConnectionResult connectionResult) {
|
||||
GoogleApiManager.this.l.post(new zabo(this, connectionResult));
|
||||
}
|
||||
|
||||
@Override // com.google.android.gms.common.api.internal.zach
|
||||
public final void b(ConnectionResult connectionResult) {
|
||||
((zaa) GoogleApiManager.this.h.get(this.b)).b(connectionResult);
|
||||
}
|
||||
|
||||
@Override // com.google.android.gms.common.api.internal.zach
|
||||
public final void a(IAccountAccessor iAccountAccessor, Set<Scope> set) {
|
||||
if (iAccountAccessor == null || set == null) {
|
||||
Log.wtf("GoogleApiManager", "Received null response from onSignInSuccess", new Exception());
|
||||
b(new ConnectionResult(4));
|
||||
} else {
|
||||
this.c = iAccountAccessor;
|
||||
this.d = set;
|
||||
a();
|
||||
}
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: private */
|
||||
public final void a() {
|
||||
IAccountAccessor iAccountAccessor;
|
||||
if (!this.e || (iAccountAccessor = this.c) == null) {
|
||||
return;
|
||||
}
|
||||
this.a.a(iAccountAccessor, this.d);
|
||||
}
|
||||
|
||||
static /* synthetic */ boolean a(zac zacVar, boolean z) {
|
||||
zacVar.e = true;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
private GoogleApiManager(Context context, Looper looper, GoogleApiAvailability googleApiAvailability) {
|
||||
new AtomicInteger(1);
|
||||
this.g = new AtomicInteger(0);
|
||||
this.h = new ConcurrentHashMap(5, 0.75f, 1);
|
||||
this.i = null;
|
||||
this.j = new ArraySet();
|
||||
this.k = new ArraySet();
|
||||
this.d = context;
|
||||
this.l = new com.google.android.gms.internal.base.zal(looper, this);
|
||||
this.e = googleApiAvailability;
|
||||
this.f = new GoogleApiAvailabilityCache(googleApiAvailability);
|
||||
Handler handler = this.l;
|
||||
handler.sendMessage(handler.obtainMessage(6));
|
||||
}
|
||||
|
||||
public static GoogleApiManager a(Context context) {
|
||||
GoogleApiManager googleApiManager;
|
||||
synchronized (o) {
|
||||
if (p == null) {
|
||||
HandlerThread handlerThread = new HandlerThread("GoogleApiHandler", 9);
|
||||
handlerThread.start();
|
||||
p = new GoogleApiManager(context.getApplicationContext(), handlerThread.getLooper(), GoogleApiAvailability.a());
|
||||
}
|
||||
googleApiManager = p;
|
||||
}
|
||||
return googleApiManager;
|
||||
}
|
||||
|
||||
final boolean b(ConnectionResult connectionResult, int i) {
|
||||
return this.e.a(this.d, connectionResult, i);
|
||||
}
|
||||
|
||||
@Override // android.os.Handler.Callback
|
||||
public boolean handleMessage(Message message) {
|
||||
zaa<?> zaaVar;
|
||||
int i = message.what;
|
||||
switch (i) {
|
||||
case 1:
|
||||
this.c = ((Boolean) message.obj).booleanValue() ? 10000L : 300000L;
|
||||
this.l.removeMessages(12);
|
||||
for (zai<?> zaiVar : this.h.keySet()) {
|
||||
Handler handler = this.l;
|
||||
handler.sendMessageDelayed(handler.obtainMessage(12, zaiVar), this.c);
|
||||
}
|
||||
return true;
|
||||
case 2:
|
||||
zak zakVar = (zak) message.obj;
|
||||
Iterator<zai<?>> it = zakVar.a().iterator();
|
||||
while (true) {
|
||||
if (it.hasNext()) {
|
||||
zai<?> next = it.next();
|
||||
zaa<?> zaaVar2 = this.h.get(next);
|
||||
if (zaaVar2 == null) {
|
||||
zakVar.a(next, new ConnectionResult(13), null);
|
||||
} else if (zaaVar2.c()) {
|
||||
zakVar.a(next, ConnectionResult.RESULT_SUCCESS, zaaVar2.f().e());
|
||||
} else if (zaaVar2.k() != null) {
|
||||
zakVar.a(next, zaaVar2.k(), null);
|
||||
} else {
|
||||
zaaVar2.a(zakVar);
|
||||
zaaVar2.a();
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
case 3:
|
||||
for (zaa<?> zaaVar3 : this.h.values()) {
|
||||
zaaVar3.j();
|
||||
zaaVar3.a();
|
||||
}
|
||||
return true;
|
||||
case 4:
|
||||
case 8:
|
||||
case 13:
|
||||
zabv zabvVar = (zabv) message.obj;
|
||||
zaa<?> zaaVar4 = this.h.get(zabvVar.c.c());
|
||||
if (zaaVar4 == null) {
|
||||
a(zabvVar.c);
|
||||
zaaVar4 = this.h.get(zabvVar.c.c());
|
||||
}
|
||||
if (!zaaVar4.d() || this.g.get() == zabvVar.b) {
|
||||
zaaVar4.a(zabvVar.a);
|
||||
} else {
|
||||
zabvVar.a.a(m);
|
||||
zaaVar4.h();
|
||||
}
|
||||
return true;
|
||||
case 5:
|
||||
int i2 = message.arg1;
|
||||
ConnectionResult connectionResult = (ConnectionResult) message.obj;
|
||||
Iterator<zaa<?>> it2 = this.h.values().iterator();
|
||||
while (true) {
|
||||
if (it2.hasNext()) {
|
||||
zaaVar = it2.next();
|
||||
if (zaaVar.b() == i2) {
|
||||
}
|
||||
} else {
|
||||
zaaVar = null;
|
||||
}
|
||||
}
|
||||
if (zaaVar != null) {
|
||||
String a = this.e.a(connectionResult.getErrorCode());
|
||||
String errorMessage = connectionResult.getErrorMessage();
|
||||
StringBuilder sb = new StringBuilder(String.valueOf(a).length() + 69 + String.valueOf(errorMessage).length());
|
||||
sb.append("Error resolution was canceled by the user, original error message: ");
|
||||
sb.append(a);
|
||||
sb.append(": ");
|
||||
sb.append(errorMessage);
|
||||
zaaVar.a(new Status(17, sb.toString()));
|
||||
} else {
|
||||
StringBuilder sb2 = new StringBuilder(76);
|
||||
sb2.append("Could not find API instance ");
|
||||
sb2.append(i2);
|
||||
sb2.append(" while trying to fail enqueued calls.");
|
||||
Log.wtf("GoogleApiManager", sb2.toString(), new Exception());
|
||||
}
|
||||
return true;
|
||||
case 6:
|
||||
if (PlatformVersion.a() && (this.d.getApplicationContext() instanceof Application)) {
|
||||
BackgroundDetector.a((Application) this.d.getApplicationContext());
|
||||
BackgroundDetector.b().a(new zabi(this));
|
||||
if (!BackgroundDetector.b().a(true)) {
|
||||
this.c = 300000L;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
case 7:
|
||||
a((GoogleApi<?>) message.obj);
|
||||
return true;
|
||||
case 9:
|
||||
if (this.h.containsKey(message.obj)) {
|
||||
this.h.get(message.obj).e();
|
||||
}
|
||||
return true;
|
||||
case 10:
|
||||
Iterator<zai<?>> it3 = this.k.iterator();
|
||||
while (it3.hasNext()) {
|
||||
this.h.remove(it3.next()).h();
|
||||
}
|
||||
this.k.clear();
|
||||
return true;
|
||||
case 11:
|
||||
if (this.h.containsKey(message.obj)) {
|
||||
this.h.get(message.obj).g();
|
||||
}
|
||||
return true;
|
||||
case 12:
|
||||
if (this.h.containsKey(message.obj)) {
|
||||
this.h.get(message.obj).l();
|
||||
}
|
||||
return true;
|
||||
case 14:
|
||||
zaaf zaafVar = (zaaf) message.obj;
|
||||
zai<?> b = zaafVar.b();
|
||||
if (this.h.containsKey(b)) {
|
||||
zaafVar.a().a((TaskCompletionSource<Boolean>) Boolean.valueOf(zaa.a((zaa) this.h.get(b), false)));
|
||||
} else {
|
||||
zaafVar.a().a((TaskCompletionSource<Boolean>) false);
|
||||
}
|
||||
return true;
|
||||
case 15:
|
||||
zab zabVar = (zab) message.obj;
|
||||
if (this.h.containsKey(zabVar.a)) {
|
||||
this.h.get(zabVar.a).a(zabVar);
|
||||
}
|
||||
return true;
|
||||
case 16:
|
||||
zab zabVar2 = (zab) message.obj;
|
||||
if (this.h.containsKey(zabVar2.a)) {
|
||||
this.h.get(zabVar2.a).b(zabVar2);
|
||||
}
|
||||
return true;
|
||||
default:
|
||||
StringBuilder sb3 = new StringBuilder(31);
|
||||
sb3.append("Unknown message id: ");
|
||||
sb3.append(i);
|
||||
Log.w("GoogleApiManager", sb3.toString());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public class zaa<O extends Api.ApiOptions> implements GoogleApiClient$ConnectionCallbacks, GoogleApiClient$OnConnectionFailedListener, zar {
|
||||
private final Api.Client b;
|
||||
private final Api.AnyClient c;
|
||||
private final zai<O> d;
|
||||
private final zaab e;
|
||||
private final int h;
|
||||
private final zace i;
|
||||
private boolean j;
|
||||
private final Queue<com.google.android.gms.common.api.internal.zab> a = new LinkedList();
|
||||
private final Set<zak> f = new HashSet();
|
||||
private final Map<ListenerHolder$ListenerKey<?>, zabw> g = new HashMap();
|
||||
private final List<zab> k = new ArrayList();
|
||||
private ConnectionResult l = null;
|
||||
|
||||
public zaa(GoogleApi<O> googleApi) {
|
||||
this.b = googleApi.a(GoogleApiManager.this.l.getLooper(), this);
|
||||
Api.Client client = this.b;
|
||||
if (client instanceof SimpleClientAdapter) {
|
||||
this.c = ((SimpleClientAdapter) client).x();
|
||||
} else {
|
||||
this.c = client;
|
||||
}
|
||||
this.d = googleApi.c();
|
||||
this.e = new zaab();
|
||||
this.h = googleApi.b();
|
||||
if (this.b.i()) {
|
||||
this.i = googleApi.a(GoogleApiManager.this.d, GoogleApiManager.this.l);
|
||||
} else {
|
||||
this.i = null;
|
||||
}
|
||||
}
|
||||
|
||||
private final boolean c(ConnectionResult connectionResult) {
|
||||
synchronized (GoogleApiManager.o) {
|
||||
if (GoogleApiManager.this.i != null && GoogleApiManager.this.j.contains(this.d)) {
|
||||
GoogleApiManager.this.i.a(connectionResult, this.h);
|
||||
throw null;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: private */
|
||||
public final void m() {
|
||||
j();
|
||||
d(ConnectionResult.RESULT_SUCCESS);
|
||||
p();
|
||||
Iterator<zabw> it = this.g.values().iterator();
|
||||
while (it.hasNext()) {
|
||||
zabw next = it.next();
|
||||
if (a(next.a.b()) != null) {
|
||||
it.remove();
|
||||
} else {
|
||||
try {
|
||||
next.a.a(this.c, new TaskCompletionSource<>());
|
||||
} catch (DeadObjectException unused) {
|
||||
i(1);
|
||||
this.b.a();
|
||||
} catch (RemoteException unused2) {
|
||||
it.remove();
|
||||
}
|
||||
}
|
||||
}
|
||||
o();
|
||||
q();
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: private */
|
||||
public final void n() {
|
||||
j();
|
||||
this.j = true;
|
||||
this.e.c();
|
||||
GoogleApiManager.this.l.sendMessageDelayed(Message.obtain(GoogleApiManager.this.l, 9, this.d), GoogleApiManager.this.a);
|
||||
GoogleApiManager.this.l.sendMessageDelayed(Message.obtain(GoogleApiManager.this.l, 11, this.d), GoogleApiManager.this.b);
|
||||
GoogleApiManager.this.f.a();
|
||||
}
|
||||
|
||||
private final void o() {
|
||||
ArrayList arrayList = new ArrayList(this.a);
|
||||
int size = arrayList.size();
|
||||
int i = 0;
|
||||
while (i < size) {
|
||||
Object obj = arrayList.get(i);
|
||||
i++;
|
||||
com.google.android.gms.common.api.internal.zab zabVar = (com.google.android.gms.common.api.internal.zab) obj;
|
||||
if (!this.b.b()) {
|
||||
return;
|
||||
}
|
||||
if (b(zabVar)) {
|
||||
this.a.remove(zabVar);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private final void p() {
|
||||
if (this.j) {
|
||||
GoogleApiManager.this.l.removeMessages(11, this.d);
|
||||
GoogleApiManager.this.l.removeMessages(9, this.d);
|
||||
this.j = false;
|
||||
}
|
||||
}
|
||||
|
||||
private final void q() {
|
||||
GoogleApiManager.this.l.removeMessages(12, this.d);
|
||||
GoogleApiManager.this.l.sendMessageDelayed(GoogleApiManager.this.l.obtainMessage(12, this.d), GoogleApiManager.this.c);
|
||||
}
|
||||
|
||||
@Override // com.google.android.gms.common.api.GoogleApiClient$OnConnectionFailedListener
|
||||
public final void a(ConnectionResult connectionResult) {
|
||||
Preconditions.a(GoogleApiManager.this.l);
|
||||
zace zaceVar = this.i;
|
||||
if (zaceVar != null) {
|
||||
zaceVar.i();
|
||||
}
|
||||
j();
|
||||
GoogleApiManager.this.f.a();
|
||||
d(connectionResult);
|
||||
if (connectionResult.getErrorCode() == 4) {
|
||||
a(GoogleApiManager.n);
|
||||
return;
|
||||
}
|
||||
if (this.a.isEmpty()) {
|
||||
this.l = connectionResult;
|
||||
return;
|
||||
}
|
||||
if (c(connectionResult) || GoogleApiManager.this.b(connectionResult, this.h)) {
|
||||
return;
|
||||
}
|
||||
if (connectionResult.getErrorCode() == 18) {
|
||||
this.j = true;
|
||||
}
|
||||
if (this.j) {
|
||||
GoogleApiManager.this.l.sendMessageDelayed(Message.obtain(GoogleApiManager.this.l, 9, this.d), GoogleApiManager.this.a);
|
||||
return;
|
||||
}
|
||||
String a = this.d.a();
|
||||
StringBuilder sb = new StringBuilder(String.valueOf(a).length() + 38);
|
||||
sb.append("API: ");
|
||||
sb.append(a);
|
||||
sb.append(" is not available on this device.");
|
||||
a(new Status(17, sb.toString()));
|
||||
}
|
||||
|
||||
public final void b(ConnectionResult connectionResult) {
|
||||
Preconditions.a(GoogleApiManager.this.l);
|
||||
this.b.a();
|
||||
a(connectionResult);
|
||||
}
|
||||
|
||||
@Override // com.google.android.gms.common.api.GoogleApiClient$ConnectionCallbacks
|
||||
public final void d(Bundle bundle) {
|
||||
if (Looper.myLooper() == GoogleApiManager.this.l.getLooper()) {
|
||||
m();
|
||||
} else {
|
||||
GoogleApiManager.this.l.post(new zabj(this));
|
||||
}
|
||||
}
|
||||
|
||||
public final void e() {
|
||||
Preconditions.a(GoogleApiManager.this.l);
|
||||
if (this.j) {
|
||||
a();
|
||||
}
|
||||
}
|
||||
|
||||
public final Api.Client f() {
|
||||
return this.b;
|
||||
}
|
||||
|
||||
public final void g() {
|
||||
Preconditions.a(GoogleApiManager.this.l);
|
||||
if (this.j) {
|
||||
p();
|
||||
a(GoogleApiManager.this.e.b(GoogleApiManager.this.d) == 18 ? new Status(8, "Connection timed out while waiting for Google Play services update to complete.") : new Status(8, "API failed to connect while resuming due to an unknown error."));
|
||||
this.b.a();
|
||||
}
|
||||
}
|
||||
|
||||
public final void h() {
|
||||
Preconditions.a(GoogleApiManager.this.l);
|
||||
a(GoogleApiManager.m);
|
||||
this.e.b();
|
||||
for (ListenerHolder$ListenerKey listenerHolder$ListenerKey : (ListenerHolder$ListenerKey[]) this.g.keySet().toArray(new ListenerHolder$ListenerKey[this.g.size()])) {
|
||||
a(new zah(listenerHolder$ListenerKey, new TaskCompletionSource()));
|
||||
}
|
||||
d(new ConnectionResult(4));
|
||||
if (this.b.b()) {
|
||||
this.b.a(new zabm(this));
|
||||
}
|
||||
}
|
||||
|
||||
@Override // com.google.android.gms.common.api.GoogleApiClient$ConnectionCallbacks
|
||||
public final void i(int i) {
|
||||
if (Looper.myLooper() == GoogleApiManager.this.l.getLooper()) {
|
||||
n();
|
||||
} else {
|
||||
GoogleApiManager.this.l.post(new zabk(this));
|
||||
}
|
||||
}
|
||||
|
||||
public final void j() {
|
||||
Preconditions.a(GoogleApiManager.this.l);
|
||||
this.l = null;
|
||||
}
|
||||
|
||||
public final ConnectionResult k() {
|
||||
Preconditions.a(GoogleApiManager.this.l);
|
||||
return this.l;
|
||||
}
|
||||
|
||||
public final boolean l() {
|
||||
return a(true);
|
||||
}
|
||||
|
||||
private final boolean b(com.google.android.gms.common.api.internal.zab zabVar) {
|
||||
if (!(zabVar instanceof com.google.android.gms.common.api.internal.zac)) {
|
||||
c(zabVar);
|
||||
return true;
|
||||
}
|
||||
com.google.android.gms.common.api.internal.zac zacVar = (com.google.android.gms.common.api.internal.zac) zabVar;
|
||||
Feature a = a(zacVar.b((zaa<?>) this));
|
||||
if (a == null) {
|
||||
c(zabVar);
|
||||
return true;
|
||||
}
|
||||
if (zacVar.c(this)) {
|
||||
zab zabVar2 = new zab(this.d, a, null);
|
||||
int indexOf = this.k.indexOf(zabVar2);
|
||||
if (indexOf >= 0) {
|
||||
zab zabVar3 = this.k.get(indexOf);
|
||||
GoogleApiManager.this.l.removeMessages(15, zabVar3);
|
||||
GoogleApiManager.this.l.sendMessageDelayed(Message.obtain(GoogleApiManager.this.l, 15, zabVar3), GoogleApiManager.this.a);
|
||||
return false;
|
||||
}
|
||||
this.k.add(zabVar2);
|
||||
GoogleApiManager.this.l.sendMessageDelayed(Message.obtain(GoogleApiManager.this.l, 15, zabVar2), GoogleApiManager.this.a);
|
||||
GoogleApiManager.this.l.sendMessageDelayed(Message.obtain(GoogleApiManager.this.l, 16, zabVar2), GoogleApiManager.this.b);
|
||||
ConnectionResult connectionResult = new ConnectionResult(2, null);
|
||||
if (c(connectionResult)) {
|
||||
return false;
|
||||
}
|
||||
GoogleApiManager.this.b(connectionResult, this.h);
|
||||
return false;
|
||||
}
|
||||
zacVar.a(new UnsupportedApiCallException(a));
|
||||
return false;
|
||||
}
|
||||
|
||||
private final void d(ConnectionResult connectionResult) {
|
||||
for (zak zakVar : this.f) {
|
||||
String str = null;
|
||||
if (Objects.a(connectionResult, ConnectionResult.RESULT_SUCCESS)) {
|
||||
str = this.b.e();
|
||||
}
|
||||
zakVar.a(this.d, connectionResult, str);
|
||||
}
|
||||
this.f.clear();
|
||||
}
|
||||
|
||||
public final Map<ListenerHolder$ListenerKey<?>, zabw> i() {
|
||||
return this.g;
|
||||
}
|
||||
|
||||
private final void c(com.google.android.gms.common.api.internal.zab zabVar) {
|
||||
zabVar.a(this.e, d());
|
||||
try {
|
||||
zabVar.a((zaa<?>) this);
|
||||
} catch (DeadObjectException unused) {
|
||||
i(1);
|
||||
this.b.a();
|
||||
}
|
||||
}
|
||||
|
||||
public final boolean d() {
|
||||
return this.b.i();
|
||||
}
|
||||
|
||||
final boolean c() {
|
||||
return this.b.b();
|
||||
}
|
||||
|
||||
public final void a(com.google.android.gms.common.api.internal.zab zabVar) {
|
||||
Preconditions.a(GoogleApiManager.this.l);
|
||||
if (this.b.b()) {
|
||||
if (b(zabVar)) {
|
||||
q();
|
||||
return;
|
||||
} else {
|
||||
this.a.add(zabVar);
|
||||
return;
|
||||
}
|
||||
}
|
||||
this.a.add(zabVar);
|
||||
ConnectionResult connectionResult = this.l;
|
||||
if (connectionResult != null && connectionResult.hasResolution()) {
|
||||
a(this.l);
|
||||
} else {
|
||||
a();
|
||||
}
|
||||
}
|
||||
|
||||
public final int b() {
|
||||
return this.h;
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: private */
|
||||
public final void b(zab zabVar) {
|
||||
Feature[] b;
|
||||
if (this.k.remove(zabVar)) {
|
||||
GoogleApiManager.this.l.removeMessages(15, zabVar);
|
||||
GoogleApiManager.this.l.removeMessages(16, zabVar);
|
||||
Feature feature = zabVar.b;
|
||||
ArrayList arrayList = new ArrayList(this.a.size());
|
||||
for (com.google.android.gms.common.api.internal.zab zabVar2 : this.a) {
|
||||
if ((zabVar2 instanceof com.google.android.gms.common.api.internal.zac) && (b = ((com.google.android.gms.common.api.internal.zac) zabVar2).b((zaa<?>) this)) != null && ArrayUtils.a(b, feature)) {
|
||||
arrayList.add(zabVar2);
|
||||
}
|
||||
}
|
||||
int size = arrayList.size();
|
||||
int i = 0;
|
||||
while (i < size) {
|
||||
Object obj = arrayList.get(i);
|
||||
i++;
|
||||
com.google.android.gms.common.api.internal.zab zabVar3 = (com.google.android.gms.common.api.internal.zab) obj;
|
||||
this.a.remove(zabVar3);
|
||||
zabVar3.a(new UnsupportedApiCallException(feature));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public final void a(Status status) {
|
||||
Preconditions.a(GoogleApiManager.this.l);
|
||||
Iterator<com.google.android.gms.common.api.internal.zab> it = this.a.iterator();
|
||||
while (it.hasNext()) {
|
||||
it.next().a(status);
|
||||
}
|
||||
this.a.clear();
|
||||
}
|
||||
|
||||
private final boolean a(boolean z) {
|
||||
Preconditions.a(GoogleApiManager.this.l);
|
||||
if (!this.b.b() || this.g.size() != 0) {
|
||||
return false;
|
||||
}
|
||||
if (!this.e.a()) {
|
||||
this.b.a();
|
||||
return true;
|
||||
}
|
||||
if (z) {
|
||||
q();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public final void a() {
|
||||
Preconditions.a(GoogleApiManager.this.l);
|
||||
if (this.b.b() || this.b.d()) {
|
||||
return;
|
||||
}
|
||||
int a = GoogleApiManager.this.f.a(GoogleApiManager.this.d, this.b);
|
||||
if (a != 0) {
|
||||
a(new ConnectionResult(a, null));
|
||||
return;
|
||||
}
|
||||
zac zacVar = GoogleApiManager.this.new zac(this.b, this.d);
|
||||
if (this.b.i()) {
|
||||
this.i.a(zacVar);
|
||||
}
|
||||
this.b.a(zacVar);
|
||||
}
|
||||
|
||||
public final void a(zak zakVar) {
|
||||
Preconditions.a(GoogleApiManager.this.l);
|
||||
this.f.add(zakVar);
|
||||
}
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
private final Feature a(Feature[] featureArr) {
|
||||
if (featureArr != null && featureArr.length != 0) {
|
||||
Feature[] h = this.b.h();
|
||||
if (h == null) {
|
||||
h = new Feature[0];
|
||||
}
|
||||
ArrayMap arrayMap = new ArrayMap(h.length);
|
||||
for (Feature feature : h) {
|
||||
arrayMap.put(feature.getName(), Long.valueOf(feature.getVersion()));
|
||||
}
|
||||
for (Feature feature2 : featureArr) {
|
||||
if (!arrayMap.containsKey(feature2.getName()) || ((Long) arrayMap.get(feature2.getName())).longValue() < feature2.getVersion()) {
|
||||
return feature2;
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: private */
|
||||
public final void a(zab zabVar) {
|
||||
if (this.k.contains(zabVar) && !this.j) {
|
||||
if (!this.b.b()) {
|
||||
a();
|
||||
} else {
|
||||
o();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static /* synthetic */ boolean a(zaa zaaVar, boolean z) {
|
||||
return zaaVar.a(false);
|
||||
}
|
||||
}
|
||||
|
||||
private static class zab {
|
||||
private final zai<?> a;
|
||||
private final Feature b;
|
||||
|
||||
private zab(zai<?> zaiVar, Feature feature) {
|
||||
this.a = zaiVar;
|
||||
this.b = feature;
|
||||
}
|
||||
|
||||
public final boolean equals(Object obj) {
|
||||
if (obj != null && (obj instanceof zab)) {
|
||||
zab zabVar = (zab) obj;
|
||||
if (Objects.a(this.a, zabVar.a) && Objects.a(this.b, zabVar.b)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public final int hashCode() {
|
||||
return Objects.a(this.a, this.b);
|
||||
}
|
||||
|
||||
public final String toString() {
|
||||
Objects.ToStringHelper a = Objects.a(this);
|
||||
a.a("key", this.a);
|
||||
a.a("feature", this.b);
|
||||
return a.toString();
|
||||
}
|
||||
|
||||
/* synthetic */ zab(zai zaiVar, Feature feature, zabi zabiVar) {
|
||||
this(zaiVar, feature);
|
||||
}
|
||||
}
|
||||
|
||||
private final void a(GoogleApi<?> googleApi) {
|
||||
zai<?> c = googleApi.c();
|
||||
zaa<?> zaaVar = this.h.get(c);
|
||||
if (zaaVar == null) {
|
||||
zaaVar = new zaa<>(googleApi);
|
||||
this.h.put(c, zaaVar);
|
||||
}
|
||||
if (zaaVar.d()) {
|
||||
this.k.add(c);
|
||||
}
|
||||
zaaVar.a();
|
||||
}
|
||||
|
||||
public final void a() {
|
||||
Handler handler = this.l;
|
||||
handler.sendMessage(handler.obtainMessage(3));
|
||||
}
|
||||
|
||||
public final void a(ConnectionResult connectionResult, int i) {
|
||||
if (b(connectionResult, i)) {
|
||||
return;
|
||||
}
|
||||
Handler handler = this.l;
|
||||
handler.sendMessage(handler.obtainMessage(5, i, 0, connectionResult));
|
||||
}
|
||||
}
|
@@ -0,0 +1,75 @@
|
||||
package com.google.android.gms.common.api.internal;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.res.Resources;
|
||||
import android.text.TextUtils;
|
||||
import com.google.android.gms.common.R$string;
|
||||
import com.google.android.gms.common.api.Status;
|
||||
import com.google.android.gms.common.internal.Preconditions;
|
||||
import com.google.android.gms.common.internal.StringResourceValueReader;
|
||||
import com.google.android.gms.common.internal.zzp;
|
||||
|
||||
@Deprecated
|
||||
/* loaded from: classes.dex */
|
||||
public final class GoogleServices {
|
||||
private static final Object d = new Object();
|
||||
private static GoogleServices e;
|
||||
private final String a;
|
||||
private final Status b;
|
||||
private final boolean c;
|
||||
|
||||
GoogleServices(Context context) {
|
||||
Resources resources = context.getResources();
|
||||
int identifier = resources.getIdentifier("google_app_measurement_enable", "integer", resources.getResourcePackageName(R$string.common_google_play_services_unknown_issue));
|
||||
if (identifier != 0) {
|
||||
this.c = !(resources.getInteger(identifier) != 0);
|
||||
} else {
|
||||
this.c = false;
|
||||
}
|
||||
String a = zzp.a(context);
|
||||
a = a == null ? new StringResourceValueReader(context).a("google_app_id") : a;
|
||||
if (TextUtils.isEmpty(a)) {
|
||||
this.b = new Status(10, "Missing google app id value from from string resources with name google_app_id.");
|
||||
this.a = null;
|
||||
} else {
|
||||
this.a = a;
|
||||
this.b = Status.RESULT_SUCCESS;
|
||||
}
|
||||
}
|
||||
|
||||
public static Status a(Context context) {
|
||||
Status status;
|
||||
Preconditions.a(context, "Context must not be null.");
|
||||
synchronized (d) {
|
||||
if (e == null) {
|
||||
e = new GoogleServices(context);
|
||||
}
|
||||
status = e.b;
|
||||
}
|
||||
return status;
|
||||
}
|
||||
|
||||
public static boolean b() {
|
||||
return a("isMeasurementExplicitlyDisabled").c;
|
||||
}
|
||||
|
||||
public static String a() {
|
||||
return a("getGoogleAppId").a;
|
||||
}
|
||||
|
||||
private static GoogleServices a(String str) {
|
||||
GoogleServices googleServices;
|
||||
synchronized (d) {
|
||||
if (e != null) {
|
||||
googleServices = e;
|
||||
} else {
|
||||
StringBuilder sb = new StringBuilder(String.valueOf(str).length() + 34);
|
||||
sb.append("Initialize must be called before ");
|
||||
sb.append(str);
|
||||
sb.append(".");
|
||||
throw new IllegalStateException(sb.toString());
|
||||
}
|
||||
}
|
||||
return googleServices;
|
||||
}
|
||||
}
|
@@ -0,0 +1,5 @@
|
||||
package com.google.android.gms.common.api.internal;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class LifecycleActivity {
|
||||
}
|
@@ -0,0 +1,39 @@
|
||||
package com.google.android.gms.common.api.internal;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import androidx.annotation.Keep;
|
||||
import java.io.FileDescriptor;
|
||||
import java.io.PrintWriter;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class LifecycleCallback {
|
||||
@Keep
|
||||
private static LifecycleFragment getChimeraLifecycleFragmentImpl(LifecycleActivity lifecycleActivity) {
|
||||
throw new IllegalStateException("Method not available in SDK.");
|
||||
}
|
||||
|
||||
public void a() {
|
||||
}
|
||||
|
||||
public void a(int i, int i2, Intent intent) {
|
||||
}
|
||||
|
||||
public void a(Bundle bundle) {
|
||||
}
|
||||
|
||||
public void a(String str, FileDescriptor fileDescriptor, PrintWriter printWriter, String[] strArr) {
|
||||
}
|
||||
|
||||
public void b() {
|
||||
}
|
||||
|
||||
public void b(Bundle bundle) {
|
||||
}
|
||||
|
||||
public void c() {
|
||||
}
|
||||
|
||||
public void d() {
|
||||
}
|
||||
}
|
@@ -0,0 +1,5 @@
|
||||
package com.google.android.gms.common.api.internal;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public interface LifecycleFragment {
|
||||
}
|
@@ -0,0 +1,22 @@
|
||||
package com.google.android.gms.common.api.internal;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class ListenerHolder$ListenerKey<L> {
|
||||
private final L a;
|
||||
private final String b;
|
||||
|
||||
public final boolean equals(Object obj) {
|
||||
if (this == obj) {
|
||||
return true;
|
||||
}
|
||||
if (!(obj instanceof ListenerHolder$ListenerKey)) {
|
||||
return false;
|
||||
}
|
||||
ListenerHolder$ListenerKey listenerHolder$ListenerKey = (ListenerHolder$ListenerKey) obj;
|
||||
return this.a == listenerHolder$ListenerKey.a && this.b.equals(listenerHolder$ListenerKey.b);
|
||||
}
|
||||
|
||||
public final int hashCode() {
|
||||
return (System.identityHashCode(this.a) * 31) + this.b.hashCode();
|
||||
}
|
||||
}
|
@@ -0,0 +1,20 @@
|
||||
package com.google.android.gms.common.api.internal;
|
||||
|
||||
import android.os.RemoteException;
|
||||
import com.google.android.gms.common.Feature;
|
||||
import com.google.android.gms.common.api.Api;
|
||||
import com.google.android.gms.common.api.Api.AnyClient;
|
||||
import com.google.android.gms.tasks.TaskCompletionSource;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public abstract class RegisterListenerMethod<A extends Api.AnyClient, L> {
|
||||
public abstract void a();
|
||||
|
||||
protected abstract void a(A a, TaskCompletionSource<Void> taskCompletionSource) throws RemoteException;
|
||||
|
||||
public abstract Feature[] b();
|
||||
|
||||
public final boolean c() {
|
||||
throw null;
|
||||
}
|
||||
}
|
@@ -0,0 +1,11 @@
|
||||
package com.google.android.gms.common.api.internal;
|
||||
|
||||
import android.os.RemoteException;
|
||||
import com.google.android.gms.common.api.Api;
|
||||
import com.google.android.gms.common.api.Api.AnyClient;
|
||||
import com.google.android.gms.tasks.TaskCompletionSource;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public abstract class UnregisterListenerMethod<A extends Api.AnyClient, L> {
|
||||
protected abstract void a(A a, TaskCompletionSource<Boolean> taskCompletionSource) throws RemoteException;
|
||||
}
|
48
sources/com/google/android/gms/common/api/internal/zaab.java
Normal file
48
sources/com/google/android/gms/common/api/internal/zaab.java
Normal file
@@ -0,0 +1,48 @@
|
||||
package com.google.android.gms.common.api.internal;
|
||||
|
||||
import com.google.android.gms.common.api.ApiException;
|
||||
import com.google.android.gms.common.api.Status;
|
||||
import com.google.android.gms.tasks.TaskCompletionSource;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.WeakHashMap;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class zaab {
|
||||
private final Map<BasePendingResult<?>, Boolean> a = Collections.synchronizedMap(new WeakHashMap());
|
||||
private final Map<TaskCompletionSource<?>, Boolean> b = Collections.synchronizedMap(new WeakHashMap());
|
||||
|
||||
final boolean a() {
|
||||
return (this.a.isEmpty() && this.b.isEmpty()) ? false : true;
|
||||
}
|
||||
|
||||
public final void b() {
|
||||
a(false, GoogleApiManager.m);
|
||||
}
|
||||
|
||||
public final void c() {
|
||||
a(true, zacp.a);
|
||||
}
|
||||
|
||||
private final void a(boolean z, Status status) {
|
||||
HashMap hashMap;
|
||||
HashMap hashMap2;
|
||||
synchronized (this.a) {
|
||||
hashMap = new HashMap(this.a);
|
||||
}
|
||||
synchronized (this.b) {
|
||||
hashMap2 = new HashMap(this.b);
|
||||
}
|
||||
for (Map.Entry entry : hashMap.entrySet()) {
|
||||
if (z || ((Boolean) entry.getValue()).booleanValue()) {
|
||||
((BasePendingResult) entry.getKey()).b(status);
|
||||
}
|
||||
}
|
||||
for (Map.Entry entry2 : hashMap2.entrySet()) {
|
||||
if (z || ((Boolean) entry2.getValue()).booleanValue()) {
|
||||
((TaskCompletionSource) entry2.getKey()).b((Exception) new ApiException(status));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,5 @@
|
||||
package com.google.android.gms.common.api.internal;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class zaae extends zal {
|
||||
}
|
17
sources/com/google/android/gms/common/api/internal/zaaf.java
Normal file
17
sources/com/google/android/gms/common/api/internal/zaaf.java
Normal file
@@ -0,0 +1,17 @@
|
||||
package com.google.android.gms.common.api.internal;
|
||||
|
||||
import com.google.android.gms.tasks.TaskCompletionSource;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
final class zaaf {
|
||||
private final zai<?> a;
|
||||
private final TaskCompletionSource<Boolean> b;
|
||||
|
||||
public final TaskCompletionSource<Boolean> a() {
|
||||
return this.b;
|
||||
}
|
||||
|
||||
public final zai<?> b() {
|
||||
return this.a;
|
||||
}
|
||||
}
|
32
sources/com/google/android/gms/common/api/internal/zab.java
Normal file
32
sources/com/google/android/gms/common/api/internal/zab.java
Normal file
@@ -0,0 +1,32 @@
|
||||
package com.google.android.gms.common.api.internal;
|
||||
|
||||
import android.os.DeadObjectException;
|
||||
import android.os.RemoteException;
|
||||
import android.os.TransactionTooLargeException;
|
||||
import com.google.android.gms.common.api.Status;
|
||||
import com.google.android.gms.common.api.internal.GoogleApiManager;
|
||||
import com.google.android.gms.common.util.PlatformVersion;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public abstract class zab {
|
||||
public zab(int i) {
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: private */
|
||||
public static Status a(RemoteException remoteException) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
if (PlatformVersion.b() && (remoteException instanceof TransactionTooLargeException)) {
|
||||
sb.append("TransactionTooLargeException: ");
|
||||
}
|
||||
sb.append(remoteException.getLocalizedMessage());
|
||||
return new Status(8, sb.toString());
|
||||
}
|
||||
|
||||
public abstract void a(Status status);
|
||||
|
||||
public abstract void a(GoogleApiManager.zaa<?> zaaVar) throws DeadObjectException;
|
||||
|
||||
public abstract void a(zaab zaabVar, boolean z);
|
||||
|
||||
public abstract void a(RuntimeException runtimeException);
|
||||
}
|
17
sources/com/google/android/gms/common/api/internal/zabi.java
Normal file
17
sources/com/google/android/gms/common/api/internal/zabi.java
Normal file
@@ -0,0 +1,17 @@
|
||||
package com.google.android.gms.common.api.internal;
|
||||
|
||||
import com.google.android.gms.common.api.internal.BackgroundDetector;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
final class zabi implements BackgroundDetector.BackgroundStateChangeListener {
|
||||
private final /* synthetic */ GoogleApiManager a;
|
||||
|
||||
zabi(GoogleApiManager googleApiManager) {
|
||||
this.a = googleApiManager;
|
||||
}
|
||||
|
||||
@Override // com.google.android.gms.common.api.internal.BackgroundDetector.BackgroundStateChangeListener
|
||||
public final void a(boolean z) {
|
||||
this.a.l.sendMessage(this.a.l.obtainMessage(1, Boolean.valueOf(z)));
|
||||
}
|
||||
}
|
17
sources/com/google/android/gms/common/api/internal/zabj.java
Normal file
17
sources/com/google/android/gms/common/api/internal/zabj.java
Normal file
@@ -0,0 +1,17 @@
|
||||
package com.google.android.gms.common.api.internal;
|
||||
|
||||
import com.google.android.gms.common.api.internal.GoogleApiManager;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
final class zabj implements Runnable {
|
||||
private final /* synthetic */ GoogleApiManager.zaa a;
|
||||
|
||||
zabj(GoogleApiManager.zaa zaaVar) {
|
||||
this.a = zaaVar;
|
||||
}
|
||||
|
||||
@Override // java.lang.Runnable
|
||||
public final void run() {
|
||||
this.a.m();
|
||||
}
|
||||
}
|
17
sources/com/google/android/gms/common/api/internal/zabk.java
Normal file
17
sources/com/google/android/gms/common/api/internal/zabk.java
Normal file
@@ -0,0 +1,17 @@
|
||||
package com.google.android.gms.common.api.internal;
|
||||
|
||||
import com.google.android.gms.common.api.internal.GoogleApiManager;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
final class zabk implements Runnable {
|
||||
private final /* synthetic */ GoogleApiManager.zaa a;
|
||||
|
||||
zabk(GoogleApiManager.zaa zaaVar) {
|
||||
this.a = zaaVar;
|
||||
}
|
||||
|
||||
@Override // java.lang.Runnable
|
||||
public final void run() {
|
||||
this.a.n();
|
||||
}
|
||||
}
|
18
sources/com/google/android/gms/common/api/internal/zabm.java
Normal file
18
sources/com/google/android/gms/common/api/internal/zabm.java
Normal file
@@ -0,0 +1,18 @@
|
||||
package com.google.android.gms.common.api.internal;
|
||||
|
||||
import com.google.android.gms.common.api.internal.GoogleApiManager;
|
||||
import com.google.android.gms.common.internal.BaseGmsClient;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
final class zabm implements BaseGmsClient.SignOutCallbacks {
|
||||
final /* synthetic */ GoogleApiManager.zaa a;
|
||||
|
||||
zabm(GoogleApiManager.zaa zaaVar) {
|
||||
this.a = zaaVar;
|
||||
}
|
||||
|
||||
@Override // com.google.android.gms.common.internal.BaseGmsClient.SignOutCallbacks
|
||||
public final void a() {
|
||||
GoogleApiManager.this.l.post(new zabn(this));
|
||||
}
|
||||
}
|
19
sources/com/google/android/gms/common/api/internal/zabn.java
Normal file
19
sources/com/google/android/gms/common/api/internal/zabn.java
Normal file
@@ -0,0 +1,19 @@
|
||||
package com.google.android.gms.common.api.internal;
|
||||
|
||||
import com.google.android.gms.common.api.Api;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
final class zabn implements Runnable {
|
||||
private final /* synthetic */ zabm a;
|
||||
|
||||
zabn(zabm zabmVar) {
|
||||
this.a = zabmVar;
|
||||
}
|
||||
|
||||
@Override // java.lang.Runnable
|
||||
public final void run() {
|
||||
Api.Client client;
|
||||
client = this.a.a.b;
|
||||
client.a();
|
||||
}
|
||||
}
|
46
sources/com/google/android/gms/common/api/internal/zabo.java
Normal file
46
sources/com/google/android/gms/common/api/internal/zabo.java
Normal file
@@ -0,0 +1,46 @@
|
||||
package com.google.android.gms.common.api.internal;
|
||||
|
||||
import com.google.android.gms.common.ConnectionResult;
|
||||
import com.google.android.gms.common.api.Api;
|
||||
import com.google.android.gms.common.api.internal.GoogleApiManager;
|
||||
import java.util.Collections;
|
||||
import java.util.Map;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
final class zabo implements Runnable {
|
||||
private final /* synthetic */ ConnectionResult a;
|
||||
private final /* synthetic */ GoogleApiManager.zac b;
|
||||
|
||||
zabo(GoogleApiManager.zac zacVar, ConnectionResult connectionResult) {
|
||||
this.b = zacVar;
|
||||
this.a = connectionResult;
|
||||
}
|
||||
|
||||
@Override // java.lang.Runnable
|
||||
public final void run() {
|
||||
zai zaiVar;
|
||||
Api.Client client;
|
||||
zai zaiVar2;
|
||||
Api.Client client2;
|
||||
if (!this.a.isSuccess()) {
|
||||
Map map = GoogleApiManager.this.h;
|
||||
zaiVar = this.b.b;
|
||||
((GoogleApiManager.zaa) map.get(zaiVar)).a(this.a);
|
||||
return;
|
||||
}
|
||||
GoogleApiManager.zac.a(this.b, true);
|
||||
client = this.b.a;
|
||||
if (client.i()) {
|
||||
this.b.a();
|
||||
return;
|
||||
}
|
||||
try {
|
||||
client2 = this.b.a;
|
||||
client2.a(null, Collections.emptySet());
|
||||
} catch (SecurityException unused) {
|
||||
Map map2 = GoogleApiManager.this.h;
|
||||
zaiVar2 = this.b.b;
|
||||
((GoogleApiManager.zaa) map2.get(zaiVar2)).a(new ConnectionResult(10));
|
||||
}
|
||||
}
|
||||
}
|
28
sources/com/google/android/gms/common/api/internal/zabq.java
Normal file
28
sources/com/google/android/gms/common/api/internal/zabq.java
Normal file
@@ -0,0 +1,28 @@
|
||||
package com.google.android.gms.common.api.internal;
|
||||
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class zabq extends BroadcastReceiver {
|
||||
private Context a;
|
||||
private final zabr b;
|
||||
|
||||
public final synchronized void a() {
|
||||
if (this.a != null) {
|
||||
this.a.unregisterReceiver(this);
|
||||
}
|
||||
this.a = null;
|
||||
}
|
||||
|
||||
@Override // android.content.BroadcastReceiver
|
||||
public final void onReceive(Context context, Intent intent) {
|
||||
Uri data = intent.getData();
|
||||
if ("com.google.android.gms".equals(data != null ? data.getSchemeSpecificPart() : null)) {
|
||||
this.b.a();
|
||||
a();
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,6 @@
|
||||
package com.google.android.gms.common.api.internal;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public abstract class zabr {
|
||||
public abstract void a();
|
||||
}
|
10
sources/com/google/android/gms/common/api/internal/zabv.java
Normal file
10
sources/com/google/android/gms/common/api/internal/zabv.java
Normal file
@@ -0,0 +1,10 @@
|
||||
package com.google.android.gms.common.api.internal;
|
||||
|
||||
import com.google.android.gms.common.api.GoogleApi;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class zabv {
|
||||
public final zab a;
|
||||
public final int b;
|
||||
public final GoogleApi<?> c;
|
||||
}
|
@@ -0,0 +1,9 @@
|
||||
package com.google.android.gms.common.api.internal;
|
||||
|
||||
import com.google.android.gms.common.api.Api;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class zabw {
|
||||
public final RegisterListenerMethod<Api.AnyClient, ?> a;
|
||||
public final UnregisterListenerMethod<Api.AnyClient, ?> b;
|
||||
}
|
15
sources/com/google/android/gms/common/api/internal/zac.java
Normal file
15
sources/com/google/android/gms/common/api/internal/zac.java
Normal file
@@ -0,0 +1,15 @@
|
||||
package com.google.android.gms.common.api.internal;
|
||||
|
||||
import com.google.android.gms.common.Feature;
|
||||
import com.google.android.gms.common.api.internal.GoogleApiManager;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public abstract class zac extends zab {
|
||||
public zac(int i) {
|
||||
super(i);
|
||||
}
|
||||
|
||||
public abstract Feature[] b(GoogleApiManager.zaa<?> zaaVar);
|
||||
|
||||
public abstract boolean c(GoogleApiManager.zaa<?> zaaVar);
|
||||
}
|
114
sources/com/google/android/gms/common/api/internal/zace.java
Normal file
114
sources/com/google/android/gms/common/api/internal/zace.java
Normal file
@@ -0,0 +1,114 @@
|
||||
package com.google.android.gms.common.api.internal;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import android.util.Log;
|
||||
import com.google.android.gms.common.ConnectionResult;
|
||||
import com.google.android.gms.common.api.Api;
|
||||
import com.google.android.gms.common.api.GoogleApiClient$ConnectionCallbacks;
|
||||
import com.google.android.gms.common.api.GoogleApiClient$OnConnectionFailedListener;
|
||||
import com.google.android.gms.common.api.Scope;
|
||||
import com.google.android.gms.common.internal.ClientSettings;
|
||||
import com.google.android.gms.common.internal.Preconditions;
|
||||
import com.google.android.gms.common.internal.ResolveAccountResponse;
|
||||
import com.google.android.gms.signin.SignInOptions;
|
||||
import com.google.android.gms.signin.internal.zaj;
|
||||
import com.google.android.gms.signin.zaa;
|
||||
import java.util.Set;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class zace extends com.google.android.gms.signin.internal.zac implements GoogleApiClient$ConnectionCallbacks, GoogleApiClient$OnConnectionFailedListener {
|
||||
private static Api.AbstractClientBuilder<? extends com.google.android.gms.signin.zad, SignInOptions> h = zaa.c;
|
||||
private final Context a;
|
||||
private final Handler b;
|
||||
private final Api.AbstractClientBuilder<? extends com.google.android.gms.signin.zad, SignInOptions> c;
|
||||
private Set<Scope> d;
|
||||
private ClientSettings e;
|
||||
private com.google.android.gms.signin.zad f;
|
||||
private zach g;
|
||||
|
||||
public zace(Context context, Handler handler, ClientSettings clientSettings) {
|
||||
this(context, handler, clientSettings, h);
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: private */
|
||||
public final void b(zaj zajVar) {
|
||||
ConnectionResult connectionResult = zajVar.getConnectionResult();
|
||||
if (connectionResult.isSuccess()) {
|
||||
ResolveAccountResponse zacw = zajVar.zacw();
|
||||
ConnectionResult connectionResult2 = zacw.getConnectionResult();
|
||||
if (!connectionResult2.isSuccess()) {
|
||||
String valueOf = String.valueOf(connectionResult2);
|
||||
StringBuilder sb = new StringBuilder(String.valueOf(valueOf).length() + 48);
|
||||
sb.append("Sign-in succeeded with resolve account failure: ");
|
||||
sb.append(valueOf);
|
||||
Log.wtf("SignInCoordinator", sb.toString(), new Exception());
|
||||
this.g.b(connectionResult2);
|
||||
this.f.a();
|
||||
return;
|
||||
}
|
||||
this.g.a(zacw.getAccountAccessor(), this.d);
|
||||
} else {
|
||||
this.g.b(connectionResult);
|
||||
}
|
||||
this.f.a();
|
||||
}
|
||||
|
||||
public final void a(zach zachVar) {
|
||||
com.google.android.gms.signin.zad zadVar = this.f;
|
||||
if (zadVar != null) {
|
||||
zadVar.a();
|
||||
}
|
||||
this.e.a(Integer.valueOf(System.identityHashCode(this)));
|
||||
Api.AbstractClientBuilder<? extends com.google.android.gms.signin.zad, SignInOptions> abstractClientBuilder = this.c;
|
||||
Context context = this.a;
|
||||
Looper looper = this.b.getLooper();
|
||||
ClientSettings clientSettings = this.e;
|
||||
this.f = abstractClientBuilder.a(context, looper, clientSettings, clientSettings.h(), this, this);
|
||||
this.g = zachVar;
|
||||
Set<Scope> set = this.d;
|
||||
if (set == null || set.isEmpty()) {
|
||||
this.b.post(new zacf(this));
|
||||
} else {
|
||||
this.f.c();
|
||||
}
|
||||
}
|
||||
|
||||
@Override // com.google.android.gms.common.api.GoogleApiClient$ConnectionCallbacks
|
||||
public final void d(Bundle bundle) {
|
||||
this.f.a(this);
|
||||
}
|
||||
|
||||
public final void i() {
|
||||
com.google.android.gms.signin.zad zadVar = this.f;
|
||||
if (zadVar != null) {
|
||||
zadVar.a();
|
||||
}
|
||||
}
|
||||
|
||||
public zace(Context context, Handler handler, ClientSettings clientSettings, Api.AbstractClientBuilder<? extends com.google.android.gms.signin.zad, SignInOptions> abstractClientBuilder) {
|
||||
this.a = context;
|
||||
this.b = handler;
|
||||
Preconditions.a(clientSettings, "ClientSettings must not be null");
|
||||
this.e = clientSettings;
|
||||
this.d = clientSettings.g();
|
||||
this.c = abstractClientBuilder;
|
||||
}
|
||||
|
||||
@Override // com.google.android.gms.common.api.GoogleApiClient$ConnectionCallbacks
|
||||
public final void i(int i) {
|
||||
this.f.a();
|
||||
}
|
||||
|
||||
@Override // com.google.android.gms.common.api.GoogleApiClient$OnConnectionFailedListener
|
||||
public final void a(ConnectionResult connectionResult) {
|
||||
this.g.b(connectionResult);
|
||||
}
|
||||
|
||||
@Override // com.google.android.gms.signin.internal.zad
|
||||
public final void a(zaj zajVar) {
|
||||
this.b.post(new zacg(this, zajVar));
|
||||
}
|
||||
}
|
19
sources/com/google/android/gms/common/api/internal/zacf.java
Normal file
19
sources/com/google/android/gms/common/api/internal/zacf.java
Normal file
@@ -0,0 +1,19 @@
|
||||
package com.google.android.gms.common.api.internal;
|
||||
|
||||
import com.google.android.gms.common.ConnectionResult;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
final class zacf implements Runnable {
|
||||
private final /* synthetic */ zace a;
|
||||
|
||||
zacf(zace zaceVar) {
|
||||
this.a = zaceVar;
|
||||
}
|
||||
|
||||
@Override // java.lang.Runnable
|
||||
public final void run() {
|
||||
zach zachVar;
|
||||
zachVar = this.a.g;
|
||||
zachVar.b(new ConnectionResult(4));
|
||||
}
|
||||
}
|
19
sources/com/google/android/gms/common/api/internal/zacg.java
Normal file
19
sources/com/google/android/gms/common/api/internal/zacg.java
Normal file
@@ -0,0 +1,19 @@
|
||||
package com.google.android.gms.common.api.internal;
|
||||
|
||||
import com.google.android.gms.signin.internal.zaj;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
final class zacg implements Runnable {
|
||||
private final /* synthetic */ zaj a;
|
||||
private final /* synthetic */ zace b;
|
||||
|
||||
zacg(zace zaceVar, zaj zajVar) {
|
||||
this.b = zaceVar;
|
||||
this.a = zajVar;
|
||||
}
|
||||
|
||||
@Override // java.lang.Runnable
|
||||
public final void run() {
|
||||
this.b.b(this.a);
|
||||
}
|
||||
}
|
13
sources/com/google/android/gms/common/api/internal/zach.java
Normal file
13
sources/com/google/android/gms/common/api/internal/zach.java
Normal file
@@ -0,0 +1,13 @@
|
||||
package com.google.android.gms.common.api.internal;
|
||||
|
||||
import com.google.android.gms.common.ConnectionResult;
|
||||
import com.google.android.gms.common.api.Scope;
|
||||
import com.google.android.gms.common.internal.IAccountAccessor;
|
||||
import java.util.Set;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public interface zach {
|
||||
void a(IAccountAccessor iAccountAccessor, Set<Scope> set);
|
||||
|
||||
void b(ConnectionResult connectionResult);
|
||||
}
|
@@ -0,0 +1,8 @@
|
||||
package com.google.android.gms.common.api.internal;
|
||||
|
||||
import com.google.android.gms.common.api.Status;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class zacp {
|
||||
public static final Status a = new Status(8, "The connection to Google Play services was lost");
|
||||
}
|
@@ -0,0 +1,6 @@
|
||||
package com.google.android.gms.common.api.internal;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
interface zacs {
|
||||
void a(BasePendingResult<?> basePendingResult);
|
||||
}
|
48
sources/com/google/android/gms/common/api/internal/zad.java
Normal file
48
sources/com/google/android/gms/common/api/internal/zad.java
Normal file
@@ -0,0 +1,48 @@
|
||||
package com.google.android.gms.common.api.internal;
|
||||
|
||||
import android.os.DeadObjectException;
|
||||
import android.os.RemoteException;
|
||||
import com.google.android.gms.common.api.ApiException;
|
||||
import com.google.android.gms.common.api.Status;
|
||||
import com.google.android.gms.common.api.internal.GoogleApiManager;
|
||||
import com.google.android.gms.tasks.TaskCompletionSource;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
abstract class zad<T> extends zac {
|
||||
protected final TaskCompletionSource<T> a;
|
||||
|
||||
public zad(int i, TaskCompletionSource<T> taskCompletionSource) {
|
||||
super(i);
|
||||
this.a = taskCompletionSource;
|
||||
}
|
||||
|
||||
@Override // com.google.android.gms.common.api.internal.zab
|
||||
public void a(Status status) {
|
||||
this.a.b(new ApiException(status));
|
||||
}
|
||||
|
||||
protected abstract void d(GoogleApiManager.zaa<?> zaaVar) throws RemoteException;
|
||||
|
||||
@Override // com.google.android.gms.common.api.internal.zab
|
||||
public void a(RuntimeException runtimeException) {
|
||||
this.a.b(runtimeException);
|
||||
}
|
||||
|
||||
@Override // com.google.android.gms.common.api.internal.zab
|
||||
public final void a(GoogleApiManager.zaa<?> zaaVar) throws DeadObjectException {
|
||||
Status a;
|
||||
Status a2;
|
||||
try {
|
||||
d(zaaVar);
|
||||
} catch (DeadObjectException e) {
|
||||
a2 = zab.a(e);
|
||||
a(a2);
|
||||
throw e;
|
||||
} catch (RemoteException e2) {
|
||||
a = zab.a(e2);
|
||||
a(a);
|
||||
} catch (RuntimeException e3) {
|
||||
a(e3);
|
||||
}
|
||||
}
|
||||
}
|
46
sources/com/google/android/gms/common/api/internal/zah.java
Normal file
46
sources/com/google/android/gms/common/api/internal/zah.java
Normal file
@@ -0,0 +1,46 @@
|
||||
package com.google.android.gms.common.api.internal;
|
||||
|
||||
import android.os.RemoteException;
|
||||
import com.google.android.gms.common.Feature;
|
||||
import com.google.android.gms.common.api.internal.GoogleApiManager;
|
||||
import com.google.android.gms.tasks.TaskCompletionSource;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class zah extends zad<Boolean> {
|
||||
private final ListenerHolder$ListenerKey<?> b;
|
||||
|
||||
public zah(ListenerHolder$ListenerKey<?> listenerHolder$ListenerKey, TaskCompletionSource<Boolean> taskCompletionSource) {
|
||||
super(4, taskCompletionSource);
|
||||
this.b = listenerHolder$ListenerKey;
|
||||
}
|
||||
|
||||
@Override // com.google.android.gms.common.api.internal.zab
|
||||
public final /* bridge */ /* synthetic */ void a(zaab zaabVar, boolean z) {
|
||||
}
|
||||
|
||||
@Override // com.google.android.gms.common.api.internal.zac
|
||||
public final Feature[] b(GoogleApiManager.zaa<?> zaaVar) {
|
||||
zabw zabwVar = zaaVar.i().get(this.b);
|
||||
if (zabwVar == null) {
|
||||
return null;
|
||||
}
|
||||
return zabwVar.a.b();
|
||||
}
|
||||
|
||||
@Override // com.google.android.gms.common.api.internal.zac
|
||||
public final boolean c(GoogleApiManager.zaa<?> zaaVar) {
|
||||
zabw zabwVar = zaaVar.i().get(this.b);
|
||||
return zabwVar != null && zabwVar.a.c();
|
||||
}
|
||||
|
||||
@Override // com.google.android.gms.common.api.internal.zad
|
||||
public final void d(GoogleApiManager.zaa<?> zaaVar) throws RemoteException {
|
||||
zabw remove = zaaVar.i().remove(this.b);
|
||||
if (remove == null) {
|
||||
this.a.b((TaskCompletionSource<T>) false);
|
||||
} else {
|
||||
remove.b.a(zaaVar.f(), this.a);
|
||||
remove.a.a();
|
||||
}
|
||||
}
|
||||
}
|
32
sources/com/google/android/gms/common/api/internal/zai.java
Normal file
32
sources/com/google/android/gms/common/api/internal/zai.java
Normal file
@@ -0,0 +1,32 @@
|
||||
package com.google.android.gms.common.api.internal;
|
||||
|
||||
import com.google.android.gms.common.api.Api;
|
||||
import com.google.android.gms.common.api.Api.ApiOptions;
|
||||
import com.google.android.gms.common.internal.Objects;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class zai<O extends Api.ApiOptions> {
|
||||
private final boolean a;
|
||||
private final int b;
|
||||
private final Api<O> c;
|
||||
private final O d;
|
||||
|
||||
public final String a() {
|
||||
return this.c.a();
|
||||
}
|
||||
|
||||
public final boolean equals(Object obj) {
|
||||
if (obj == this) {
|
||||
return true;
|
||||
}
|
||||
if (!(obj instanceof zai)) {
|
||||
return false;
|
||||
}
|
||||
zai zaiVar = (zai) obj;
|
||||
return !this.a && !zaiVar.a && Objects.a(this.c, zaiVar.c) && Objects.a(this.d, zaiVar.d);
|
||||
}
|
||||
|
||||
public final int hashCode() {
|
||||
return this.b;
|
||||
}
|
||||
}
|
37
sources/com/google/android/gms/common/api/internal/zak.java
Normal file
37
sources/com/google/android/gms/common/api/internal/zak.java
Normal file
@@ -0,0 +1,37 @@
|
||||
package com.google.android.gms.common.api.internal;
|
||||
|
||||
import androidx.collection.ArrayMap;
|
||||
import com.google.android.gms.common.ConnectionResult;
|
||||
import com.google.android.gms.common.api.AvailabilityException;
|
||||
import com.google.android.gms.tasks.TaskCompletionSource;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class zak {
|
||||
private final ArrayMap<zai<?>, ConnectionResult> a;
|
||||
private final ArrayMap<zai<?>, String> b;
|
||||
private final TaskCompletionSource<Map<zai<?>, String>> c;
|
||||
private int d;
|
||||
private boolean e;
|
||||
|
||||
public final Set<zai<?>> a() {
|
||||
return this.a.keySet();
|
||||
}
|
||||
|
||||
public final void a(zai<?> zaiVar, ConnectionResult connectionResult, String str) {
|
||||
this.a.put(zaiVar, connectionResult);
|
||||
this.b.put(zaiVar, str);
|
||||
this.d--;
|
||||
if (!connectionResult.isSuccess()) {
|
||||
this.e = true;
|
||||
}
|
||||
if (this.d == 0) {
|
||||
if (!this.e) {
|
||||
this.c.a((TaskCompletionSource<Map<zai<?>, String>>) this.b);
|
||||
} else {
|
||||
this.c.a(new AvailabilityException(this.a));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
11
sources/com/google/android/gms/common/api/internal/zal.java
Normal file
11
sources/com/google/android/gms/common/api/internal/zal.java
Normal file
@@ -0,0 +1,11 @@
|
||||
package com.google.android.gms.common.api.internal;
|
||||
|
||||
import android.content.DialogInterface;
|
||||
import com.google.android.gms.common.ConnectionResult;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public abstract class zal extends LifecycleCallback implements DialogInterface.OnCancelListener {
|
||||
public final void a(ConnectionResult connectionResult, int i) {
|
||||
throw null;
|
||||
}
|
||||
}
|
12
sources/com/google/android/gms/common/api/internal/zap.java
Normal file
12
sources/com/google/android/gms/common/api/internal/zap.java
Normal file
@@ -0,0 +1,12 @@
|
||||
package com.google.android.gms.common.api.internal;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
final class zap extends ThreadLocal<Boolean> {
|
||||
zap() {
|
||||
}
|
||||
|
||||
@Override // java.lang.ThreadLocal
|
||||
protected final /* synthetic */ Boolean initialValue() {
|
||||
return false;
|
||||
}
|
||||
}
|
@@ -0,0 +1,7 @@
|
||||
package com.google.android.gms.common.api.internal;
|
||||
|
||||
import com.google.android.gms.common.api.GoogleApiClient$ConnectionCallbacks;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public interface zar extends GoogleApiClient$ConnectionCallbacks {
|
||||
}
|
95
sources/com/google/android/gms/common/api/internal/zza.java
Normal file
95
sources/com/google/android/gms/common/api/internal/zza.java
Normal file
@@ -0,0 +1,95 @@
|
||||
package com.google.android.gms.common.api.internal;
|
||||
|
||||
import android.app.Fragment;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import androidx.collection.ArrayMap;
|
||||
import java.io.FileDescriptor;
|
||||
import java.io.PrintWriter;
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
import java.util.WeakHashMap;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class zza extends Fragment implements LifecycleFragment {
|
||||
private Map<String, LifecycleCallback> a = new ArrayMap();
|
||||
|
||||
static {
|
||||
new WeakHashMap();
|
||||
}
|
||||
|
||||
@Override // android.app.Fragment
|
||||
public final void dump(String str, FileDescriptor fileDescriptor, PrintWriter printWriter, String[] strArr) {
|
||||
super.dump(str, fileDescriptor, printWriter, strArr);
|
||||
Iterator<LifecycleCallback> it = this.a.values().iterator();
|
||||
while (it.hasNext()) {
|
||||
it.next().a(str, fileDescriptor, printWriter, strArr);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.app.Fragment
|
||||
public final void onActivityResult(int i, int i2, Intent intent) {
|
||||
super.onActivityResult(i, i2, intent);
|
||||
Iterator<LifecycleCallback> it = this.a.values().iterator();
|
||||
while (it.hasNext()) {
|
||||
it.next().a(i, i2, intent);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.app.Fragment
|
||||
public final void onCreate(Bundle bundle) {
|
||||
super.onCreate(bundle);
|
||||
for (Map.Entry<String, LifecycleCallback> entry : this.a.entrySet()) {
|
||||
entry.getValue().a(bundle != null ? bundle.getBundle(entry.getKey()) : null);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.app.Fragment
|
||||
public final void onDestroy() {
|
||||
super.onDestroy();
|
||||
Iterator<LifecycleCallback> it = this.a.values().iterator();
|
||||
while (it.hasNext()) {
|
||||
it.next().a();
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.app.Fragment
|
||||
public final void onResume() {
|
||||
super.onResume();
|
||||
Iterator<LifecycleCallback> it = this.a.values().iterator();
|
||||
while (it.hasNext()) {
|
||||
it.next().b();
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.app.Fragment
|
||||
public final void onSaveInstanceState(Bundle bundle) {
|
||||
super.onSaveInstanceState(bundle);
|
||||
if (bundle == null) {
|
||||
return;
|
||||
}
|
||||
for (Map.Entry<String, LifecycleCallback> entry : this.a.entrySet()) {
|
||||
Bundle bundle2 = new Bundle();
|
||||
entry.getValue().b(bundle2);
|
||||
bundle.putBundle(entry.getKey(), bundle2);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.app.Fragment
|
||||
public final void onStart() {
|
||||
super.onStart();
|
||||
Iterator<LifecycleCallback> it = this.a.values().iterator();
|
||||
while (it.hasNext()) {
|
||||
it.next().c();
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.app.Fragment
|
||||
public final void onStop() {
|
||||
super.onStop();
|
||||
Iterator<LifecycleCallback> it = this.a.values().iterator();
|
||||
while (it.hasNext()) {
|
||||
it.next().d();
|
||||
}
|
||||
}
|
||||
}
|
33
sources/com/google/android/gms/common/api/zza.java
Normal file
33
sources/com/google/android/gms/common/api/zza.java
Normal file
@@ -0,0 +1,33 @@
|
||||
package com.google.android.gms.common.api;
|
||||
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
import com.google.android.gms.common.internal.safeparcel.SafeParcelReader;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class zza implements Parcelable.Creator<Scope> {
|
||||
@Override // android.os.Parcelable.Creator
|
||||
public final /* synthetic */ Scope createFromParcel(Parcel parcel) {
|
||||
int b = SafeParcelReader.b(parcel);
|
||||
int i = 0;
|
||||
String str = null;
|
||||
while (parcel.dataPosition() < b) {
|
||||
int a = SafeParcelReader.a(parcel);
|
||||
int a2 = SafeParcelReader.a(a);
|
||||
if (a2 == 1) {
|
||||
i = SafeParcelReader.x(parcel, a);
|
||||
} else if (a2 != 2) {
|
||||
SafeParcelReader.C(parcel, a);
|
||||
} else {
|
||||
str = SafeParcelReader.n(parcel, a);
|
||||
}
|
||||
}
|
||||
SafeParcelReader.q(parcel, b);
|
||||
return new Scope(i, str);
|
||||
}
|
||||
|
||||
@Override // android.os.Parcelable.Creator
|
||||
public final /* synthetic */ Scope[] newArray(int i) {
|
||||
return new Scope[i];
|
||||
}
|
||||
}
|
40
sources/com/google/android/gms/common/api/zzb.java
Normal file
40
sources/com/google/android/gms/common/api/zzb.java
Normal file
@@ -0,0 +1,40 @@
|
||||
package com.google.android.gms.common.api;
|
||||
|
||||
import android.app.PendingIntent;
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
import com.google.android.gms.common.internal.safeparcel.SafeParcelReader;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class zzb implements Parcelable.Creator<Status> {
|
||||
@Override // android.os.Parcelable.Creator
|
||||
public final /* synthetic */ Status createFromParcel(Parcel parcel) {
|
||||
int b = SafeParcelReader.b(parcel);
|
||||
int i = 0;
|
||||
String str = null;
|
||||
PendingIntent pendingIntent = null;
|
||||
int i2 = 0;
|
||||
while (parcel.dataPosition() < b) {
|
||||
int a = SafeParcelReader.a(parcel);
|
||||
int a2 = SafeParcelReader.a(a);
|
||||
if (a2 == 1) {
|
||||
i2 = SafeParcelReader.x(parcel, a);
|
||||
} else if (a2 == 2) {
|
||||
str = SafeParcelReader.n(parcel, a);
|
||||
} else if (a2 == 3) {
|
||||
pendingIntent = (PendingIntent) SafeParcelReader.a(parcel, a, PendingIntent.CREATOR);
|
||||
} else if (a2 != 1000) {
|
||||
SafeParcelReader.C(parcel, a);
|
||||
} else {
|
||||
i = SafeParcelReader.x(parcel, a);
|
||||
}
|
||||
}
|
||||
SafeParcelReader.q(parcel, b);
|
||||
return new Status(i, i2, str, pendingIntent);
|
||||
}
|
||||
|
||||
@Override // android.os.Parcelable.Creator
|
||||
public final /* synthetic */ Status[] newArray(int i) {
|
||||
return new Status[i];
|
||||
}
|
||||
}
|
149
sources/com/google/android/gms/common/data/BitmapTeleporter.java
Normal file
149
sources/com/google/android/gms/common/data/BitmapTeleporter.java
Normal file
@@ -0,0 +1,149 @@
|
||||
package com.google.android.gms.common.data;
|
||||
|
||||
import android.graphics.Bitmap;
|
||||
import android.os.Parcel;
|
||||
import android.os.ParcelFileDescriptor;
|
||||
import android.os.Parcelable;
|
||||
import android.util.Log;
|
||||
import com.google.android.gms.common.internal.ReflectedParcelable;
|
||||
import com.google.android.gms.common.internal.safeparcel.AbstractSafeParcelable;
|
||||
import com.google.android.gms.common.internal.safeparcel.SafeParcelWriter;
|
||||
import java.io.BufferedOutputStream;
|
||||
import java.io.Closeable;
|
||||
import java.io.DataInputStream;
|
||||
import java.io.DataOutputStream;
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.nio.ByteBuffer;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class BitmapTeleporter extends AbstractSafeParcelable implements ReflectedParcelable {
|
||||
public static final Parcelable.Creator<BitmapTeleporter> CREATOR = new zaa();
|
||||
private final int mType;
|
||||
private final int zale;
|
||||
private ParcelFileDescriptor zalf;
|
||||
private Bitmap zalg;
|
||||
private boolean zalh;
|
||||
private File zali;
|
||||
|
||||
BitmapTeleporter(int i, ParcelFileDescriptor parcelFileDescriptor, int i2) {
|
||||
this.zale = i;
|
||||
this.zalf = parcelFileDescriptor;
|
||||
this.mType = i2;
|
||||
this.zalg = null;
|
||||
this.zalh = false;
|
||||
}
|
||||
|
||||
private static void zaa(Closeable closeable) {
|
||||
try {
|
||||
closeable.close();
|
||||
} catch (IOException e) {
|
||||
Log.w("BitmapTeleporter", "Could not close stream", e);
|
||||
}
|
||||
}
|
||||
|
||||
private final FileOutputStream zabz() {
|
||||
File file = this.zali;
|
||||
if (file == null) {
|
||||
throw new IllegalStateException("setTempDir() must be called before writing this object to a parcel");
|
||||
}
|
||||
try {
|
||||
File createTempFile = File.createTempFile("teleporter", ".tmp", file);
|
||||
try {
|
||||
FileOutputStream fileOutputStream = new FileOutputStream(createTempFile);
|
||||
this.zalf = ParcelFileDescriptor.open(createTempFile, 268435456);
|
||||
createTempFile.delete();
|
||||
return fileOutputStream;
|
||||
} catch (FileNotFoundException unused) {
|
||||
throw new IllegalStateException("Temporary file is somehow already deleted");
|
||||
}
|
||||
} catch (IOException e) {
|
||||
throw new IllegalStateException("Could not create temporary file", e);
|
||||
}
|
||||
}
|
||||
|
||||
public Bitmap get() {
|
||||
if (!this.zalh) {
|
||||
DataInputStream dataInputStream = new DataInputStream(new ParcelFileDescriptor.AutoCloseInputStream(this.zalf));
|
||||
try {
|
||||
try {
|
||||
byte[] bArr = new byte[dataInputStream.readInt()];
|
||||
int readInt = dataInputStream.readInt();
|
||||
int readInt2 = dataInputStream.readInt();
|
||||
Bitmap.Config valueOf = Bitmap.Config.valueOf(dataInputStream.readUTF());
|
||||
dataInputStream.read(bArr);
|
||||
zaa(dataInputStream);
|
||||
ByteBuffer wrap = ByteBuffer.wrap(bArr);
|
||||
Bitmap createBitmap = Bitmap.createBitmap(readInt, readInt2, valueOf);
|
||||
createBitmap.copyPixelsFromBuffer(wrap);
|
||||
this.zalg = createBitmap;
|
||||
this.zalh = true;
|
||||
} catch (IOException e) {
|
||||
throw new IllegalStateException("Could not read from parcel file descriptor", e);
|
||||
}
|
||||
} catch (Throwable th) {
|
||||
zaa(dataInputStream);
|
||||
throw th;
|
||||
}
|
||||
}
|
||||
return this.zalg;
|
||||
}
|
||||
|
||||
public void release() {
|
||||
if (this.zalh) {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
this.zalf.close();
|
||||
} catch (IOException e) {
|
||||
Log.w("BitmapTeleporter", "Could not close PFD", e);
|
||||
}
|
||||
}
|
||||
|
||||
public void setTempDir(File file) {
|
||||
if (file == null) {
|
||||
throw new NullPointerException("Cannot set null temp directory");
|
||||
}
|
||||
this.zali = file;
|
||||
}
|
||||
|
||||
@Override // android.os.Parcelable
|
||||
public void writeToParcel(Parcel parcel, int i) {
|
||||
if (this.zalf == null) {
|
||||
Bitmap bitmap = this.zalg;
|
||||
ByteBuffer allocate = ByteBuffer.allocate(bitmap.getRowBytes() * bitmap.getHeight());
|
||||
bitmap.copyPixelsToBuffer(allocate);
|
||||
byte[] array = allocate.array();
|
||||
DataOutputStream dataOutputStream = new DataOutputStream(new BufferedOutputStream(zabz()));
|
||||
try {
|
||||
try {
|
||||
dataOutputStream.writeInt(array.length);
|
||||
dataOutputStream.writeInt(bitmap.getWidth());
|
||||
dataOutputStream.writeInt(bitmap.getHeight());
|
||||
dataOutputStream.writeUTF(bitmap.getConfig().toString());
|
||||
dataOutputStream.write(array);
|
||||
} catch (IOException e) {
|
||||
throw new IllegalStateException("Could not write into unlinked file", e);
|
||||
}
|
||||
} finally {
|
||||
zaa(dataOutputStream);
|
||||
}
|
||||
}
|
||||
int a = SafeParcelWriter.a(parcel);
|
||||
SafeParcelWriter.a(parcel, 1, this.zale);
|
||||
SafeParcelWriter.a(parcel, 2, (Parcelable) this.zalf, i | 1, false);
|
||||
SafeParcelWriter.a(parcel, 3, this.mType);
|
||||
SafeParcelWriter.a(parcel, a);
|
||||
this.zalf = null;
|
||||
}
|
||||
|
||||
public BitmapTeleporter(Bitmap bitmap) {
|
||||
this.zale = 1;
|
||||
this.zalf = null;
|
||||
this.mType = 0;
|
||||
this.zalg = bitmap;
|
||||
this.zalh = true;
|
||||
}
|
||||
}
|
416
sources/com/google/android/gms/common/data/DataHolder.java
Normal file
416
sources/com/google/android/gms/common/data/DataHolder.java
Normal file
@@ -0,0 +1,416 @@
|
||||
package com.google.android.gms.common.data;
|
||||
|
||||
import android.database.CharArrayBuffer;
|
||||
import android.database.Cursor;
|
||||
import android.database.CursorIndexOutOfBoundsException;
|
||||
import android.database.CursorWindow;
|
||||
import android.os.Bundle;
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
import android.util.Log;
|
||||
import com.google.android.gms.common.annotation.KeepName;
|
||||
import com.google.android.gms.common.internal.Preconditions;
|
||||
import com.google.android.gms.common.internal.safeparcel.AbstractSafeParcelable;
|
||||
import com.google.android.gms.common.internal.safeparcel.SafeParcelWriter;
|
||||
import com.google.android.gms.common.sqlite.CursorWrapper;
|
||||
import java.io.Closeable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@KeepName
|
||||
/* loaded from: classes.dex */
|
||||
public final class DataHolder extends AbstractSafeParcelable implements Closeable {
|
||||
public static final Parcelable.Creator<DataHolder> CREATOR = new zac();
|
||||
private static final Builder zalx = new zab(new String[0], null);
|
||||
private boolean mClosed;
|
||||
private final int zale;
|
||||
private final String[] zalp;
|
||||
private Bundle zalq;
|
||||
private final CursorWindow[] zalr;
|
||||
private final int zals;
|
||||
private final Bundle zalt;
|
||||
private int[] zalu;
|
||||
private int zalv;
|
||||
private boolean zalw;
|
||||
|
||||
public static class zaa extends RuntimeException {
|
||||
public zaa(String str) {
|
||||
super(str);
|
||||
}
|
||||
}
|
||||
|
||||
DataHolder(int i, String[] strArr, CursorWindow[] cursorWindowArr, int i2, Bundle bundle) {
|
||||
this.mClosed = false;
|
||||
this.zalw = true;
|
||||
this.zale = i;
|
||||
this.zalp = strArr;
|
||||
this.zalr = cursorWindowArr;
|
||||
this.zals = i2;
|
||||
this.zalt = bundle;
|
||||
}
|
||||
|
||||
public static Builder builder(String[] strArr) {
|
||||
return new Builder(strArr, null, 0 == true ? 1 : 0);
|
||||
}
|
||||
|
||||
public static DataHolder empty(int i) {
|
||||
return new DataHolder(zalx, i, (Bundle) null);
|
||||
}
|
||||
|
||||
private static CursorWindow[] zaa(CursorWrapper cursorWrapper) {
|
||||
int i;
|
||||
ArrayList arrayList = new ArrayList();
|
||||
try {
|
||||
int count = cursorWrapper.getCount();
|
||||
CursorWindow window = cursorWrapper.getWindow();
|
||||
if (window == null || window.getStartPosition() != 0) {
|
||||
i = 0;
|
||||
} else {
|
||||
window.acquireReference();
|
||||
cursorWrapper.a(null);
|
||||
arrayList.add(window);
|
||||
i = window.getNumRows();
|
||||
}
|
||||
while (i < count) {
|
||||
if (!cursorWrapper.moveToPosition(i)) {
|
||||
break;
|
||||
}
|
||||
CursorWindow window2 = cursorWrapper.getWindow();
|
||||
if (window2 != null) {
|
||||
window2.acquireReference();
|
||||
cursorWrapper.a(null);
|
||||
} else {
|
||||
window2 = new CursorWindow(false);
|
||||
window2.setStartPosition(i);
|
||||
cursorWrapper.fillWindow(i, window2);
|
||||
}
|
||||
if (window2.getNumRows() == 0) {
|
||||
break;
|
||||
}
|
||||
arrayList.add(window2);
|
||||
i = window2.getStartPosition() + window2.getNumRows();
|
||||
}
|
||||
cursorWrapper.close();
|
||||
return (CursorWindow[]) arrayList.toArray(new CursorWindow[arrayList.size()]);
|
||||
} catch (Throwable th) {
|
||||
cursorWrapper.close();
|
||||
throw th;
|
||||
}
|
||||
}
|
||||
|
||||
@Override // java.io.Closeable, java.lang.AutoCloseable
|
||||
public final void close() {
|
||||
synchronized (this) {
|
||||
if (!this.mClosed) {
|
||||
this.mClosed = true;
|
||||
for (int i = 0; i < this.zalr.length; i++) {
|
||||
this.zalr[i].close();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected final void finalize() throws Throwable {
|
||||
try {
|
||||
if (this.zalw && this.zalr.length > 0 && !isClosed()) {
|
||||
close();
|
||||
String obj = toString();
|
||||
StringBuilder sb = new StringBuilder(String.valueOf(obj).length() + 178);
|
||||
sb.append("Internal data leak within a DataBuffer object detected! Be sure to explicitly call release() on all DataBuffer extending objects when you are done with them. (internal object: ");
|
||||
sb.append(obj);
|
||||
sb.append(")");
|
||||
Log.e("DataBuffer", sb.toString());
|
||||
}
|
||||
} finally {
|
||||
super.finalize();
|
||||
}
|
||||
}
|
||||
|
||||
public final boolean getBoolean(String str, int i, int i2) {
|
||||
zaa(str, i);
|
||||
return Long.valueOf(this.zalr[i2].getLong(i, this.zalq.getInt(str))).longValue() == 1;
|
||||
}
|
||||
|
||||
public final byte[] getByteArray(String str, int i, int i2) {
|
||||
zaa(str, i);
|
||||
return this.zalr[i2].getBlob(i, this.zalq.getInt(str));
|
||||
}
|
||||
|
||||
public final int getCount() {
|
||||
return this.zalv;
|
||||
}
|
||||
|
||||
public final int getInteger(String str, int i, int i2) {
|
||||
zaa(str, i);
|
||||
return this.zalr[i2].getInt(i, this.zalq.getInt(str));
|
||||
}
|
||||
|
||||
public final long getLong(String str, int i, int i2) {
|
||||
zaa(str, i);
|
||||
return this.zalr[i2].getLong(i, this.zalq.getInt(str));
|
||||
}
|
||||
|
||||
public final Bundle getMetadata() {
|
||||
return this.zalt;
|
||||
}
|
||||
|
||||
public final int getStatusCode() {
|
||||
return this.zals;
|
||||
}
|
||||
|
||||
public final String getString(String str, int i, int i2) {
|
||||
zaa(str, i);
|
||||
return this.zalr[i2].getString(i, this.zalq.getInt(str));
|
||||
}
|
||||
|
||||
public final int getWindowIndex(int i) {
|
||||
int i2 = 0;
|
||||
Preconditions.b(i >= 0 && i < this.zalv);
|
||||
while (true) {
|
||||
int[] iArr = this.zalu;
|
||||
if (i2 >= iArr.length) {
|
||||
break;
|
||||
}
|
||||
if (i < iArr[i2]) {
|
||||
i2--;
|
||||
break;
|
||||
}
|
||||
i2++;
|
||||
}
|
||||
return i2 == this.zalu.length ? i2 - 1 : i2;
|
||||
}
|
||||
|
||||
public final boolean hasColumn(String str) {
|
||||
return this.zalq.containsKey(str);
|
||||
}
|
||||
|
||||
public final boolean hasNull(String str, int i, int i2) {
|
||||
zaa(str, i);
|
||||
return this.zalr[i2].isNull(i, this.zalq.getInt(str));
|
||||
}
|
||||
|
||||
public final boolean isClosed() {
|
||||
boolean z;
|
||||
synchronized (this) {
|
||||
z = this.mClosed;
|
||||
}
|
||||
return z;
|
||||
}
|
||||
|
||||
@Override // android.os.Parcelable
|
||||
public final void writeToParcel(Parcel parcel, int i) {
|
||||
int a = SafeParcelWriter.a(parcel);
|
||||
SafeParcelWriter.a(parcel, 1, this.zalp, false);
|
||||
SafeParcelWriter.a(parcel, 2, (Parcelable[]) this.zalr, i, false);
|
||||
SafeParcelWriter.a(parcel, 3, getStatusCode());
|
||||
SafeParcelWriter.a(parcel, 4, getMetadata(), false);
|
||||
SafeParcelWriter.a(parcel, 1000, this.zale);
|
||||
SafeParcelWriter.a(parcel, a);
|
||||
if ((i & 1) != 0) {
|
||||
close();
|
||||
}
|
||||
}
|
||||
|
||||
public final double zab(String str, int i, int i2) {
|
||||
zaa(str, i);
|
||||
return this.zalr[i2].getDouble(i, this.zalq.getInt(str));
|
||||
}
|
||||
|
||||
public final void zaca() {
|
||||
this.zalq = new Bundle();
|
||||
int i = 0;
|
||||
int i2 = 0;
|
||||
while (true) {
|
||||
String[] strArr = this.zalp;
|
||||
if (i2 >= strArr.length) {
|
||||
break;
|
||||
}
|
||||
this.zalq.putInt(strArr[i2], i2);
|
||||
i2++;
|
||||
}
|
||||
this.zalu = new int[this.zalr.length];
|
||||
int i3 = 0;
|
||||
while (true) {
|
||||
CursorWindow[] cursorWindowArr = this.zalr;
|
||||
if (i >= cursorWindowArr.length) {
|
||||
this.zalv = i3;
|
||||
return;
|
||||
}
|
||||
this.zalu[i] = i3;
|
||||
i3 += this.zalr[i].getNumRows() - (i3 - cursorWindowArr[i].getStartPosition());
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
public static class Builder {
|
||||
private final String[] a;
|
||||
private final ArrayList<HashMap<String, Object>> b;
|
||||
|
||||
private Builder(String[] strArr, String str) {
|
||||
Preconditions.a(strArr);
|
||||
this.a = strArr;
|
||||
this.b = new ArrayList<>();
|
||||
new HashMap();
|
||||
}
|
||||
|
||||
/* synthetic */ Builder(String[] strArr, String str, zab zabVar) {
|
||||
this(strArr, null);
|
||||
}
|
||||
}
|
||||
|
||||
public DataHolder(String[] strArr, CursorWindow[] cursorWindowArr, int i, Bundle bundle) {
|
||||
this.mClosed = false;
|
||||
this.zalw = true;
|
||||
this.zale = 1;
|
||||
Preconditions.a(strArr);
|
||||
this.zalp = strArr;
|
||||
Preconditions.a(cursorWindowArr);
|
||||
this.zalr = cursorWindowArr;
|
||||
this.zals = i;
|
||||
this.zalt = bundle;
|
||||
zaca();
|
||||
}
|
||||
|
||||
private DataHolder(CursorWrapper cursorWrapper, int i, Bundle bundle) {
|
||||
this(cursorWrapper.getColumnNames(), zaa(cursorWrapper), i, bundle);
|
||||
}
|
||||
|
||||
public DataHolder(Cursor cursor, int i, Bundle bundle) {
|
||||
this(new CursorWrapper(cursor), i, bundle);
|
||||
}
|
||||
|
||||
private DataHolder(Builder builder, int i, Bundle bundle) {
|
||||
this(builder.a, zaa(builder, -1), i, (Bundle) null);
|
||||
}
|
||||
|
||||
private DataHolder(Builder builder, int i, Bundle bundle, int i2) {
|
||||
this(builder.a, zaa(builder, -1), i, bundle);
|
||||
}
|
||||
|
||||
/* synthetic */ DataHolder(Builder builder, int i, Bundle bundle, zab zabVar) {
|
||||
this(builder, i, (Bundle) null);
|
||||
}
|
||||
|
||||
private static CursorWindow[] zaa(Builder builder, int i) {
|
||||
if (builder.a.length == 0) {
|
||||
return new CursorWindow[0];
|
||||
}
|
||||
List subList = (i < 0 || i >= builder.b.size()) ? builder.b : builder.b.subList(0, i);
|
||||
int size = subList.size();
|
||||
CursorWindow cursorWindow = new CursorWindow(false);
|
||||
ArrayList arrayList = new ArrayList();
|
||||
arrayList.add(cursorWindow);
|
||||
cursorWindow.setNumColumns(builder.a.length);
|
||||
CursorWindow cursorWindow2 = cursorWindow;
|
||||
int i2 = 0;
|
||||
boolean z = false;
|
||||
while (i2 < size) {
|
||||
try {
|
||||
if (!cursorWindow2.allocRow()) {
|
||||
StringBuilder sb = new StringBuilder(72);
|
||||
sb.append("Allocating additional cursor window for large data set (row ");
|
||||
sb.append(i2);
|
||||
sb.append(")");
|
||||
Log.d("DataHolder", sb.toString());
|
||||
cursorWindow2 = new CursorWindow(false);
|
||||
cursorWindow2.setStartPosition(i2);
|
||||
cursorWindow2.setNumColumns(builder.a.length);
|
||||
arrayList.add(cursorWindow2);
|
||||
if (!cursorWindow2.allocRow()) {
|
||||
Log.e("DataHolder", "Unable to allocate row to hold data.");
|
||||
arrayList.remove(cursorWindow2);
|
||||
return (CursorWindow[]) arrayList.toArray(new CursorWindow[arrayList.size()]);
|
||||
}
|
||||
}
|
||||
Map map = (Map) subList.get(i2);
|
||||
boolean z2 = true;
|
||||
for (int i3 = 0; i3 < builder.a.length && z2; i3++) {
|
||||
String str = builder.a[i3];
|
||||
Object obj = map.get(str);
|
||||
if (obj == null) {
|
||||
z2 = cursorWindow2.putNull(i2, i3);
|
||||
} else if (obj instanceof String) {
|
||||
z2 = cursorWindow2.putString((String) obj, i2, i3);
|
||||
} else if (obj instanceof Long) {
|
||||
z2 = cursorWindow2.putLong(((Long) obj).longValue(), i2, i3);
|
||||
} else if (obj instanceof Integer) {
|
||||
z2 = cursorWindow2.putLong(((Integer) obj).intValue(), i2, i3);
|
||||
} else if (obj instanceof Boolean) {
|
||||
z2 = cursorWindow2.putLong(((Boolean) obj).booleanValue() ? 1L : 0L, i2, i3);
|
||||
} else if (obj instanceof byte[]) {
|
||||
z2 = cursorWindow2.putBlob((byte[]) obj, i2, i3);
|
||||
} else if (obj instanceof Double) {
|
||||
z2 = cursorWindow2.putDouble(((Double) obj).doubleValue(), i2, i3);
|
||||
} else if (obj instanceof Float) {
|
||||
z2 = cursorWindow2.putDouble(((Float) obj).floatValue(), i2, i3);
|
||||
} else {
|
||||
String valueOf = String.valueOf(obj);
|
||||
StringBuilder sb2 = new StringBuilder(String.valueOf(str).length() + 32 + String.valueOf(valueOf).length());
|
||||
sb2.append("Unsupported object for column ");
|
||||
sb2.append(str);
|
||||
sb2.append(": ");
|
||||
sb2.append(valueOf);
|
||||
throw new IllegalArgumentException(sb2.toString());
|
||||
}
|
||||
}
|
||||
if (z2) {
|
||||
z = false;
|
||||
} else if (!z) {
|
||||
StringBuilder sb3 = new StringBuilder(74);
|
||||
sb3.append("Couldn't populate window data for row ");
|
||||
sb3.append(i2);
|
||||
sb3.append(" - allocating new window.");
|
||||
Log.d("DataHolder", sb3.toString());
|
||||
cursorWindow2.freeLastRow();
|
||||
cursorWindow2 = new CursorWindow(false);
|
||||
cursorWindow2.setStartPosition(i2);
|
||||
cursorWindow2.setNumColumns(builder.a.length);
|
||||
arrayList.add(cursorWindow2);
|
||||
i2--;
|
||||
z = true;
|
||||
} else {
|
||||
throw new zaa("Could not add the value to a new CursorWindow. The size of value may be larger than what a CursorWindow can handle.");
|
||||
}
|
||||
i2++;
|
||||
} catch (RuntimeException e) {
|
||||
int size2 = arrayList.size();
|
||||
for (int i4 = 0; i4 < size2; i4++) {
|
||||
((CursorWindow) arrayList.get(i4)).close();
|
||||
}
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
return (CursorWindow[]) arrayList.toArray(new CursorWindow[arrayList.size()]);
|
||||
}
|
||||
|
||||
/* synthetic */ DataHolder(Builder builder, int i, Bundle bundle, int i2, zab zabVar) {
|
||||
this(builder, i, bundle, -1);
|
||||
}
|
||||
|
||||
private final void zaa(String str, int i) {
|
||||
Bundle bundle = this.zalq;
|
||||
if (bundle != null && bundle.containsKey(str)) {
|
||||
if (!isClosed()) {
|
||||
if (i < 0 || i >= this.zalv) {
|
||||
throw new CursorIndexOutOfBoundsException(i, this.zalv);
|
||||
}
|
||||
return;
|
||||
}
|
||||
throw new IllegalArgumentException("Buffer is closed.");
|
||||
}
|
||||
String valueOf = String.valueOf(str);
|
||||
throw new IllegalArgumentException(valueOf.length() != 0 ? "No such column: ".concat(valueOf) : new String("No such column: "));
|
||||
}
|
||||
|
||||
public final float zaa(String str, int i, int i2) {
|
||||
zaa(str, i);
|
||||
return this.zalr[i2].getFloat(i, this.zalq.getInt(str));
|
||||
}
|
||||
|
||||
public final void zaa(String str, int i, int i2, CharArrayBuffer charArrayBuffer) {
|
||||
zaa(str, i);
|
||||
this.zalr[i2].copyStringToBuffer(i, this.zalq.getInt(str), charArrayBuffer);
|
||||
}
|
||||
}
|
37
sources/com/google/android/gms/common/data/zaa.java
Normal file
37
sources/com/google/android/gms/common/data/zaa.java
Normal file
@@ -0,0 +1,37 @@
|
||||
package com.google.android.gms.common.data;
|
||||
|
||||
import android.os.Parcel;
|
||||
import android.os.ParcelFileDescriptor;
|
||||
import android.os.Parcelable;
|
||||
import com.google.android.gms.common.internal.safeparcel.SafeParcelReader;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class zaa implements Parcelable.Creator<BitmapTeleporter> {
|
||||
@Override // android.os.Parcelable.Creator
|
||||
public final /* synthetic */ BitmapTeleporter createFromParcel(Parcel parcel) {
|
||||
int b = SafeParcelReader.b(parcel);
|
||||
int i = 0;
|
||||
ParcelFileDescriptor parcelFileDescriptor = null;
|
||||
int i2 = 0;
|
||||
while (parcel.dataPosition() < b) {
|
||||
int a = SafeParcelReader.a(parcel);
|
||||
int a2 = SafeParcelReader.a(a);
|
||||
if (a2 == 1) {
|
||||
i = SafeParcelReader.x(parcel, a);
|
||||
} else if (a2 == 2) {
|
||||
parcelFileDescriptor = (ParcelFileDescriptor) SafeParcelReader.a(parcel, a, ParcelFileDescriptor.CREATOR);
|
||||
} else if (a2 != 3) {
|
||||
SafeParcelReader.C(parcel, a);
|
||||
} else {
|
||||
i2 = SafeParcelReader.x(parcel, a);
|
||||
}
|
||||
}
|
||||
SafeParcelReader.q(parcel, b);
|
||||
return new BitmapTeleporter(i, parcelFileDescriptor, i2);
|
||||
}
|
||||
|
||||
@Override // android.os.Parcelable.Creator
|
||||
public final /* synthetic */ BitmapTeleporter[] newArray(int i) {
|
||||
return new BitmapTeleporter[i];
|
||||
}
|
||||
}
|
10
sources/com/google/android/gms/common/data/zab.java
Normal file
10
sources/com/google/android/gms/common/data/zab.java
Normal file
@@ -0,0 +1,10 @@
|
||||
package com.google.android.gms.common.data;
|
||||
|
||||
import com.google.android.gms.common.data.DataHolder;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
final class zab extends DataHolder.Builder {
|
||||
zab(String[] strArr, String str) {
|
||||
super(strArr, null, null);
|
||||
}
|
||||
}
|
46
sources/com/google/android/gms/common/data/zac.java
Normal file
46
sources/com/google/android/gms/common/data/zac.java
Normal file
@@ -0,0 +1,46 @@
|
||||
package com.google.android.gms.common.data;
|
||||
|
||||
import android.database.CursorWindow;
|
||||
import android.os.Bundle;
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
import com.google.android.gms.common.internal.safeparcel.SafeParcelReader;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class zac implements Parcelable.Creator<DataHolder> {
|
||||
@Override // android.os.Parcelable.Creator
|
||||
public final /* synthetic */ DataHolder createFromParcel(Parcel parcel) {
|
||||
int b = SafeParcelReader.b(parcel);
|
||||
String[] strArr = null;
|
||||
CursorWindow[] cursorWindowArr = null;
|
||||
Bundle bundle = null;
|
||||
int i = 0;
|
||||
int i2 = 0;
|
||||
while (parcel.dataPosition() < b) {
|
||||
int a = SafeParcelReader.a(parcel);
|
||||
int a2 = SafeParcelReader.a(a);
|
||||
if (a2 == 1) {
|
||||
strArr = SafeParcelReader.o(parcel, a);
|
||||
} else if (a2 == 2) {
|
||||
cursorWindowArr = (CursorWindow[]) SafeParcelReader.b(parcel, a, CursorWindow.CREATOR);
|
||||
} else if (a2 == 3) {
|
||||
i2 = SafeParcelReader.x(parcel, a);
|
||||
} else if (a2 == 4) {
|
||||
bundle = SafeParcelReader.f(parcel, a);
|
||||
} else if (a2 != 1000) {
|
||||
SafeParcelReader.C(parcel, a);
|
||||
} else {
|
||||
i = SafeParcelReader.x(parcel, a);
|
||||
}
|
||||
}
|
||||
SafeParcelReader.q(parcel, b);
|
||||
DataHolder dataHolder = new DataHolder(i, strArr, cursorWindowArr, i2, bundle);
|
||||
dataHolder.zaca();
|
||||
return dataHolder;
|
||||
}
|
||||
|
||||
@Override // android.os.Parcelable.Creator
|
||||
public final /* synthetic */ DataHolder[] newArray(int i) {
|
||||
return new DataHolder[i];
|
||||
}
|
||||
}
|
181
sources/com/google/android/gms/common/images/ImageManager.java
Normal file
181
sources/com/google/android/gms/common/images/ImageManager.java
Normal file
@@ -0,0 +1,181 @@
|
||||
package com.google.android.gms.common.images;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.BitmapFactory;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import android.os.ParcelFileDescriptor;
|
||||
import android.os.ResultReceiver;
|
||||
import android.os.SystemClock;
|
||||
import android.util.Log;
|
||||
import androidx.collection.LruCache;
|
||||
import com.google.android.gms.common.annotation.KeepName;
|
||||
import com.google.android.gms.common.internal.Asserts;
|
||||
import com.google.android.gms.internal.base.zak;
|
||||
import com.google.android.gms.internal.base.zal;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.CountDownLatch;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class ImageManager {
|
||||
private static final Object i = new Object();
|
||||
private static HashSet<Uri> j = new HashSet<>();
|
||||
private final Context a;
|
||||
private final Handler b;
|
||||
private final ExecutorService c;
|
||||
private final zaa d;
|
||||
private final zak e;
|
||||
private final Map<com.google.android.gms.common.images.zaa, ImageReceiver> f;
|
||||
private final Map<Uri, ImageReceiver> g;
|
||||
private final Map<Uri, Long> h;
|
||||
|
||||
@KeepName
|
||||
private final class ImageReceiver extends ResultReceiver {
|
||||
private final Uri mUri;
|
||||
private final ArrayList<com.google.android.gms.common.images.zaa> zamp;
|
||||
|
||||
ImageReceiver(Uri uri) {
|
||||
super(new zal(Looper.getMainLooper()));
|
||||
this.mUri = uri;
|
||||
this.zamp = new ArrayList<>();
|
||||
}
|
||||
|
||||
@Override // android.os.ResultReceiver
|
||||
public final void onReceiveResult(int i, Bundle bundle) {
|
||||
ImageManager.this.c.execute(ImageManager.this.new zab(this.mUri, (ParcelFileDescriptor) bundle.getParcelable("com.google.android.gms.extra.fileDescriptor")));
|
||||
}
|
||||
|
||||
public final void zab(com.google.android.gms.common.images.zaa zaaVar) {
|
||||
Asserts.a("ImageReceiver.addImageRequest() must be called in the main thread");
|
||||
this.zamp.add(zaaVar);
|
||||
}
|
||||
|
||||
public final void zac(com.google.android.gms.common.images.zaa zaaVar) {
|
||||
Asserts.a("ImageReceiver.removeImageRequest() must be called in the main thread");
|
||||
this.zamp.remove(zaaVar);
|
||||
}
|
||||
|
||||
public final void zace() {
|
||||
Intent intent = new Intent("com.google.android.gms.common.images.LOAD_IMAGE");
|
||||
intent.putExtra("com.google.android.gms.extras.uri", this.mUri);
|
||||
intent.putExtra("com.google.android.gms.extras.resultReceiver", this);
|
||||
intent.putExtra("com.google.android.gms.extras.priority", 3);
|
||||
ImageManager.this.a.sendBroadcast(intent);
|
||||
}
|
||||
}
|
||||
|
||||
private static final class zaa extends LruCache<com.google.android.gms.common.images.zab, Bitmap> {
|
||||
}
|
||||
|
||||
private final class zab implements Runnable {
|
||||
private final Uri a;
|
||||
private final ParcelFileDescriptor b;
|
||||
|
||||
public zab(Uri uri, ParcelFileDescriptor parcelFileDescriptor) {
|
||||
this.a = uri;
|
||||
this.b = parcelFileDescriptor;
|
||||
}
|
||||
|
||||
@Override // java.lang.Runnable
|
||||
public final void run() {
|
||||
boolean z;
|
||||
Bitmap bitmap;
|
||||
Asserts.b("LoadBitmapFromDiskRunnable can't be executed in the main thread");
|
||||
ParcelFileDescriptor parcelFileDescriptor = this.b;
|
||||
boolean z2 = false;
|
||||
Bitmap bitmap2 = null;
|
||||
if (parcelFileDescriptor != null) {
|
||||
try {
|
||||
bitmap2 = BitmapFactory.decodeFileDescriptor(parcelFileDescriptor.getFileDescriptor());
|
||||
} catch (OutOfMemoryError e) {
|
||||
String valueOf = String.valueOf(this.a);
|
||||
StringBuilder sb = new StringBuilder(String.valueOf(valueOf).length() + 34);
|
||||
sb.append("OOM while loading bitmap for uri: ");
|
||||
sb.append(valueOf);
|
||||
Log.e("ImageManager", sb.toString(), e);
|
||||
z2 = true;
|
||||
}
|
||||
try {
|
||||
this.b.close();
|
||||
} catch (IOException e2) {
|
||||
Log.e("ImageManager", "closed failed", e2);
|
||||
}
|
||||
z = z2;
|
||||
bitmap = bitmap2;
|
||||
} else {
|
||||
bitmap = null;
|
||||
z = false;
|
||||
}
|
||||
CountDownLatch countDownLatch = new CountDownLatch(1);
|
||||
ImageManager.this.b.post(ImageManager.this.new zad(this.a, bitmap, z, countDownLatch));
|
||||
try {
|
||||
countDownLatch.await();
|
||||
} catch (InterruptedException unused) {
|
||||
String valueOf2 = String.valueOf(this.a);
|
||||
StringBuilder sb2 = new StringBuilder(String.valueOf(valueOf2).length() + 32);
|
||||
sb2.append("Latch interrupted while posting ");
|
||||
sb2.append(valueOf2);
|
||||
Log.w("ImageManager", sb2.toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private final class zad implements Runnable {
|
||||
private final Uri a;
|
||||
private final Bitmap b;
|
||||
private final CountDownLatch c;
|
||||
private boolean d;
|
||||
|
||||
public zad(Uri uri, Bitmap bitmap, boolean z, CountDownLatch countDownLatch) {
|
||||
this.a = uri;
|
||||
this.b = bitmap;
|
||||
this.d = z;
|
||||
this.c = countDownLatch;
|
||||
}
|
||||
|
||||
@Override // java.lang.Runnable
|
||||
public final void run() {
|
||||
Asserts.a("OnBitmapLoadedRunnable must be executed in the main thread");
|
||||
boolean z = this.b != null;
|
||||
if (ImageManager.this.d != null) {
|
||||
if (this.d) {
|
||||
ImageManager.this.d.a();
|
||||
System.gc();
|
||||
this.d = false;
|
||||
ImageManager.this.b.post(this);
|
||||
return;
|
||||
}
|
||||
if (z) {
|
||||
ImageManager.this.d.a(new com.google.android.gms.common.images.zab(this.a), this.b);
|
||||
}
|
||||
}
|
||||
ImageReceiver imageReceiver = (ImageReceiver) ImageManager.this.g.remove(this.a);
|
||||
if (imageReceiver != null) {
|
||||
ArrayList arrayList = imageReceiver.zamp;
|
||||
int size = arrayList.size();
|
||||
for (int i = 0; i < size; i++) {
|
||||
com.google.android.gms.common.images.zaa zaaVar = (com.google.android.gms.common.images.zaa) arrayList.get(i);
|
||||
if (z) {
|
||||
zaaVar.a(ImageManager.this.a, this.b, false);
|
||||
} else {
|
||||
ImageManager.this.h.put(this.a, Long.valueOf(SystemClock.elapsedRealtime()));
|
||||
zaaVar.a(ImageManager.this.a, ImageManager.this.e, false);
|
||||
}
|
||||
ImageManager.this.f.remove(zaaVar);
|
||||
}
|
||||
}
|
||||
this.c.countDown();
|
||||
synchronized (ImageManager.i) {
|
||||
ImageManager.j.remove(this.a);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
110
sources/com/google/android/gms/common/images/WebImage.java
Normal file
110
sources/com/google/android/gms/common/images/WebImage.java
Normal file
@@ -0,0 +1,110 @@
|
||||
package com.google.android.gms.common.images;
|
||||
|
||||
import android.net.Uri;
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
import com.baidu.cloud.media.player.misc.IMediaFormat;
|
||||
import com.google.android.gms.common.internal.Objects;
|
||||
import com.google.android.gms.common.internal.safeparcel.AbstractSafeParcelable;
|
||||
import com.google.android.gms.common.internal.safeparcel.SafeParcelWriter;
|
||||
import java.util.Locale;
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class WebImage extends AbstractSafeParcelable {
|
||||
public static final Parcelable.Creator<WebImage> CREATOR = new zae();
|
||||
private final int zale;
|
||||
private final int zand;
|
||||
private final int zane;
|
||||
private final Uri zanf;
|
||||
|
||||
WebImage(int i, Uri uri, int i2, int i3) {
|
||||
this.zale = i;
|
||||
this.zanf = uri;
|
||||
this.zand = i2;
|
||||
this.zane = i3;
|
||||
}
|
||||
|
||||
private static Uri zaa(JSONObject jSONObject) {
|
||||
if (jSONObject.has("url")) {
|
||||
try {
|
||||
return Uri.parse(jSONObject.getString("url"));
|
||||
} catch (JSONException unused) {
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public final boolean equals(Object obj) {
|
||||
if (this == obj) {
|
||||
return true;
|
||||
}
|
||||
if (obj != null && (obj instanceof WebImage)) {
|
||||
WebImage webImage = (WebImage) obj;
|
||||
if (Objects.a(this.zanf, webImage.zanf) && this.zand == webImage.zand && this.zane == webImage.zane) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public final int getHeight() {
|
||||
return this.zane;
|
||||
}
|
||||
|
||||
public final Uri getUrl() {
|
||||
return this.zanf;
|
||||
}
|
||||
|
||||
public final int getWidth() {
|
||||
return this.zand;
|
||||
}
|
||||
|
||||
public final int hashCode() {
|
||||
return Objects.a(this.zanf, Integer.valueOf(this.zand), Integer.valueOf(this.zane));
|
||||
}
|
||||
|
||||
public final JSONObject toJson() {
|
||||
JSONObject jSONObject = new JSONObject();
|
||||
try {
|
||||
jSONObject.put("url", this.zanf.toString());
|
||||
jSONObject.put(IMediaFormat.KEY_WIDTH, this.zand);
|
||||
jSONObject.put(IMediaFormat.KEY_HEIGHT, this.zane);
|
||||
} catch (JSONException unused) {
|
||||
}
|
||||
return jSONObject;
|
||||
}
|
||||
|
||||
public final String toString() {
|
||||
return String.format(Locale.US, "Image %dx%d %s", Integer.valueOf(this.zand), Integer.valueOf(this.zane), this.zanf.toString());
|
||||
}
|
||||
|
||||
@Override // android.os.Parcelable
|
||||
public final void writeToParcel(Parcel parcel, int i) {
|
||||
int a = SafeParcelWriter.a(parcel);
|
||||
SafeParcelWriter.a(parcel, 1, this.zale);
|
||||
SafeParcelWriter.a(parcel, 2, (Parcelable) getUrl(), i, false);
|
||||
SafeParcelWriter.a(parcel, 3, getWidth());
|
||||
SafeParcelWriter.a(parcel, 4, getHeight());
|
||||
SafeParcelWriter.a(parcel, a);
|
||||
}
|
||||
|
||||
public WebImage(Uri uri, int i, int i2) throws IllegalArgumentException {
|
||||
this(1, uri, i, i2);
|
||||
if (uri == null) {
|
||||
throw new IllegalArgumentException("url cannot be null");
|
||||
}
|
||||
if (i < 0 || i2 < 0) {
|
||||
throw new IllegalArgumentException("width and height must not be negative");
|
||||
}
|
||||
}
|
||||
|
||||
public WebImage(Uri uri) throws IllegalArgumentException {
|
||||
this(uri, 0, 0);
|
||||
}
|
||||
|
||||
public WebImage(JSONObject jSONObject) throws IllegalArgumentException {
|
||||
this(zaa(jSONObject), jSONObject.optInt(IMediaFormat.KEY_WIDTH, 0), jSONObject.optInt(IMediaFormat.KEY_HEIGHT, 0));
|
||||
}
|
||||
}
|
25
sources/com/google/android/gms/common/images/zaa.java
Normal file
25
sources/com/google/android/gms/common/images/zaa.java
Normal file
@@ -0,0 +1,25 @@
|
||||
package com.google.android.gms.common.images;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.drawable.BitmapDrawable;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import com.google.android.gms.common.internal.Asserts;
|
||||
import com.google.android.gms.internal.base.zak;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public abstract class zaa {
|
||||
protected int a;
|
||||
|
||||
final void a(Context context, Bitmap bitmap, boolean z) {
|
||||
Asserts.a(bitmap);
|
||||
a(new BitmapDrawable(context.getResources(), bitmap), z, false, true);
|
||||
}
|
||||
|
||||
protected abstract void a(Drawable drawable, boolean z, boolean z2, boolean z3);
|
||||
|
||||
final void a(Context context, zak zakVar, boolean z) {
|
||||
int i = this.a;
|
||||
a(i != 0 ? context.getResources().getDrawable(i) : null, z, false, false);
|
||||
}
|
||||
}
|
27
sources/com/google/android/gms/common/images/zab.java
Normal file
27
sources/com/google/android/gms/common/images/zab.java
Normal file
@@ -0,0 +1,27 @@
|
||||
package com.google.android.gms.common.images;
|
||||
|
||||
import android.net.Uri;
|
||||
import com.google.android.gms.common.internal.Objects;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
final class zab {
|
||||
public final Uri a;
|
||||
|
||||
public zab(Uri uri) {
|
||||
this.a = uri;
|
||||
}
|
||||
|
||||
public final boolean equals(Object obj) {
|
||||
if (!(obj instanceof zab)) {
|
||||
return false;
|
||||
}
|
||||
if (this == obj) {
|
||||
return true;
|
||||
}
|
||||
return Objects.a(((zab) obj).a, this.a);
|
||||
}
|
||||
|
||||
public final int hashCode() {
|
||||
return Objects.a(this.a);
|
||||
}
|
||||
}
|
40
sources/com/google/android/gms/common/images/zae.java
Normal file
40
sources/com/google/android/gms/common/images/zae.java
Normal file
@@ -0,0 +1,40 @@
|
||||
package com.google.android.gms.common.images;
|
||||
|
||||
import android.net.Uri;
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
import com.google.android.gms.common.internal.safeparcel.SafeParcelReader;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class zae implements Parcelable.Creator<WebImage> {
|
||||
@Override // android.os.Parcelable.Creator
|
||||
public final /* synthetic */ WebImage createFromParcel(Parcel parcel) {
|
||||
int b = SafeParcelReader.b(parcel);
|
||||
int i = 0;
|
||||
Uri uri = null;
|
||||
int i2 = 0;
|
||||
int i3 = 0;
|
||||
while (parcel.dataPosition() < b) {
|
||||
int a = SafeParcelReader.a(parcel);
|
||||
int a2 = SafeParcelReader.a(a);
|
||||
if (a2 == 1) {
|
||||
i = SafeParcelReader.x(parcel, a);
|
||||
} else if (a2 == 2) {
|
||||
uri = (Uri) SafeParcelReader.a(parcel, a, Uri.CREATOR);
|
||||
} else if (a2 == 3) {
|
||||
i2 = SafeParcelReader.x(parcel, a);
|
||||
} else if (a2 != 4) {
|
||||
SafeParcelReader.C(parcel, a);
|
||||
} else {
|
||||
i3 = SafeParcelReader.x(parcel, a);
|
||||
}
|
||||
}
|
||||
SafeParcelReader.q(parcel, b);
|
||||
return new WebImage(i, uri, i2, i3);
|
||||
}
|
||||
|
||||
@Override // android.os.Parcelable.Creator
|
||||
public final /* synthetic */ WebImage[] newArray(int i) {
|
||||
return new WebImage[i];
|
||||
}
|
||||
}
|
@@ -0,0 +1,24 @@
|
||||
package com.google.android.gms.common.internal;
|
||||
|
||||
import android.accounts.Account;
|
||||
import android.os.Binder;
|
||||
import android.os.RemoteException;
|
||||
import android.util.Log;
|
||||
import com.google.android.gms.common.internal.IAccountAccessor;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class AccountAccessor extends IAccountAccessor.Stub {
|
||||
public static Account a(IAccountAccessor iAccountAccessor) {
|
||||
if (iAccountAccessor != null) {
|
||||
long clearCallingIdentity = Binder.clearCallingIdentity();
|
||||
try {
|
||||
return iAccountAccessor.a();
|
||||
} catch (RemoteException unused) {
|
||||
Log.w("AccountAccessor", "Remote account accessor probably died");
|
||||
} finally {
|
||||
Binder.restoreCallingIdentity(clearCallingIdentity);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user