* Decompile and recreate Soul Browser v1.4.85 with APK CI builds Co-authored-by: KaKi87 <KaKi87@pm.me> * Fix CI build: include bundled google.jks and remove PR trigger The apktool build failed in CI because app/unknown/.../google.jks was excluded by the *.jks gitignore rule. Whitelist app-bundled JKS files and commit the missing resource. Also remove the redundant pull_request workflow trigger. Co-authored-by: KaKi87 <KaKi87@pm.me> * Change package ID to com.github.kaki87.soulbrowser Rename the application ID so the rebuilt APK can be installed alongside the original Soul Browser from Google Play. - Update AndroidManifest package, permissions, providers, and actions - Update R class references in smali (com/github/kaki87/soulbrowser/R) - Update shortcuts.xml targetPackage - Rename app label to "Soul Rebuild" for easy identification Co-authored-by: KaKi87 <KaKi87@pm.me> * Fix install compatibility: remove split APK metadata and bundle native libs The rebuilt APK still declared requiredSplitTypes and Play Store split metadata, causing Android to reject standalone installs as incompatible. - Remove requiredSplitTypes and split-related manifest meta-data - Merge native libs from all ABI splits with uncompressed storage - Page-align before signing for extractNativeLibs=false - Add .so to apktool doNotCompress list Co-authored-by: KaKi87 <KaKi87@pm.me> * Fix install failure: use apksigner v2/v3 and bundle arm64 native libs Target SDK 36 requires APK Signature Scheme v2+, but jarsigner only produces v1 signatures, causing Android to reject the install. - Sign with apksigner (v1+v2+v3) instead of jarsigner - Add arm64-v8a native libraries from universal Soul Browser 1.4.79 - Set extractNativeLibs=true for reliable sideload installs - Commit stable debug keystore for consistent signatures across builds Co-authored-by: KaKi87 <KaKi87@pm.me> * Add committed debug keystore for consistent APK signatures Co-authored-by: KaKi87 <KaKi87@pm.me> * Fix startup crash: use original classes2.dex desugar libraries Apktool recompiles smali_classes2 into a broken classes2.dex, causing ClassNotFoundException for j$.com.android.tools.r8.a at ML Kit init. Inject the original classes2.dex (Java 8+ desugar libs) after apktool build instead of using the recompiled version. Co-authored-by: KaKi87 <KaKi87@pm.me> * Fix missing drawable resources from density split APKs The base APK is an app bundle module; density-specific drawables like seek_thumb_nor_b live in config.xhdpi.apk and were missing after rebuild, causing Resources$NotFoundException at runtime. - Merge non-9-patch resources from split APKs before apktool build - Sync public.xml IDs from R smali only when backing files exist - Add 713 density-specific resource IDs to public.xml Co-authored-by: KaKi87 <KaKi87@pm.me> --------- Co-authored-by: Cursor Agent <cursoragent@cursor.com>
999 lines
33 KiB
Java
999 lines
33 KiB
Java
package com.google.android.gms.common.internal;
|
|
|
|
import android.accounts.Account;
|
|
import android.app.PendingIntent;
|
|
import android.content.AttributionSource;
|
|
import android.content.Context;
|
|
import android.content.Intent;
|
|
import android.os.Build;
|
|
import android.os.Bundle;
|
|
import android.os.DeadObjectException;
|
|
import android.os.Handler;
|
|
import android.os.IBinder;
|
|
import android.os.IInterface;
|
|
import android.os.Looper;
|
|
import android.os.RemoteException;
|
|
import android.text.TextUtils;
|
|
import android.util.Log;
|
|
import androidx.annotation.CallSuper;
|
|
import androidx.annotation.NonNull;
|
|
import androidx.annotation.Nullable;
|
|
import androidx.annotation.VisibleForTesting;
|
|
import androidx.annotation.WorkerThread;
|
|
import com.google.android.gms.common.ConnectionResult;
|
|
import com.google.android.gms.common.Feature;
|
|
import com.google.android.gms.common.GoogleApiAvailabilityLight;
|
|
import com.google.android.gms.common.annotation.KeepForSdk;
|
|
import com.google.android.gms.common.api.CommonStatusCodes;
|
|
import com.google.android.gms.common.api.Scope;
|
|
import com.google.android.gms.common.wrappers.AttributionSourceWrapper;
|
|
import java.io.FileDescriptor;
|
|
import java.io.PrintWriter;
|
|
import java.text.SimpleDateFormat;
|
|
import java.util.ArrayList;
|
|
import java.util.Collections;
|
|
import java.util.Date;
|
|
import java.util.Locale;
|
|
import java.util.Set;
|
|
import java.util.concurrent.Executor;
|
|
import java.util.concurrent.atomic.AtomicInteger;
|
|
|
|
@KeepForSdk
|
|
/* loaded from: classes.dex */
|
|
public abstract class BaseGmsClient<T extends IInterface> {
|
|
|
|
@KeepForSdk
|
|
public static final int CONNECT_STATE_CONNECTED = 4;
|
|
|
|
@KeepForSdk
|
|
public static final int CONNECT_STATE_DISCONNECTED = 1;
|
|
|
|
@KeepForSdk
|
|
public static final int CONNECT_STATE_DISCONNECTING = 5;
|
|
|
|
@NonNull
|
|
@KeepForSdk
|
|
public static final String DEFAULT_ACCOUNT = "<<default account>>";
|
|
|
|
@NonNull
|
|
@KeepForSdk
|
|
public static final String KEY_PENDING_INTENT = "pendingIntent";
|
|
|
|
@Nullable
|
|
private volatile String zzA;
|
|
|
|
@Nullable
|
|
private volatile AttributionSourceWrapper zzB;
|
|
|
|
@Nullable
|
|
private ConnectionResult zzC;
|
|
private boolean zzD;
|
|
|
|
@Nullable
|
|
private volatile zzj zzE;
|
|
|
|
@VisibleForTesting
|
|
zzs zza;
|
|
final Handler zzb;
|
|
|
|
@NonNull
|
|
@VisibleForTesting
|
|
protected ConnectionProgressReportCallbacks zzc;
|
|
|
|
@NonNull
|
|
@VisibleForTesting
|
|
protected AtomicInteger zzd;
|
|
private int zzf;
|
|
private long zzg;
|
|
private long zzh;
|
|
private int zzi;
|
|
private long zzj;
|
|
|
|
@Nullable
|
|
private volatile String zzk;
|
|
private final Context zzl;
|
|
private final Looper zzm;
|
|
private final GmsClientSupervisor zzn;
|
|
private final GoogleApiAvailabilityLight zzo;
|
|
private final Object zzp;
|
|
private final Object zzq;
|
|
|
|
@Nullable
|
|
private IGmsServiceBroker zzr;
|
|
|
|
@Nullable
|
|
private IInterface zzs;
|
|
private final ArrayList zzt;
|
|
|
|
@Nullable
|
|
private zze zzu;
|
|
private int zzv;
|
|
|
|
@Nullable
|
|
private final BaseConnectionCallbacks zzw;
|
|
|
|
@Nullable
|
|
private final BaseOnConnectionFailedListener zzx;
|
|
private final int zzy;
|
|
|
|
@Nullable
|
|
private final String zzz;
|
|
private static final Feature[] zze = new Feature[0];
|
|
|
|
@NonNull
|
|
@KeepForSdk
|
|
public static final String[] GOOGLE_PLUS_REQUIRED_FEATURES = {"service_esmobile", "service_googleme"};
|
|
|
|
@KeepForSdk
|
|
/* loaded from: classes.dex */
|
|
public interface BaseConnectionCallbacks {
|
|
|
|
@KeepForSdk
|
|
public static final int CAUSE_DEAD_OBJECT_EXCEPTION = 3;
|
|
|
|
@KeepForSdk
|
|
public static final int CAUSE_SERVICE_DISCONNECTED = 1;
|
|
|
|
@KeepForSdk
|
|
void onConnected(@Nullable Bundle bundle);
|
|
|
|
@KeepForSdk
|
|
void onConnectionSuspended(int i);
|
|
}
|
|
|
|
@KeepForSdk
|
|
/* loaded from: classes.dex */
|
|
public interface BaseOnConnectionFailedListener {
|
|
@KeepForSdk
|
|
void onConnectionFailed(@NonNull ConnectionResult connectionResult);
|
|
}
|
|
|
|
@KeepForSdk
|
|
/* loaded from: classes.dex */
|
|
public interface ConnectionProgressReportCallbacks {
|
|
@KeepForSdk
|
|
void onReportServiceBinding(@NonNull ConnectionResult connectionResult);
|
|
}
|
|
|
|
/* loaded from: classes.dex */
|
|
public class LegacyClientCallbackAdapter implements ConnectionProgressReportCallbacks {
|
|
final /* synthetic */ BaseGmsClient zza;
|
|
|
|
@KeepForSdk
|
|
public LegacyClientCallbackAdapter(BaseGmsClient baseGmsClient) {
|
|
j$.util.Objects.requireNonNull(baseGmsClient);
|
|
this.zza = baseGmsClient;
|
|
}
|
|
|
|
@Override // com.google.android.gms.common.internal.BaseGmsClient.ConnectionProgressReportCallbacks
|
|
public final void onReportServiceBinding(@NonNull ConnectionResult connectionResult) {
|
|
if (connectionResult.isSuccess()) {
|
|
BaseGmsClient baseGmsClient = this.zza;
|
|
baseGmsClient.getRemoteService(null, baseGmsClient.getScopes());
|
|
} else {
|
|
BaseGmsClient baseGmsClient2 = this.zza;
|
|
if (baseGmsClient2.zzl() != null) {
|
|
baseGmsClient2.zzl().onConnectionFailed(connectionResult);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
@KeepForSdk
|
|
/* loaded from: classes.dex */
|
|
public interface SignOutCallbacks {
|
|
@KeepForSdk
|
|
void onSignOutComplete();
|
|
}
|
|
|
|
@KeepForSdk
|
|
@VisibleForTesting
|
|
public BaseGmsClient(@NonNull Context context, @NonNull Handler handler, @NonNull GmsClientSupervisor gmsClientSupervisor, @NonNull GoogleApiAvailabilityLight googleApiAvailabilityLight, int i, @Nullable BaseConnectionCallbacks baseConnectionCallbacks, @Nullable BaseOnConnectionFailedListener baseOnConnectionFailedListener) {
|
|
this.zzk = null;
|
|
this.zzp = new Object();
|
|
this.zzq = new Object();
|
|
this.zzt = new ArrayList();
|
|
this.zzv = 1;
|
|
this.zzC = null;
|
|
this.zzD = false;
|
|
this.zzE = null;
|
|
this.zzd = new AtomicInteger(0);
|
|
Preconditions.checkNotNull(context, "Context must not be null");
|
|
this.zzl = context;
|
|
Preconditions.checkNotNull(handler, "Handler must not be null");
|
|
this.zzb = handler;
|
|
this.zzm = handler.getLooper();
|
|
Preconditions.checkNotNull(gmsClientSupervisor, "Supervisor must not be null");
|
|
this.zzn = gmsClientSupervisor;
|
|
Preconditions.checkNotNull(googleApiAvailabilityLight, "API availability must not be null");
|
|
this.zzo = googleApiAvailabilityLight;
|
|
this.zzy = i;
|
|
this.zzw = baseConnectionCallbacks;
|
|
this.zzx = baseOnConnectionFailedListener;
|
|
this.zzz = null;
|
|
}
|
|
|
|
/* JADX WARN: Multi-variable type inference failed */
|
|
private final void zzp(int i, @Nullable IInterface iInterface) {
|
|
boolean z;
|
|
boolean z2;
|
|
zzs zzsVar;
|
|
int errorCode;
|
|
zzs zzsVar2;
|
|
boolean z3 = false;
|
|
if (i != 4) {
|
|
z = false;
|
|
} else {
|
|
z = true;
|
|
}
|
|
if (iInterface == 0) {
|
|
z2 = false;
|
|
} else {
|
|
z2 = true;
|
|
}
|
|
if (z == z2) {
|
|
z3 = true;
|
|
}
|
|
Preconditions.checkArgument(z3);
|
|
synchronized (this.zzp) {
|
|
try {
|
|
this.zzv = i;
|
|
this.zzs = iInterface;
|
|
Bundle bundle = null;
|
|
if (i != 1) {
|
|
if (i != 2 && i != 3) {
|
|
if (i == 4) {
|
|
Preconditions.checkNotNull(iInterface);
|
|
onConnectedLocked(iInterface);
|
|
}
|
|
} else {
|
|
zze zzeVar = this.zzu;
|
|
if (zzeVar != null && (zzsVar2 = this.zza) != null) {
|
|
String zza = zzsVar2.zza();
|
|
String zzb = zzsVar2.zzb();
|
|
StringBuilder sb = new StringBuilder(String.valueOf(zza).length() + 70 + String.valueOf(zzb).length());
|
|
sb.append("Calling connect() while still connected, missing disconnect() for ");
|
|
sb.append(zza);
|
|
sb.append(" on ");
|
|
sb.append(zzb);
|
|
Log.e("GmsClient", sb.toString());
|
|
GmsClientSupervisor gmsClientSupervisor = this.zzn;
|
|
String zza2 = this.zza.zza();
|
|
Preconditions.checkNotNull(zza2);
|
|
gmsClientSupervisor.zzb(zza2, this.zza.zzb(), 4225, zzeVar, zza(), this.zza.zzc());
|
|
this.zzd.incrementAndGet();
|
|
}
|
|
zze zzeVar2 = new zze(this, this.zzd.get());
|
|
this.zzu = zzeVar2;
|
|
if (this.zzv == 3 && getLocalStartServiceAction() != null) {
|
|
zzsVar = new zzs(getContext().getPackageName(), getLocalStartServiceAction(), true, 4225, false);
|
|
} else {
|
|
zzsVar = new zzs(getStartServicePackage(), getStartServiceAction(), false, 4225, getUseDynamicLookup());
|
|
}
|
|
this.zza = zzsVar;
|
|
if (zzsVar.zzc() && getMinApkVersion() < 17895000) {
|
|
throw new IllegalStateException("Internal Error, the minimum apk version of this BaseGmsClient is too low to support dynamic lookup. Start service action: ".concat(String.valueOf(this.zza.zza())));
|
|
}
|
|
GmsClientSupervisor gmsClientSupervisor2 = this.zzn;
|
|
String zza3 = this.zza.zza();
|
|
Preconditions.checkNotNull(zza3);
|
|
ConnectionResult zza4 = gmsClientSupervisor2.zza(new zzn(zza3, this.zza.zzb(), 4225, this.zza.zzc()), zzeVar2, zza(), getBindServiceExecutor());
|
|
if (!zza4.isSuccess()) {
|
|
String zza5 = this.zza.zza();
|
|
String zzb2 = this.zza.zzb();
|
|
StringBuilder sb2 = new StringBuilder(String.valueOf(zza5).length() + 34 + String.valueOf(zzb2).length());
|
|
sb2.append("unable to connect to service: ");
|
|
sb2.append(zza5);
|
|
sb2.append(" on ");
|
|
sb2.append(zzb2);
|
|
Log.w("GmsClient", sb2.toString());
|
|
if (zza4.getErrorCode() == -1) {
|
|
errorCode = 16;
|
|
} else {
|
|
errorCode = zza4.getErrorCode();
|
|
}
|
|
if (zza4.getResolution() != null) {
|
|
bundle = new Bundle();
|
|
bundle.putParcelable(KEY_PENDING_INTENT, zza4.getResolution());
|
|
}
|
|
zzb(errorCode, bundle, this.zzd.get());
|
|
}
|
|
}
|
|
} else {
|
|
zze zzeVar3 = this.zzu;
|
|
if (zzeVar3 != null) {
|
|
GmsClientSupervisor gmsClientSupervisor3 = this.zzn;
|
|
String zza6 = this.zza.zza();
|
|
Preconditions.checkNotNull(zza6);
|
|
gmsClientSupervisor3.zzb(zza6, this.zza.zzb(), 4225, zzeVar3, zza(), this.zza.zzc());
|
|
this.zzu = null;
|
|
}
|
|
}
|
|
} finally {
|
|
}
|
|
}
|
|
}
|
|
|
|
@KeepForSdk
|
|
public void checkAvailabilityAndConnect() {
|
|
int isGooglePlayServicesAvailable = this.zzo.isGooglePlayServicesAvailable(this.zzl, getMinApkVersion());
|
|
if (isGooglePlayServicesAvailable != 0) {
|
|
zzp(1, null);
|
|
triggerNotAvailable(new LegacyClientCallbackAdapter(this), isGooglePlayServicesAvailable, null);
|
|
} else {
|
|
connect(new LegacyClientCallbackAdapter(this));
|
|
}
|
|
}
|
|
|
|
@KeepForSdk
|
|
public final void checkConnected() {
|
|
if (isConnected()) {
|
|
} else {
|
|
throw new IllegalStateException("Not connected. Call connect() and wait for onConnected() to be called.");
|
|
}
|
|
}
|
|
|
|
@KeepForSdk
|
|
public void connect(@NonNull ConnectionProgressReportCallbacks connectionProgressReportCallbacks) {
|
|
Preconditions.checkNotNull(connectionProgressReportCallbacks, "Connection progress callbacks cannot be null.");
|
|
this.zzc = connectionProgressReportCallbacks;
|
|
zzp(2, null);
|
|
}
|
|
|
|
@Nullable
|
|
@KeepForSdk
|
|
public abstract T createServiceInterface(@NonNull IBinder iBinder);
|
|
|
|
@KeepForSdk
|
|
public void disconnect() {
|
|
this.zzd.incrementAndGet();
|
|
ArrayList arrayList = this.zzt;
|
|
synchronized (arrayList) {
|
|
try {
|
|
int size = arrayList.size();
|
|
for (int i = 0; i < size; i++) {
|
|
((zzc) arrayList.get(i)).zzf();
|
|
}
|
|
arrayList.clear();
|
|
} catch (Throwable th) {
|
|
throw th;
|
|
}
|
|
}
|
|
synchronized (this.zzq) {
|
|
this.zzr = null;
|
|
}
|
|
zzp(1, null);
|
|
}
|
|
|
|
@KeepForSdk
|
|
public void dump(@NonNull String str, @NonNull FileDescriptor fileDescriptor, @NonNull PrintWriter printWriter, @NonNull String[] strArr) {
|
|
int i;
|
|
IInterface iInterface;
|
|
IGmsServiceBroker iGmsServiceBroker;
|
|
long j;
|
|
synchronized (this.zzp) {
|
|
i = this.zzv;
|
|
iInterface = this.zzs;
|
|
}
|
|
synchronized (this.zzq) {
|
|
iGmsServiceBroker = this.zzr;
|
|
}
|
|
printWriter.append((CharSequence) str).append("mConnectState=");
|
|
if (i != 1) {
|
|
if (i != 2) {
|
|
if (i != 3) {
|
|
if (i != 4) {
|
|
if (i != 5) {
|
|
printWriter.print("UNKNOWN");
|
|
} else {
|
|
printWriter.print("DISCONNECTING");
|
|
}
|
|
} else {
|
|
printWriter.print("CONNECTED");
|
|
}
|
|
} else {
|
|
printWriter.print("LOCAL_CONNECTING");
|
|
}
|
|
} else {
|
|
printWriter.print("REMOTE_CONNECTING");
|
|
}
|
|
} else {
|
|
printWriter.print("DISCONNECTED");
|
|
}
|
|
printWriter.append(" mService=");
|
|
if (iInterface == null) {
|
|
printWriter.append("null");
|
|
} else {
|
|
printWriter.append((CharSequence) getServiceDescriptor()).append("@").append((CharSequence) Integer.toHexString(System.identityHashCode(iInterface.asBinder())));
|
|
}
|
|
printWriter.append(" mServiceBroker=");
|
|
if (iGmsServiceBroker == null) {
|
|
printWriter.println("null");
|
|
} else {
|
|
printWriter.append("IGmsServiceBroker@").println(Integer.toHexString(System.identityHashCode(iGmsServiceBroker.asBinder())));
|
|
}
|
|
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS", Locale.US);
|
|
if (this.zzh > 0) {
|
|
PrintWriter append = printWriter.append((CharSequence) str).append("lastConnectedTime=");
|
|
long j2 = this.zzh;
|
|
String format = simpleDateFormat.format(new Date(j2));
|
|
j = 0;
|
|
StringBuilder sb = new StringBuilder(String.valueOf(j2).length() + 1 + String.valueOf(format).length());
|
|
sb.append(j2);
|
|
sb.append(" ");
|
|
sb.append(format);
|
|
append.println(sb.toString());
|
|
} else {
|
|
j = 0;
|
|
}
|
|
if (this.zzg > j) {
|
|
printWriter.append((CharSequence) str).append("lastSuspendedCause=");
|
|
int i2 = this.zzf;
|
|
if (i2 != 1) {
|
|
if (i2 != 2) {
|
|
if (i2 != 3) {
|
|
printWriter.append((CharSequence) String.valueOf(i2));
|
|
} else {
|
|
printWriter.append("CAUSE_DEAD_OBJECT_EXCEPTION");
|
|
}
|
|
} else {
|
|
printWriter.append("CAUSE_NETWORK_LOST");
|
|
}
|
|
} else {
|
|
printWriter.append("CAUSE_SERVICE_DISCONNECTED");
|
|
}
|
|
PrintWriter append2 = printWriter.append(" lastSuspendedTime=");
|
|
long j3 = this.zzg;
|
|
String format2 = simpleDateFormat.format(new Date(j3));
|
|
StringBuilder sb2 = new StringBuilder(String.valueOf(j3).length() + 1 + String.valueOf(format2).length());
|
|
sb2.append(j3);
|
|
sb2.append(" ");
|
|
sb2.append(format2);
|
|
append2.println(sb2.toString());
|
|
}
|
|
if (this.zzj > j) {
|
|
printWriter.append((CharSequence) str).append("lastFailedStatus=").append((CharSequence) CommonStatusCodes.getStatusCodeString(this.zzi));
|
|
PrintWriter append3 = printWriter.append(" lastFailedTime=");
|
|
long j4 = this.zzj;
|
|
String format3 = simpleDateFormat.format(new Date(j4));
|
|
StringBuilder sb3 = new StringBuilder(String.valueOf(j4).length() + 1 + String.valueOf(format3).length());
|
|
sb3.append(j4);
|
|
sb3.append(" ");
|
|
sb3.append(format3);
|
|
append3.println(sb3.toString());
|
|
}
|
|
}
|
|
|
|
@KeepForSdk
|
|
public boolean enableLocalFallback() {
|
|
return false;
|
|
}
|
|
|
|
@Nullable
|
|
@KeepForSdk
|
|
public Account getAccount() {
|
|
return null;
|
|
}
|
|
|
|
@NonNull
|
|
@KeepForSdk
|
|
public Feature[] getApiFeatures() {
|
|
return zze;
|
|
}
|
|
|
|
@Nullable
|
|
@KeepForSdk
|
|
public AttributionSourceWrapper getAttributionSourceWrapper() {
|
|
return this.zzB;
|
|
}
|
|
|
|
@Nullable
|
|
@KeepForSdk
|
|
public final Feature[] getAvailableFeatures() {
|
|
zzj zzjVar = this.zzE;
|
|
if (zzjVar == null) {
|
|
return null;
|
|
}
|
|
return zzjVar.zzb;
|
|
}
|
|
|
|
@Nullable
|
|
@KeepForSdk
|
|
public Executor getBindServiceExecutor() {
|
|
return null;
|
|
}
|
|
|
|
@Nullable
|
|
@KeepForSdk
|
|
public Bundle getConnectionHint() {
|
|
return null;
|
|
}
|
|
|
|
@NonNull
|
|
@KeepForSdk
|
|
public final Context getContext() {
|
|
return this.zzl;
|
|
}
|
|
|
|
@NonNull
|
|
@KeepForSdk
|
|
public String getEndpointPackageName() {
|
|
zzs zzsVar;
|
|
if (isConnected() && (zzsVar = this.zza) != null) {
|
|
return zzsVar.zzb();
|
|
}
|
|
throw new RuntimeException("Failed to connect when checking package");
|
|
}
|
|
|
|
@KeepForSdk
|
|
public int getGCoreServiceId() {
|
|
return this.zzy;
|
|
}
|
|
|
|
@NonNull
|
|
@KeepForSdk
|
|
public Bundle getGetServiceRequestExtraArgs() {
|
|
return new Bundle();
|
|
}
|
|
|
|
@Nullable
|
|
@KeepForSdk
|
|
public String getLastDisconnectMessage() {
|
|
return this.zzk;
|
|
}
|
|
|
|
@Nullable
|
|
@KeepForSdk
|
|
public String getLocalStartServiceAction() {
|
|
return null;
|
|
}
|
|
|
|
@NonNull
|
|
@KeepForSdk
|
|
public final Looper getLooper() {
|
|
return this.zzm;
|
|
}
|
|
|
|
@KeepForSdk
|
|
public int getMinApkVersion() {
|
|
return GoogleApiAvailabilityLight.GOOGLE_PLAY_SERVICES_VERSION_CODE;
|
|
}
|
|
|
|
@KeepForSdk
|
|
@WorkerThread
|
|
public void getRemoteService(@Nullable IAccountAccessor iAccountAccessor, @NonNull Set<Scope> set) {
|
|
String attributionTag;
|
|
Bundle getServiceRequestExtraArgs = getGetServiceRequestExtraArgs();
|
|
if (Build.VERSION.SDK_INT < 31) {
|
|
attributionTag = this.zzA;
|
|
} else if (this.zzB == null) {
|
|
attributionTag = this.zzA;
|
|
} else {
|
|
AttributionSource attributionSource = this.zzB.getAttributionSource();
|
|
if (attributionSource == null) {
|
|
attributionTag = this.zzA;
|
|
} else if (attributionSource.getAttributionTag() == null) {
|
|
attributionTag = this.zzA;
|
|
} else {
|
|
attributionTag = attributionSource.getAttributionTag();
|
|
}
|
|
}
|
|
String str = attributionTag;
|
|
int i = this.zzy;
|
|
int i2 = GoogleApiAvailabilityLight.GOOGLE_PLAY_SERVICES_VERSION_CODE;
|
|
Scope[] scopeArr = GetServiceRequest.zza;
|
|
Bundle bundle = new Bundle();
|
|
Feature[] featureArr = GetServiceRequest.zzb;
|
|
GetServiceRequest getServiceRequest = new GetServiceRequest(6, i, i2, null, null, scopeArr, bundle, null, featureArr, featureArr, true, 0, false, str);
|
|
getServiceRequest.zzf = this.zzl.getPackageName();
|
|
getServiceRequest.zzi = getServiceRequestExtraArgs;
|
|
if (set != null) {
|
|
getServiceRequest.zzh = (Scope[]) set.toArray(new Scope[0]);
|
|
}
|
|
if (requiresSignIn()) {
|
|
Account account = getAccount();
|
|
if (account == null) {
|
|
account = new Account("<<default account>>", "com.google");
|
|
}
|
|
getServiceRequest.zzj = account;
|
|
if (iAccountAccessor != null) {
|
|
getServiceRequest.zzg = iAccountAccessor.asBinder();
|
|
}
|
|
} else if (requiresAccount()) {
|
|
getServiceRequest.zzj = getAccount();
|
|
}
|
|
getServiceRequest.zzk = zze;
|
|
getServiceRequest.zzl = getApiFeatures();
|
|
if (usesClientTelemetry()) {
|
|
getServiceRequest.zzo = true;
|
|
}
|
|
try {
|
|
synchronized (this.zzq) {
|
|
try {
|
|
IGmsServiceBroker iGmsServiceBroker = this.zzr;
|
|
if (iGmsServiceBroker != null) {
|
|
iGmsServiceBroker.getService(new zzd(this, this.zzd.get()), getServiceRequest);
|
|
} else {
|
|
Log.w("GmsClient", "mServiceBroker is null, client disconnected");
|
|
}
|
|
} finally {
|
|
}
|
|
}
|
|
} catch (DeadObjectException e) {
|
|
Log.w("GmsClient", "IGmsServiceBroker.getService failed", e);
|
|
triggerConnectionSuspended(3);
|
|
} catch (RemoteException e2) {
|
|
e = e2;
|
|
Log.w("GmsClient", "IGmsServiceBroker.getService failed", e);
|
|
onPostInitHandler(8, null, null, this.zzd.get());
|
|
} catch (SecurityException e3) {
|
|
throw e3;
|
|
} catch (RuntimeException e4) {
|
|
e = e4;
|
|
Log.w("GmsClient", "IGmsServiceBroker.getService failed", e);
|
|
onPostInitHandler(8, null, null, this.zzd.get());
|
|
}
|
|
}
|
|
|
|
@NonNull
|
|
@KeepForSdk
|
|
public Set<Scope> getScopes() {
|
|
return Collections.EMPTY_SET;
|
|
}
|
|
|
|
@NonNull
|
|
@KeepForSdk
|
|
public final T getService() {
|
|
T t;
|
|
synchronized (this.zzp) {
|
|
try {
|
|
if (this.zzv != 5) {
|
|
checkConnected();
|
|
t = (T) this.zzs;
|
|
Preconditions.checkNotNull(t, "Client is connected but service is null");
|
|
} else {
|
|
throw new DeadObjectException();
|
|
}
|
|
} catch (Throwable th) {
|
|
throw th;
|
|
}
|
|
}
|
|
return t;
|
|
}
|
|
|
|
@Nullable
|
|
@KeepForSdk
|
|
public IBinder getServiceBrokerBinder() {
|
|
synchronized (this.zzq) {
|
|
try {
|
|
IGmsServiceBroker iGmsServiceBroker = this.zzr;
|
|
if (iGmsServiceBroker == null) {
|
|
return null;
|
|
}
|
|
return iGmsServiceBroker.asBinder();
|
|
} catch (Throwable th) {
|
|
throw th;
|
|
}
|
|
}
|
|
}
|
|
|
|
@NonNull
|
|
@KeepForSdk
|
|
public abstract String getServiceDescriptor();
|
|
|
|
@NonNull
|
|
@KeepForSdk
|
|
public Intent getSignInIntent() {
|
|
throw new UnsupportedOperationException("Not a sign in API");
|
|
}
|
|
|
|
@NonNull
|
|
@KeepForSdk
|
|
public abstract String getStartServiceAction();
|
|
|
|
@NonNull
|
|
@KeepForSdk
|
|
public String getStartServicePackage() {
|
|
return "com.google.android.gms";
|
|
}
|
|
|
|
@Nullable
|
|
@KeepForSdk
|
|
public ConnectionTelemetryConfiguration getTelemetryConfiguration() {
|
|
zzj zzjVar = this.zzE;
|
|
if (zzjVar == null) {
|
|
return null;
|
|
}
|
|
return zzjVar.zzd;
|
|
}
|
|
|
|
@KeepForSdk
|
|
public boolean getUseDynamicLookup() {
|
|
if (getMinApkVersion() >= 211700000) {
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
|
|
@KeepForSdk
|
|
public boolean hasConnectionInfo() {
|
|
return this.zzE != null;
|
|
}
|
|
|
|
@KeepForSdk
|
|
public boolean isConnected() {
|
|
boolean z;
|
|
synchronized (this.zzp) {
|
|
if (this.zzv == 4) {
|
|
z = true;
|
|
} else {
|
|
z = false;
|
|
}
|
|
}
|
|
return z;
|
|
}
|
|
|
|
@KeepForSdk
|
|
public boolean isConnecting() {
|
|
boolean z;
|
|
synchronized (this.zzp) {
|
|
int i = this.zzv;
|
|
z = true;
|
|
if (i != 2 && i != 3) {
|
|
z = false;
|
|
}
|
|
}
|
|
return z;
|
|
}
|
|
|
|
@KeepForSdk
|
|
@CallSuper
|
|
public void onConnectedLocked(@NonNull T t) {
|
|
this.zzh = System.currentTimeMillis();
|
|
}
|
|
|
|
@KeepForSdk
|
|
@CallSuper
|
|
public void onConnectionFailed(@NonNull ConnectionResult connectionResult) {
|
|
this.zzi = connectionResult.getErrorCode();
|
|
this.zzj = System.currentTimeMillis();
|
|
}
|
|
|
|
@KeepForSdk
|
|
@CallSuper
|
|
public void onConnectionSuspended(int i) {
|
|
this.zzf = i;
|
|
this.zzg = System.currentTimeMillis();
|
|
}
|
|
|
|
@KeepForSdk
|
|
public void onPostInitHandler(int i, @Nullable IBinder iBinder, @Nullable Bundle bundle, int i2) {
|
|
zzf zzfVar = new zzf(this, i, iBinder, bundle);
|
|
Handler handler = this.zzb;
|
|
handler.sendMessage(handler.obtainMessage(1, i2, -1, zzfVar));
|
|
}
|
|
|
|
@KeepForSdk
|
|
public void onUserSignOut(@NonNull SignOutCallbacks signOutCallbacks) {
|
|
signOutCallbacks.onSignOutComplete();
|
|
}
|
|
|
|
@KeepForSdk
|
|
public boolean providesSignIn() {
|
|
return false;
|
|
}
|
|
|
|
@KeepForSdk
|
|
public boolean requiresAccount() {
|
|
return false;
|
|
}
|
|
|
|
@KeepForSdk
|
|
public boolean requiresGooglePlayServices() {
|
|
return true;
|
|
}
|
|
|
|
@KeepForSdk
|
|
public boolean requiresSignIn() {
|
|
return false;
|
|
}
|
|
|
|
@KeepForSdk
|
|
public void setAttributionSourceWrapper(@NonNull AttributionSourceWrapper attributionSourceWrapper) {
|
|
this.zzB = attributionSourceWrapper;
|
|
}
|
|
|
|
@KeepForSdk
|
|
public void setAttributionTag(@NonNull String str) {
|
|
this.zzA = str;
|
|
}
|
|
|
|
@KeepForSdk
|
|
public void triggerConnectionSuspended(int i) {
|
|
int i2 = this.zzd.get();
|
|
Handler handler = this.zzb;
|
|
handler.sendMessage(handler.obtainMessage(6, i2, i));
|
|
}
|
|
|
|
@KeepForSdk
|
|
@VisibleForTesting
|
|
public void triggerNotAvailable(@NonNull ConnectionProgressReportCallbacks connectionProgressReportCallbacks, int i, @Nullable PendingIntent pendingIntent) {
|
|
Preconditions.checkNotNull(connectionProgressReportCallbacks, "Connection progress callbacks cannot be null.");
|
|
this.zzc = connectionProgressReportCallbacks;
|
|
int i2 = this.zzd.get();
|
|
Handler handler = this.zzb;
|
|
handler.sendMessage(handler.obtainMessage(3, i2, i, pendingIntent));
|
|
}
|
|
|
|
@KeepForSdk
|
|
public boolean usesClientTelemetry() {
|
|
return false;
|
|
}
|
|
|
|
@NonNull
|
|
public final String zza() {
|
|
String str = this.zzz;
|
|
if (str == null) {
|
|
return this.zzl.getClass().getName();
|
|
}
|
|
return str;
|
|
}
|
|
|
|
public final void zzb(int i, @Nullable Bundle bundle, int i2) {
|
|
zzg zzgVar = new zzg(this, i, bundle);
|
|
Handler handler = this.zzb;
|
|
handler.sendMessage(handler.obtainMessage(7, i2, -1, zzgVar));
|
|
}
|
|
|
|
public final /* synthetic */ void zzc(zzj zzjVar) {
|
|
RootTelemetryConfiguration zza;
|
|
this.zzE = zzjVar;
|
|
if (usesClientTelemetry()) {
|
|
ConnectionTelemetryConfiguration connectionTelemetryConfiguration = zzjVar.zzd;
|
|
RootTelemetryConfigManager rootTelemetryConfigManager = RootTelemetryConfigManager.getInstance();
|
|
if (connectionTelemetryConfiguration == null) {
|
|
zza = null;
|
|
} else {
|
|
zza = connectionTelemetryConfiguration.zza();
|
|
}
|
|
rootTelemetryConfigManager.zza(zza);
|
|
}
|
|
}
|
|
|
|
public final /* synthetic */ void zzd(int i, IInterface iInterface) {
|
|
zzp(i, null);
|
|
}
|
|
|
|
public final /* synthetic */ boolean zze(int i, int i2, IInterface iInterface) {
|
|
synchronized (this.zzp) {
|
|
try {
|
|
if (this.zzv != i) {
|
|
return false;
|
|
}
|
|
zzp(i2, iInterface);
|
|
return true;
|
|
} catch (Throwable th) {
|
|
throw th;
|
|
}
|
|
}
|
|
}
|
|
|
|
public final /* synthetic */ void zzf(int i) {
|
|
int i2;
|
|
int i3;
|
|
synchronized (this.zzp) {
|
|
i2 = this.zzv;
|
|
}
|
|
if (i2 == 3) {
|
|
this.zzD = true;
|
|
i3 = 5;
|
|
} else {
|
|
i3 = 4;
|
|
}
|
|
Handler handler = this.zzb;
|
|
handler.sendMessage(handler.obtainMessage(i3, this.zzd.get(), 16));
|
|
}
|
|
|
|
public final /* synthetic */ boolean zzg() {
|
|
if (this.zzD || TextUtils.isEmpty(getServiceDescriptor()) || TextUtils.isEmpty(getLocalStartServiceAction())) {
|
|
return false;
|
|
}
|
|
try {
|
|
Class.forName(getServiceDescriptor());
|
|
return true;
|
|
} catch (ClassNotFoundException unused) {
|
|
return false;
|
|
}
|
|
}
|
|
|
|
public final /* synthetic */ Object zzh() {
|
|
return this.zzq;
|
|
}
|
|
|
|
public final /* synthetic */ void zzi(IGmsServiceBroker iGmsServiceBroker) {
|
|
this.zzr = iGmsServiceBroker;
|
|
}
|
|
|
|
public final /* synthetic */ ArrayList zzj() {
|
|
return this.zzt;
|
|
}
|
|
|
|
public final /* synthetic */ BaseConnectionCallbacks zzk() {
|
|
return this.zzw;
|
|
}
|
|
|
|
public final /* synthetic */ BaseOnConnectionFailedListener zzl() {
|
|
return this.zzx;
|
|
}
|
|
|
|
public final /* synthetic */ ConnectionResult zzm() {
|
|
return this.zzC;
|
|
}
|
|
|
|
public final /* synthetic */ void zzn(ConnectionResult connectionResult) {
|
|
this.zzC = connectionResult;
|
|
}
|
|
|
|
public final /* synthetic */ boolean zzo() {
|
|
return this.zzD;
|
|
}
|
|
|
|
/* JADX WARN: Illegal instructions before constructor call */
|
|
@com.google.android.gms.common.annotation.KeepForSdk
|
|
/*
|
|
Code decompiled incorrectly, please refer to instructions dump.
|
|
To view partially-correct add '--show-bad-code' argument
|
|
*/
|
|
public BaseGmsClient(@androidx.annotation.NonNull android.content.Context r10, @androidx.annotation.NonNull android.os.Looper r11, int r12, @androidx.annotation.Nullable com.google.android.gms.common.internal.BaseGmsClient.BaseConnectionCallbacks r13, @androidx.annotation.Nullable com.google.android.gms.common.internal.BaseGmsClient.BaseOnConnectionFailedListener r14, @androidx.annotation.Nullable java.lang.String r15) {
|
|
/*
|
|
r9 = this;
|
|
com.google.android.gms.common.internal.GmsClientSupervisor r3 = com.google.android.gms.common.internal.GmsClientSupervisor.getInstance(r10)
|
|
com.google.android.gms.common.GoogleApiAvailabilityLight r4 = com.google.android.gms.common.GoogleApiAvailabilityLight.getInstance()
|
|
com.google.android.gms.common.internal.Preconditions.checkNotNull(r13)
|
|
com.google.android.gms.common.internal.Preconditions.checkNotNull(r14)
|
|
r0 = r9
|
|
r1 = r10
|
|
r2 = r11
|
|
r5 = r12
|
|
r6 = r13
|
|
r7 = r14
|
|
r8 = r15
|
|
r0.<init>(r1, r2, r3, r4, r5, r6, r7, r8)
|
|
return
|
|
*/
|
|
throw new UnsupportedOperationException("Method not decompiled: com.google.android.gms.common.internal.BaseGmsClient.<init>(android.content.Context, android.os.Looper, int, com.google.android.gms.common.internal.BaseGmsClient$BaseConnectionCallbacks, com.google.android.gms.common.internal.BaseGmsClient$BaseOnConnectionFailedListener, java.lang.String):void");
|
|
}
|
|
|
|
@KeepForSdk
|
|
public void disconnect(@NonNull String str) {
|
|
this.zzk = str;
|
|
disconnect();
|
|
}
|
|
|
|
@KeepForSdk
|
|
@VisibleForTesting
|
|
public BaseGmsClient(@NonNull Context context, @NonNull Looper looper, @NonNull GmsClientSupervisor gmsClientSupervisor, @NonNull GoogleApiAvailabilityLight googleApiAvailabilityLight, int i, @Nullable BaseConnectionCallbacks baseConnectionCallbacks, @Nullable BaseOnConnectionFailedListener baseOnConnectionFailedListener, @Nullable String str) {
|
|
this.zzk = null;
|
|
this.zzp = new Object();
|
|
this.zzq = new Object();
|
|
this.zzt = new ArrayList();
|
|
this.zzv = 1;
|
|
this.zzC = null;
|
|
this.zzD = false;
|
|
this.zzE = null;
|
|
this.zzd = new AtomicInteger(0);
|
|
Preconditions.checkNotNull(context, "Context must not be null");
|
|
this.zzl = context;
|
|
Preconditions.checkNotNull(looper, "Looper must not be null");
|
|
this.zzm = looper;
|
|
Preconditions.checkNotNull(gmsClientSupervisor, "Supervisor must not be null");
|
|
this.zzn = gmsClientSupervisor;
|
|
Preconditions.checkNotNull(googleApiAvailabilityLight, "API availability must not be null");
|
|
this.zzo = googleApiAvailabilityLight;
|
|
this.zzb = new zzb(this, looper);
|
|
this.zzy = i;
|
|
this.zzw = baseConnectionCallbacks;
|
|
this.zzx = baseOnConnectionFailedListener;
|
|
this.zzz = str;
|
|
}
|
|
}
|