- Added realracing3-community.apk (71.57 MB) - Removed 32-bit support (armeabi-v7a) - Only includes arm64-v8a libraries - Decompiled source code included - Added README-community.md with analysis
391 lines
18 KiB
Java
391 lines
18 KiB
Java
package com.google.android.gms.common;
|
|
|
|
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.IntentFilter;
|
|
import android.content.res.Resources;
|
|
import android.util.Log;
|
|
import android.util.TypedValue;
|
|
import android.widget.ProgressBar;
|
|
import androidx.activity.result.ActivityResultLauncher;
|
|
import androidx.activity.result.IntentSenderRequest;
|
|
import androidx.annotation.GuardedBy;
|
|
import androidx.annotation.MainThread;
|
|
import androidx.annotation.NonNull;
|
|
import androidx.annotation.Nullable;
|
|
import androidx.core.app.NotificationCompat;
|
|
import androidx.fragment.app.Fragment;
|
|
import androidx.fragment.app.FragmentActivity;
|
|
import com.google.android.gms.common.annotation.KeepForSdk;
|
|
import com.google.android.gms.common.api.GoogleApi;
|
|
import com.google.android.gms.common.api.GoogleApiActivity;
|
|
import com.google.android.gms.common.api.HasApiKey;
|
|
import com.google.android.gms.common.api.internal.GoogleApiManager;
|
|
import com.google.android.gms.common.api.internal.LifecycleFragment;
|
|
import com.google.android.gms.common.api.internal.zabw;
|
|
import com.google.android.gms.common.api.internal.zabx;
|
|
import com.google.android.gms.common.api.internal.zacc;
|
|
import com.google.android.gms.common.internal.HideFirstParty;
|
|
import com.google.android.gms.common.internal.Preconditions;
|
|
import com.google.android.gms.common.internal.ShowFirstParty;
|
|
import com.google.android.gms.common.internal.zag;
|
|
import com.google.android.gms.common.util.DeviceProperties;
|
|
import com.google.android.gms.common.util.PlatformVersion;
|
|
import com.google.android.gms.common.wrappers.InstantApps;
|
|
import com.google.android.gms.internal.base.zae;
|
|
import com.google.android.gms.internal.base.zao;
|
|
import com.google.android.gms.internal.base.zap;
|
|
import com.google.android.gms.tasks.SuccessContinuation;
|
|
import com.google.android.gms.tasks.Task;
|
|
import com.google.android.gms.tasks.Tasks;
|
|
import com.google.errorprone.annotations.RestrictedInheritance;
|
|
import com.google.errorprone.annotations.ResultIgnorabilityUnspecified;
|
|
import com.ironsource.nb;
|
|
import com.unity3d.services.UnityAdsConstants;
|
|
import java.util.ArrayList;
|
|
import java.util.Arrays;
|
|
|
|
@RestrictedInheritance(allowedOnPath = ".*java.*/com/google/android/gms.*", allowlistAnnotations = {com.google.android.gms.internal.base.zad.class, zae.class}, explanation = "Sub classing of GMS Core's APIs are restricted to GMS Core client libs and testing fakes.", link = "go/gmscore-restrictedinheritance")
|
|
/* loaded from: classes2.dex */
|
|
public class GoogleApiAvailability extends GoogleApiAvailabilityLight {
|
|
|
|
@NonNull
|
|
public static final String GOOGLE_PLAY_SERVICES_PACKAGE = "com.google.android.gms";
|
|
|
|
@GuardedBy("lock")
|
|
private String zac;
|
|
private static final Object zaa = new Object();
|
|
private static final GoogleApiAvailability zab = new GoogleApiAvailability();
|
|
public static final int GOOGLE_PLAY_SERVICES_VERSION_CODE = GoogleApiAvailabilityLight.GOOGLE_PLAY_SERVICES_VERSION_CODE;
|
|
|
|
@NonNull
|
|
public static GoogleApiAvailability getInstance() {
|
|
return zab;
|
|
}
|
|
|
|
@NonNull
|
|
public static final Task zai(@NonNull HasApiKey hasApiKey, @NonNull HasApiKey... hasApiKeyArr) {
|
|
Preconditions.checkNotNull(hasApiKey, "Requested API must not be null.");
|
|
for (HasApiKey hasApiKey2 : hasApiKeyArr) {
|
|
Preconditions.checkNotNull(hasApiKey2, "Requested API must not be null.");
|
|
}
|
|
ArrayList arrayList = new ArrayList(hasApiKeyArr.length + 1);
|
|
arrayList.add(hasApiKey);
|
|
arrayList.addAll(Arrays.asList(hasApiKeyArr));
|
|
return GoogleApiManager.zaj().zam(arrayList);
|
|
}
|
|
|
|
@NonNull
|
|
public Task<Void> checkApiAvailability(@NonNull GoogleApi<?> googleApi, @NonNull GoogleApi<?>... googleApiArr) {
|
|
return zai(googleApi, googleApiArr).onSuccessTask(new SuccessContinuation() { // from class: com.google.android.gms.common.zab
|
|
@Override // com.google.android.gms.tasks.SuccessContinuation
|
|
public final Task then(Object obj) {
|
|
int i = GoogleApiAvailability.GOOGLE_PLAY_SERVICES_VERSION_CODE;
|
|
return Tasks.forResult(null);
|
|
}
|
|
});
|
|
}
|
|
|
|
@Override // com.google.android.gms.common.GoogleApiAvailabilityLight
|
|
@ShowFirstParty
|
|
@KeepForSdk
|
|
public int getClientVersion(@NonNull Context context) {
|
|
return super.getClientVersion(context);
|
|
}
|
|
|
|
@Nullable
|
|
public Dialog getErrorDialog(@NonNull Activity activity, int i, int i2) {
|
|
return getErrorDialog(activity, i, i2, (DialogInterface.OnCancelListener) null);
|
|
}
|
|
|
|
@Override // com.google.android.gms.common.GoogleApiAvailabilityLight
|
|
@Nullable
|
|
@ShowFirstParty
|
|
@KeepForSdk
|
|
public Intent getErrorResolutionIntent(@Nullable Context context, int i, @Nullable String str) {
|
|
return super.getErrorResolutionIntent(context, i, str);
|
|
}
|
|
|
|
@Override // com.google.android.gms.common.GoogleApiAvailabilityLight
|
|
@Nullable
|
|
public PendingIntent getErrorResolutionPendingIntent(@NonNull Context context, int i, int i2) {
|
|
return super.getErrorResolutionPendingIntent(context, i, i2);
|
|
}
|
|
|
|
@Override // com.google.android.gms.common.GoogleApiAvailabilityLight
|
|
@NonNull
|
|
public final String getErrorString(int i) {
|
|
return super.getErrorString(i);
|
|
}
|
|
|
|
@Override // com.google.android.gms.common.GoogleApiAvailabilityLight
|
|
@ResultIgnorabilityUnspecified
|
|
@HideFirstParty
|
|
public int isGooglePlayServicesAvailable(@NonNull Context context) {
|
|
return super.isGooglePlayServicesAvailable(context);
|
|
}
|
|
|
|
@Override // com.google.android.gms.common.GoogleApiAvailabilityLight
|
|
public final boolean isUserResolvableError(int i) {
|
|
return super.isUserResolvableError(i);
|
|
}
|
|
|
|
@NonNull
|
|
@MainThread
|
|
public Task<Void> makeGooglePlayServicesAvailable(@NonNull Activity activity) {
|
|
int i = GOOGLE_PLAY_SERVICES_VERSION_CODE;
|
|
Preconditions.checkMainThread("makeGooglePlayServicesAvailable must be called from the main thread");
|
|
int isGooglePlayServicesAvailable = isGooglePlayServicesAvailable(activity, i);
|
|
if (isGooglePlayServicesAvailable == 0) {
|
|
return Tasks.forResult(null);
|
|
}
|
|
zacc zaa2 = zacc.zaa(activity);
|
|
zaa2.zah(new ConnectionResult(isGooglePlayServicesAvailable, null), 0);
|
|
return zaa2.zad();
|
|
}
|
|
|
|
@TargetApi(26)
|
|
public void setDefaultNotificationChannelId(@NonNull Context context, @NonNull String str) {
|
|
if (PlatformVersion.isAtLeastO()) {
|
|
Preconditions.checkNotNull(((NotificationManager) Preconditions.checkNotNull(context.getSystemService("notification"))).getNotificationChannel(str));
|
|
}
|
|
synchronized (zaa) {
|
|
this.zac = str;
|
|
}
|
|
}
|
|
|
|
@ResultIgnorabilityUnspecified
|
|
public boolean showErrorDialogFragment(@NonNull Activity activity, int i, int i2) {
|
|
return showErrorDialogFragment(activity, i, i2, (DialogInterface.OnCancelListener) null);
|
|
}
|
|
|
|
public void showErrorNotification(@NonNull Context context, int i) {
|
|
zae(context, i, null, getErrorResolutionPendingIntent(context, i, 0, nb.q));
|
|
}
|
|
|
|
/* JADX WARN: Multi-variable type inference failed */
|
|
@Nullable
|
|
public final Dialog zaa(@NonNull Context context, int i, @Nullable zag zagVar, @Nullable DialogInterface.OnCancelListener onCancelListener, @Nullable DialogInterface.OnClickListener onClickListener) {
|
|
if (i == 0) {
|
|
return null;
|
|
}
|
|
TypedValue typedValue = new TypedValue();
|
|
context.getTheme().resolveAttribute(android.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(com.google.android.gms.common.internal.zac.zac(context, i));
|
|
if (onCancelListener != null) {
|
|
builder.setOnCancelListener(onCancelListener);
|
|
}
|
|
String zab2 = com.google.android.gms.common.internal.zac.zab(context, i);
|
|
if (zab2 != null) {
|
|
if (zagVar == null) {
|
|
zagVar = onClickListener;
|
|
}
|
|
builder.setPositiveButton(zab2, zagVar);
|
|
}
|
|
String zaf = com.google.android.gms.common.internal.zac.zaf(context, i);
|
|
if (zaf != null) {
|
|
builder.setTitle(zaf);
|
|
}
|
|
Log.w("GoogleApiAvailability", String.format("Creating dialog for Google Play services availability issue. ConnectionResult=%s", Integer.valueOf(i)), new IllegalArgumentException());
|
|
return builder.create();
|
|
}
|
|
|
|
@NonNull
|
|
public final Dialog zab(@NonNull Activity activity, @NonNull DialogInterface.OnCancelListener onCancelListener) {
|
|
ProgressBar progressBar = new ProgressBar(activity, null, android.R.attr.progressBarStyleLarge);
|
|
progressBar.setIndeterminate(true);
|
|
progressBar.setVisibility(0);
|
|
AlertDialog.Builder builder = new AlertDialog.Builder(activity);
|
|
builder.setView(progressBar);
|
|
builder.setMessage(com.google.android.gms.common.internal.zac.zac(activity, 18));
|
|
builder.setPositiveButton("", (DialogInterface.OnClickListener) null);
|
|
AlertDialog create = builder.create();
|
|
zad(activity, create, "GooglePlayServicesUpdatingDialog", onCancelListener);
|
|
return create;
|
|
}
|
|
|
|
@Nullable
|
|
@ResultIgnorabilityUnspecified
|
|
public final zabx zac(Context context, zabw zabwVar) {
|
|
IntentFilter intentFilter = new IntentFilter("android.intent.action.PACKAGE_ADDED");
|
|
intentFilter.addDataScheme("package");
|
|
zabx zabxVar = new zabx(zabwVar);
|
|
zao.zaa(context, zabxVar, intentFilter);
|
|
zabxVar.zaa(context);
|
|
if (isUninstalledAppPossiblyUpdating(context, "com.google.android.gms")) {
|
|
return zabxVar;
|
|
}
|
|
zabwVar.zaa();
|
|
zabxVar.zab();
|
|
return null;
|
|
}
|
|
|
|
public final void zad(Activity activity, Dialog dialog, String str, @Nullable DialogInterface.OnCancelListener onCancelListener) {
|
|
try {
|
|
if (activity instanceof FragmentActivity) {
|
|
SupportErrorDialogFragment.newInstance(dialog, onCancelListener).show(((FragmentActivity) activity).getSupportFragmentManager(), str);
|
|
return;
|
|
}
|
|
} catch (NoClassDefFoundError unused) {
|
|
}
|
|
ErrorDialogFragment.newInstance(dialog, onCancelListener).show(activity.getFragmentManager(), str);
|
|
}
|
|
|
|
@TargetApi(20)
|
|
public final void zae(Context context, int i, @Nullable String str, @Nullable PendingIntent pendingIntent) {
|
|
int i2;
|
|
String str2;
|
|
Log.w("GoogleApiAvailability", String.format("GMS core API Availability. ConnectionResult=%s, tag=%s", Integer.valueOf(i), null), new IllegalArgumentException());
|
|
if (i == 18) {
|
|
zaf(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 zae = com.google.android.gms.common.internal.zac.zae(context, i);
|
|
String zad = com.google.android.gms.common.internal.zac.zad(context, i);
|
|
Resources resources = context.getResources();
|
|
NotificationManager notificationManager = (NotificationManager) Preconditions.checkNotNull(context.getSystemService("notification"));
|
|
NotificationCompat.Builder style = new NotificationCompat.Builder(context).setLocalOnly(true).setAutoCancel(true).setContentTitle(zae).setStyle(new NotificationCompat.BigTextStyle().bigText(zad));
|
|
if (DeviceProperties.isWearable(context)) {
|
|
Preconditions.checkState(PlatformVersion.isAtLeastKitKatWatch());
|
|
style.setSmallIcon(context.getApplicationInfo().icon).setPriority(2);
|
|
if (DeviceProperties.isWearableWithoutPlayStore(context)) {
|
|
style.addAction(com.google.android.gms.base.R.drawable.common_full_open_on_phone, resources.getString(com.google.android.gms.base.R.string.common_open_on_phone), pendingIntent);
|
|
} else {
|
|
style.setContentIntent(pendingIntent);
|
|
}
|
|
} else {
|
|
style.setSmallIcon(android.R.drawable.stat_sys_warning).setTicker(resources.getString(com.google.android.gms.base.R.string.common_google_play_services_notification_ticker)).setWhen(System.currentTimeMillis()).setContentIntent(pendingIntent).setContentText(zad);
|
|
}
|
|
if (PlatformVersion.isAtLeastO()) {
|
|
Preconditions.checkState(PlatformVersion.isAtLeastO());
|
|
synchronized (zaa) {
|
|
str2 = this.zac;
|
|
}
|
|
if (str2 == null) {
|
|
str2 = "com.google.android.gms.availability";
|
|
NotificationChannel notificationChannel = notificationManager.getNotificationChannel("com.google.android.gms.availability");
|
|
String string = context.getResources().getString(com.google.android.gms.base.R.string.common_google_play_services_notification_channel_name);
|
|
if (notificationChannel == null) {
|
|
notificationManager.createNotificationChannel(new NotificationChannel("com.google.android.gms.availability", string, 4));
|
|
} else if (!string.contentEquals(notificationChannel.getName())) {
|
|
notificationChannel.setName(string);
|
|
notificationManager.createNotificationChannel(notificationChannel);
|
|
}
|
|
}
|
|
style.setChannelId(str2);
|
|
}
|
|
Notification build = style.build();
|
|
if (i == 1 || i == 2 || i == 3) {
|
|
GooglePlayServicesUtilLight.sCanceledAvailabilityNotification.set(false);
|
|
i2 = 10436;
|
|
} else {
|
|
i2 = 39789;
|
|
}
|
|
notificationManager.notify(i2, build);
|
|
}
|
|
|
|
public final void zaf(Context context) {
|
|
new zad(this, context).sendEmptyMessageDelayed(1, UnityAdsConstants.Timeout.INIT_TIMEOUT_MS);
|
|
}
|
|
|
|
@ResultIgnorabilityUnspecified
|
|
public final boolean zag(@NonNull Activity activity, @NonNull LifecycleFragment lifecycleFragment, int i, int i2, @Nullable DialogInterface.OnCancelListener onCancelListener) {
|
|
Dialog zaa2 = zaa(activity, i, zag.zad(lifecycleFragment, getErrorResolutionIntent(activity, i, "d"), 2), onCancelListener, null);
|
|
if (zaa2 == null) {
|
|
return false;
|
|
}
|
|
zad(activity, zaa2, GooglePlayServicesUtil.GMS_ERROR_DIALOG, onCancelListener);
|
|
return true;
|
|
}
|
|
|
|
public final boolean zah(@NonNull Context context, @NonNull ConnectionResult connectionResult, int i) {
|
|
PendingIntent errorResolutionPendingIntent;
|
|
if (InstantApps.isInstantApp(context) || (errorResolutionPendingIntent = getErrorResolutionPendingIntent(context, connectionResult)) == null) {
|
|
return false;
|
|
}
|
|
zae(context, connectionResult.getErrorCode(), null, PendingIntent.getActivity(context, 0, GoogleApiActivity.zaa(context, errorResolutionPendingIntent, i, true), zap.zaa | 134217728));
|
|
return true;
|
|
}
|
|
|
|
@Nullable
|
|
public Dialog getErrorDialog(@NonNull Activity activity, int i, int i2, @Nullable DialogInterface.OnCancelListener onCancelListener) {
|
|
return zaa(activity, i, zag.zab(activity, getErrorResolutionIntent(activity, i, "d"), i2), onCancelListener, null);
|
|
}
|
|
|
|
@Nullable
|
|
public PendingIntent getErrorResolutionPendingIntent(@NonNull Context context, @NonNull ConnectionResult connectionResult) {
|
|
return connectionResult.hasResolution() ? connectionResult.getResolution() : getErrorResolutionPendingIntent(context, connectionResult.getErrorCode(), 0);
|
|
}
|
|
|
|
@Override // com.google.android.gms.common.GoogleApiAvailabilityLight
|
|
@ShowFirstParty
|
|
@KeepForSdk
|
|
public int isGooglePlayServicesAvailable(@NonNull Context context, int i) {
|
|
return super.isGooglePlayServicesAvailable(context, i);
|
|
}
|
|
|
|
@ResultIgnorabilityUnspecified
|
|
public boolean showErrorDialogFragment(@NonNull Activity activity, int i, int i2, @Nullable DialogInterface.OnCancelListener onCancelListener) {
|
|
Dialog errorDialog = getErrorDialog(activity, i, i2, onCancelListener);
|
|
if (errorDialog == null) {
|
|
return false;
|
|
}
|
|
zad(activity, errorDialog, GooglePlayServicesUtil.GMS_ERROR_DIALOG, onCancelListener);
|
|
return true;
|
|
}
|
|
|
|
@NonNull
|
|
public Task<Void> checkApiAvailability(@NonNull HasApiKey<?> hasApiKey, @NonNull HasApiKey<?>... hasApiKeyArr) {
|
|
return zai(hasApiKey, hasApiKeyArr).onSuccessTask(new SuccessContinuation() { // from class: com.google.android.gms.common.zaa
|
|
@Override // com.google.android.gms.tasks.SuccessContinuation
|
|
public final Task then(Object obj) {
|
|
int i = GoogleApiAvailability.GOOGLE_PLAY_SERVICES_VERSION_CODE;
|
|
return Tasks.forResult(null);
|
|
}
|
|
});
|
|
}
|
|
|
|
public void showErrorNotification(@NonNull Context context, @NonNull ConnectionResult connectionResult) {
|
|
zae(context, connectionResult.getErrorCode(), null, getErrorResolutionPendingIntent(context, connectionResult));
|
|
}
|
|
|
|
@Nullable
|
|
public Dialog getErrorDialog(@NonNull Fragment fragment, int i, int i2) {
|
|
return getErrorDialog(fragment, i, i2, (DialogInterface.OnCancelListener) null);
|
|
}
|
|
|
|
public boolean showErrorDialogFragment(@NonNull Activity activity, int i, @NonNull ActivityResultLauncher<IntentSenderRequest> activityResultLauncher, @Nullable DialogInterface.OnCancelListener onCancelListener) {
|
|
Dialog zaa2 = zaa(activity, i, null, onCancelListener, new zac(this, activity, i, activityResultLauncher));
|
|
if (zaa2 == null) {
|
|
return false;
|
|
}
|
|
zad(activity, zaa2, GooglePlayServicesUtil.GMS_ERROR_DIALOG, onCancelListener);
|
|
return true;
|
|
}
|
|
|
|
@Nullable
|
|
public Dialog getErrorDialog(@NonNull Fragment fragment, int i, int i2, @Nullable DialogInterface.OnCancelListener onCancelListener) {
|
|
return zaa(fragment.requireContext(), i, zag.zac(fragment, getErrorResolutionIntent(fragment.requireContext(), i, "d"), i2), onCancelListener, null);
|
|
}
|
|
}
|