Primer paso de la investigacion. Se aportan el .apk, las carpetas con el apk extraido y el apk descompilado. El archivo API_DOCUMENTATION.md es un archivo donde se anotaran los descubrimientos del funcionamiento de la API, y los .py son scripts para probar la funcionalidad de la API con los métodos que vayamos encontrando. Finalmente, los archivos .js son scripts de Frida para extraer informacion de la APP durante la ejecucion.
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
package com.google.android.gms.common.util;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.pm.PackageInfo;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.content.pm.Signature;
|
||||
import com.google.android.gms.common.annotation.KeepForSdk;
|
||||
import com.google.android.gms.common.internal.ShowFirstParty;
|
||||
import com.google.android.gms.common.wrappers.Wrappers;
|
||||
import java.security.MessageDigest;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
|
||||
@ShowFirstParty
|
||||
@KeepForSdk
|
||||
/* loaded from: classes3.dex */
|
||||
public class AndroidUtilsLight {
|
||||
private static volatile int zza = -1;
|
||||
|
||||
@KeepForSdk
|
||||
@Deprecated
|
||||
public static byte[] getPackageCertificateHashBytes(Context context, String str) throws PackageManager.NameNotFoundException {
|
||||
MessageDigest zza2;
|
||||
PackageInfo packageInfo = Wrappers.packageManager(context).getPackageInfo(str, 64);
|
||||
Signature[] signatureArr = packageInfo.signatures;
|
||||
if (signatureArr == null || signatureArr.length != 1 || (zza2 = zza("SHA1")) == null) {
|
||||
return null;
|
||||
}
|
||||
return zza2.digest(packageInfo.signatures[0].toByteArray());
|
||||
}
|
||||
|
||||
public static MessageDigest zza(String str) {
|
||||
MessageDigest messageDigest;
|
||||
for (int i = 0; i < 2; i++) {
|
||||
try {
|
||||
messageDigest = MessageDigest.getInstance(str);
|
||||
} catch (NoSuchAlgorithmException unused) {
|
||||
}
|
||||
if (messageDigest != null) {
|
||||
return messageDigest;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,243 @@
|
||||
package com.google.android.gms.common.util;
|
||||
|
||||
import com.google.android.gms.common.annotation.KeepForSdk;
|
||||
import com.google.android.gms.common.internal.Objects;
|
||||
import java.lang.reflect.Array;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.Iterator;
|
||||
|
||||
@VisibleForTesting
|
||||
@KeepForSdk
|
||||
/* loaded from: classes3.dex */
|
||||
public final class ArrayUtils {
|
||||
private ArrayUtils() {
|
||||
}
|
||||
|
||||
@KeepForSdk
|
||||
public static <T> T[] concat(T[]... tArr) {
|
||||
if (tArr.length == 0) {
|
||||
return (T[]) ((Object[]) Array.newInstance(tArr.getClass(), 0));
|
||||
}
|
||||
int i = 0;
|
||||
for (T[] tArr2 : tArr) {
|
||||
i += tArr2.length;
|
||||
}
|
||||
T[] tArr3 = (T[]) Arrays.copyOf(tArr[0], i);
|
||||
int length = tArr[0].length;
|
||||
for (int i4 = 1; i4 < tArr.length; i4++) {
|
||||
T[] tArr4 = tArr[i4];
|
||||
int length2 = tArr4.length;
|
||||
System.arraycopy(tArr4, 0, tArr3, length, length2);
|
||||
length += length2;
|
||||
}
|
||||
return tArr3;
|
||||
}
|
||||
|
||||
@KeepForSdk
|
||||
public static byte[] concatByteArrays(byte[]... bArr) {
|
||||
if (bArr.length == 0) {
|
||||
return new byte[0];
|
||||
}
|
||||
int i = 0;
|
||||
for (byte[] bArr2 : bArr) {
|
||||
i += bArr2.length;
|
||||
}
|
||||
byte[] copyOf = Arrays.copyOf(bArr[0], i);
|
||||
int length = bArr[0].length;
|
||||
for (int i4 = 1; i4 < bArr.length; i4++) {
|
||||
byte[] bArr3 = bArr[i4];
|
||||
int length2 = bArr3.length;
|
||||
System.arraycopy(bArr3, 0, copyOf, length, length2);
|
||||
length += length2;
|
||||
}
|
||||
return copyOf;
|
||||
}
|
||||
|
||||
@KeepForSdk
|
||||
public static boolean contains(int[] iArr, int i) {
|
||||
if (iArr == null) {
|
||||
return false;
|
||||
}
|
||||
for (int i4 : iArr) {
|
||||
if (i4 == i) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@KeepForSdk
|
||||
public static <T> ArrayList<T> newArrayList() {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
|
||||
@KeepForSdk
|
||||
public static <T> T[] removeAll(T[] tArr, T... tArr2) {
|
||||
int length;
|
||||
int i;
|
||||
if (tArr == null) {
|
||||
return null;
|
||||
}
|
||||
if (tArr2 == null || (length = tArr2.length) == 0) {
|
||||
return (T[]) Arrays.copyOf(tArr, tArr.length);
|
||||
}
|
||||
T[] tArr3 = (T[]) ((Object[]) Array.newInstance(tArr2.getClass().getComponentType(), tArr.length));
|
||||
if (length == 1) {
|
||||
i = 0;
|
||||
for (T t2 : tArr) {
|
||||
if (!Objects.equal(tArr2[0], t2)) {
|
||||
tArr3[i] = t2;
|
||||
i++;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
int i4 = 0;
|
||||
for (T t4 : tArr) {
|
||||
if (!contains(tArr2, t4)) {
|
||||
tArr3[i4] = t4;
|
||||
i4++;
|
||||
}
|
||||
}
|
||||
i = i4;
|
||||
}
|
||||
if (tArr3 == null) {
|
||||
return null;
|
||||
}
|
||||
return i == tArr3.length ? tArr3 : (T[]) Arrays.copyOf(tArr3, i);
|
||||
}
|
||||
|
||||
@KeepForSdk
|
||||
public static <T> ArrayList<T> toArrayList(T[] tArr) {
|
||||
ArrayList<T> arrayList = new ArrayList<>(tArr.length);
|
||||
for (T t2 : tArr) {
|
||||
arrayList.add(t2);
|
||||
}
|
||||
return arrayList;
|
||||
}
|
||||
|
||||
@KeepForSdk
|
||||
public static int[] toPrimitiveArray(Collection<Integer> collection) {
|
||||
int i = 0;
|
||||
if (collection == null || collection.isEmpty()) {
|
||||
return new int[0];
|
||||
}
|
||||
int[] iArr = new int[collection.size()];
|
||||
Iterator<Integer> it = collection.iterator();
|
||||
while (it.hasNext()) {
|
||||
iArr[i] = it.next().intValue();
|
||||
i++;
|
||||
}
|
||||
return iArr;
|
||||
}
|
||||
|
||||
@KeepForSdk
|
||||
public static Integer[] toWrapperArray(int[] iArr) {
|
||||
if (iArr == null) {
|
||||
return null;
|
||||
}
|
||||
int length = iArr.length;
|
||||
Integer[] numArr = new Integer[length];
|
||||
for (int i = 0; i < length; i++) {
|
||||
numArr[i] = Integer.valueOf(iArr[i]);
|
||||
}
|
||||
return numArr;
|
||||
}
|
||||
|
||||
@KeepForSdk
|
||||
public static void writeArray(StringBuilder sb, double[] dArr) {
|
||||
int length = dArr.length;
|
||||
for (int i = 0; i < length; i++) {
|
||||
if (i != 0) {
|
||||
sb.append(",");
|
||||
}
|
||||
sb.append(Double.toString(dArr[i]));
|
||||
}
|
||||
}
|
||||
|
||||
@KeepForSdk
|
||||
public static void writeStringArray(StringBuilder sb, String[] strArr) {
|
||||
int length = strArr.length;
|
||||
for (int i = 0; i < length; i++) {
|
||||
if (i != 0) {
|
||||
sb.append(",");
|
||||
}
|
||||
sb.append("\"");
|
||||
sb.append(strArr[i]);
|
||||
sb.append("\"");
|
||||
}
|
||||
}
|
||||
|
||||
@KeepForSdk
|
||||
public static <T> boolean contains(T[] tArr, T t2) {
|
||||
int length = tArr != null ? tArr.length : 0;
|
||||
int i = 0;
|
||||
while (true) {
|
||||
if (i >= length) {
|
||||
break;
|
||||
}
|
||||
if (!Objects.equal(tArr[i], t2)) {
|
||||
i++;
|
||||
} else if (i >= 0) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@KeepForSdk
|
||||
public static void writeArray(StringBuilder sb, float[] fArr) {
|
||||
int length = fArr.length;
|
||||
for (int i = 0; i < length; i++) {
|
||||
if (i != 0) {
|
||||
sb.append(",");
|
||||
}
|
||||
sb.append(Float.toString(fArr[i]));
|
||||
}
|
||||
}
|
||||
|
||||
@KeepForSdk
|
||||
public static void writeArray(StringBuilder sb, int[] iArr) {
|
||||
int length = iArr.length;
|
||||
for (int i = 0; i < length; i++) {
|
||||
if (i != 0) {
|
||||
sb.append(",");
|
||||
}
|
||||
sb.append(Integer.toString(iArr[i]));
|
||||
}
|
||||
}
|
||||
|
||||
@KeepForSdk
|
||||
public static void writeArray(StringBuilder sb, long[] jArr) {
|
||||
int length = jArr.length;
|
||||
for (int i = 0; i < length; i++) {
|
||||
if (i != 0) {
|
||||
sb.append(",");
|
||||
}
|
||||
sb.append(Long.toString(jArr[i]));
|
||||
}
|
||||
}
|
||||
|
||||
@KeepForSdk
|
||||
public static <T> void writeArray(StringBuilder sb, T[] tArr) {
|
||||
int length = tArr.length;
|
||||
for (int i = 0; i < length; i++) {
|
||||
if (i != 0) {
|
||||
sb.append(",");
|
||||
}
|
||||
sb.append(tArr[i]);
|
||||
}
|
||||
}
|
||||
|
||||
@KeepForSdk
|
||||
public static void writeArray(StringBuilder sb, boolean[] zArr) {
|
||||
int length = zArr.length;
|
||||
for (int i = 0; i < length; i++) {
|
||||
if (i != 0) {
|
||||
sb.append(",");
|
||||
}
|
||||
sb.append(Boolean.toString(zArr[i]));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
package com.google.android.gms.common.util;
|
||||
|
||||
import android.util.Base64;
|
||||
import com.google.android.gms.common.annotation.KeepForSdk;
|
||||
|
||||
@KeepForSdk
|
||||
/* loaded from: classes3.dex */
|
||||
public final class Base64Utils {
|
||||
@KeepForSdk
|
||||
public static byte[] decode(String str) {
|
||||
if (str == null) {
|
||||
return null;
|
||||
}
|
||||
return Base64.decode(str, 0);
|
||||
}
|
||||
|
||||
@KeepForSdk
|
||||
public static byte[] decodeUrlSafe(String str) {
|
||||
if (str == null) {
|
||||
return null;
|
||||
}
|
||||
return Base64.decode(str, 10);
|
||||
}
|
||||
|
||||
@KeepForSdk
|
||||
public static byte[] decodeUrlSafeNoPadding(String str) {
|
||||
if (str == null) {
|
||||
return null;
|
||||
}
|
||||
return Base64.decode(str, 11);
|
||||
}
|
||||
|
||||
@KeepForSdk
|
||||
public static String encode(byte[] bArr) {
|
||||
if (bArr == null) {
|
||||
return null;
|
||||
}
|
||||
return Base64.encodeToString(bArr, 0);
|
||||
}
|
||||
|
||||
@KeepForSdk
|
||||
public static String encodeUrlSafe(byte[] bArr) {
|
||||
if (bArr == null) {
|
||||
return null;
|
||||
}
|
||||
return Base64.encodeToString(bArr, 10);
|
||||
}
|
||||
|
||||
@KeepForSdk
|
||||
public static String encodeUrlSafeNoPadding(byte[] bArr) {
|
||||
if (bArr == null) {
|
||||
return null;
|
||||
}
|
||||
return Base64.encodeToString(bArr, 11);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package com.google.android.gms.common.util;
|
||||
|
||||
import com.google.android.gms.common.annotation.KeepForSdk;
|
||||
|
||||
@KeepForSdk
|
||||
/* loaded from: classes3.dex */
|
||||
public interface BiConsumer<T, U> {
|
||||
@KeepForSdk
|
||||
void accept(T t2, U u3);
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
package com.google.android.gms.common.util;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.pm.ApplicationInfo;
|
||||
import android.content.pm.PackageInfo;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.os.Bundle;
|
||||
import com.google.android.gms.common.annotation.KeepForSdk;
|
||||
import com.google.android.gms.common.wrappers.Wrappers;
|
||||
|
||||
@KeepForSdk
|
||||
/* loaded from: classes3.dex */
|
||||
public class ClientLibraryUtils {
|
||||
private ClientLibraryUtils() {
|
||||
}
|
||||
|
||||
@KeepForSdk
|
||||
public static int getClientVersion(Context context, String str) {
|
||||
ApplicationInfo applicationInfo;
|
||||
Bundle bundle;
|
||||
PackageInfo packageInfo = getPackageInfo(context, str);
|
||||
if (packageInfo == null || (applicationInfo = packageInfo.applicationInfo) == null || (bundle = applicationInfo.metaData) == null) {
|
||||
return -1;
|
||||
}
|
||||
return bundle.getInt("com.google.android.gms.version", -1);
|
||||
}
|
||||
|
||||
@KeepForSdk
|
||||
public static PackageInfo getPackageInfo(Context context, String str) {
|
||||
try {
|
||||
return Wrappers.packageManager(context).getPackageInfo(str, 128);
|
||||
} catch (PackageManager.NameNotFoundException unused) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@KeepForSdk
|
||||
public static boolean isPackageSide() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.google.android.gms.common.util;
|
||||
|
||||
import com.google.android.gms.common.annotation.KeepForSdk;
|
||||
import com.google.android.gms.common.internal.ShowFirstParty;
|
||||
|
||||
@ShowFirstParty
|
||||
@KeepForSdk
|
||||
/* loaded from: classes3.dex */
|
||||
public interface Clock {
|
||||
|
||||
/* renamed from: com.google.android.gms.common.util.Clock$-CC, reason: invalid class name */
|
||||
/* loaded from: classes3.dex */
|
||||
public final /* synthetic */ class CC {
|
||||
}
|
||||
|
||||
@KeepForSdk
|
||||
long currentThreadTimeMillis();
|
||||
|
||||
@KeepForSdk
|
||||
long currentTimeMillis();
|
||||
|
||||
@KeepForSdk
|
||||
long elapsedRealtime();
|
||||
|
||||
@KeepForSdk
|
||||
long nanoTime();
|
||||
}
|
||||
@@ -0,0 +1,157 @@
|
||||
package com.google.android.gms.common.util;
|
||||
|
||||
import C.w;
|
||||
import com.google.android.gms.common.annotation.KeepForSdk;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import s.f;
|
||||
import s.j;
|
||||
|
||||
@KeepForSdk
|
||||
/* loaded from: classes3.dex */
|
||||
public final class CollectionUtils {
|
||||
private CollectionUtils() {
|
||||
}
|
||||
|
||||
@KeepForSdk
|
||||
public static boolean isEmpty(Collection<?> collection) {
|
||||
if (collection == null) {
|
||||
return true;
|
||||
}
|
||||
return collection.isEmpty();
|
||||
}
|
||||
|
||||
@KeepForSdk
|
||||
@Deprecated
|
||||
public static <T> List<T> listOf() {
|
||||
return Collections.EMPTY_LIST;
|
||||
}
|
||||
|
||||
@KeepForSdk
|
||||
public static <K, V> Map<K, V> mapOf(K k4, V v3, K k5, V v4, K k6, V v5) {
|
||||
Map zza = zza(3, false);
|
||||
zza.put(k4, v3);
|
||||
zza.put(k5, v4);
|
||||
zza.put(k6, v5);
|
||||
return Collections.unmodifiableMap(zza);
|
||||
}
|
||||
|
||||
@KeepForSdk
|
||||
public static <K, V> Map<K, V> mapOfKeyValueArrays(K[] kArr, V[] vArr) {
|
||||
int length = kArr.length;
|
||||
int length2 = vArr.length;
|
||||
if (length != length2) {
|
||||
throw new IllegalArgumentException(w.k("Key and values array lengths not equal: ", length, length2, " != "));
|
||||
}
|
||||
if (length == 0) {
|
||||
return Collections.EMPTY_MAP;
|
||||
}
|
||||
if (length == 1) {
|
||||
return Collections.singletonMap(kArr[0], vArr[0]);
|
||||
}
|
||||
Map zza = zza(length, false);
|
||||
for (int i = 0; i < kArr.length; i++) {
|
||||
zza.put(kArr[i], vArr[i]);
|
||||
}
|
||||
return Collections.unmodifiableMap(zza);
|
||||
}
|
||||
|
||||
@KeepForSdk
|
||||
public static <T> Set<T> mutableSetOfWithSize(int i) {
|
||||
return i == 0 ? new f(0) : zzb(i, true);
|
||||
}
|
||||
|
||||
@KeepForSdk
|
||||
@Deprecated
|
||||
public static <T> Set<T> setOf(T t2, T t4, T t5) {
|
||||
Set zzb = zzb(3, false);
|
||||
zzb.add(t2);
|
||||
zzb.add(t4);
|
||||
zzb.add(t5);
|
||||
return Collections.unmodifiableSet(zzb);
|
||||
}
|
||||
|
||||
/* JADX WARN: Type inference failed for: r2v3, types: [java.util.Map, s.j] */
|
||||
private static Map zza(int i, boolean z3) {
|
||||
return i <= 256 ? new j(i) : new HashMap(i, 1.0f);
|
||||
}
|
||||
|
||||
private static Set zzb(int i, boolean z3) {
|
||||
return i <= (true != z3 ? 256 : 128) ? new f(i) : new HashSet(i, true != z3 ? 1.0f : 0.75f);
|
||||
}
|
||||
|
||||
@KeepForSdk
|
||||
@Deprecated
|
||||
public static <T> List<T> listOf(T t2) {
|
||||
return Collections.singletonList(t2);
|
||||
}
|
||||
|
||||
@KeepForSdk
|
||||
@Deprecated
|
||||
public static <T> List<T> listOf(T... tArr) {
|
||||
int length = tArr.length;
|
||||
if (length == 0) {
|
||||
return listOf();
|
||||
}
|
||||
if (length != 1) {
|
||||
return Collections.unmodifiableList(Arrays.asList(tArr));
|
||||
}
|
||||
return listOf(tArr[0]);
|
||||
}
|
||||
|
||||
@KeepForSdk
|
||||
public static <K, V> Map<K, V> mapOf(K k4, V v3, K k5, V v4, K k6, V v5, K k7, V v6, K k8, V v7, K k9, V v8) {
|
||||
Map zza = zza(6, false);
|
||||
zza.put(k4, v3);
|
||||
zza.put(k5, v4);
|
||||
zza.put(k6, v5);
|
||||
zza.put(k7, v6);
|
||||
zza.put(k8, v7);
|
||||
zza.put(k9, v8);
|
||||
return Collections.unmodifiableMap(zza);
|
||||
}
|
||||
|
||||
@KeepForSdk
|
||||
@Deprecated
|
||||
public static <T> Set<T> setOf(T... tArr) {
|
||||
int length = tArr.length;
|
||||
if (length == 0) {
|
||||
return Collections.EMPTY_SET;
|
||||
}
|
||||
if (length == 1) {
|
||||
return Collections.singleton(tArr[0]);
|
||||
}
|
||||
if (length == 2) {
|
||||
T t2 = tArr[0];
|
||||
T t4 = tArr[1];
|
||||
Set zzb = zzb(2, false);
|
||||
zzb.add(t2);
|
||||
zzb.add(t4);
|
||||
return Collections.unmodifiableSet(zzb);
|
||||
}
|
||||
if (length == 3) {
|
||||
return setOf(tArr[0], tArr[1], tArr[2]);
|
||||
}
|
||||
if (length != 4) {
|
||||
Set zzb2 = zzb(length, false);
|
||||
Collections.addAll(zzb2, tArr);
|
||||
return Collections.unmodifiableSet(zzb2);
|
||||
}
|
||||
T t5 = tArr[0];
|
||||
T t6 = tArr[1];
|
||||
T t7 = tArr[2];
|
||||
T t8 = tArr[3];
|
||||
Set zzb3 = zzb(4, false);
|
||||
zzb3.add(t5);
|
||||
zzb3.add(t6);
|
||||
zzb3.add(t7);
|
||||
zzb3.add(t8);
|
||||
return Collections.unmodifiableSet(zzb3);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.google.android.gms.common.util;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.Log;
|
||||
import com.google.android.gms.common.annotation.KeepForSdk;
|
||||
import com.google.android.gms.common.internal.Preconditions;
|
||||
|
||||
@KeepForSdk
|
||||
/* loaded from: classes3.dex */
|
||||
public final class CrashUtils {
|
||||
private static final String[] zza = {"android.", "com.android.", "dalvik.", "java.", "javax."};
|
||||
|
||||
@KeepForSdk
|
||||
public static boolean addDynamiteErrorToDropBox(Context context, Throwable th) {
|
||||
try {
|
||||
Preconditions.checkNotNull(context);
|
||||
Preconditions.checkNotNull(th);
|
||||
return false;
|
||||
} catch (Exception e4) {
|
||||
Log.e("CrashUtils", "Error adding exception to DropBox!", e4);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package com.google.android.gms.common.util;
|
||||
|
||||
import android.database.CharArrayBuffer;
|
||||
import android.graphics.Bitmap;
|
||||
import android.text.TextUtils;
|
||||
import com.google.android.gms.common.annotation.KeepForSdk;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
|
||||
@KeepForSdk
|
||||
/* loaded from: classes3.dex */
|
||||
public final class DataUtils {
|
||||
@KeepForSdk
|
||||
public static void copyStringToBuffer(String str, CharArrayBuffer charArrayBuffer) {
|
||||
if (TextUtils.isEmpty(str)) {
|
||||
charArrayBuffer.sizeCopied = 0;
|
||||
return;
|
||||
}
|
||||
char[] cArr = charArrayBuffer.data;
|
||||
if (cArr == null || cArr.length < str.length()) {
|
||||
charArrayBuffer.data = str.toCharArray();
|
||||
} else {
|
||||
str.getChars(0, str.length(), charArrayBuffer.data, 0);
|
||||
}
|
||||
charArrayBuffer.sizeCopied = str.length();
|
||||
}
|
||||
|
||||
@KeepForSdk
|
||||
public static byte[] loadImageBytes(Bitmap bitmap) {
|
||||
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
|
||||
bitmap.compress(Bitmap.CompressFormat.JPEG, 100, byteArrayOutputStream);
|
||||
return byteArrayOutputStream.toByteArray();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
package com.google.android.gms.common.util;
|
||||
|
||||
import android.os.SystemClock;
|
||||
import com.google.android.gms.common.annotation.KeepForSdk;
|
||||
|
||||
@KeepForSdk
|
||||
/* loaded from: classes3.dex */
|
||||
public class DefaultClock implements Clock {
|
||||
private static final DefaultClock zza = new DefaultClock();
|
||||
|
||||
private DefaultClock() {
|
||||
}
|
||||
|
||||
@KeepForSdk
|
||||
public static Clock getInstance() {
|
||||
return zza;
|
||||
}
|
||||
|
||||
@Override // com.google.android.gms.common.util.Clock
|
||||
public final long currentThreadTimeMillis() {
|
||||
return SystemClock.currentThreadTimeMillis();
|
||||
}
|
||||
|
||||
@Override // com.google.android.gms.common.util.Clock
|
||||
public final long currentTimeMillis() {
|
||||
return System.currentTimeMillis();
|
||||
}
|
||||
|
||||
@Override // com.google.android.gms.common.util.Clock
|
||||
public final long elapsedRealtime() {
|
||||
return SystemClock.elapsedRealtime();
|
||||
}
|
||||
|
||||
@Override // com.google.android.gms.common.util.Clock
|
||||
public final long nanoTime() {
|
||||
return System.nanoTime();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,200 @@
|
||||
package com.google.android.gms.common.util;
|
||||
|
||||
import android.annotation.TargetApi;
|
||||
import android.content.Context;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.content.res.Configuration;
|
||||
import android.content.res.Resources;
|
||||
import android.os.Build;
|
||||
import com.google.android.gms.common.GooglePlayServicesUtilLight;
|
||||
import com.google.android.gms.common.annotation.KeepForSdk;
|
||||
|
||||
@KeepForSdk
|
||||
/* loaded from: classes3.dex */
|
||||
public final class DeviceProperties {
|
||||
private static Boolean zza;
|
||||
private static Boolean zzb;
|
||||
private static Boolean zzc;
|
||||
private static Boolean zzd;
|
||||
private static Boolean zze;
|
||||
private static Boolean zzf;
|
||||
private static Boolean zzg;
|
||||
private static Boolean zzh;
|
||||
private static Boolean zzi;
|
||||
private static Boolean zzj;
|
||||
private static Boolean zzk;
|
||||
private static Boolean zzl;
|
||||
|
||||
private DeviceProperties() {
|
||||
}
|
||||
|
||||
@KeepForSdk
|
||||
public static boolean isAuto(Context context) {
|
||||
PackageManager packageManager = context.getPackageManager();
|
||||
if (zzi == null) {
|
||||
boolean z3 = false;
|
||||
if (PlatformVersion.isAtLeastO() && packageManager.hasSystemFeature("android.hardware.type.automotive")) {
|
||||
z3 = true;
|
||||
}
|
||||
zzi = Boolean.valueOf(z3);
|
||||
}
|
||||
return zzi.booleanValue();
|
||||
}
|
||||
|
||||
@KeepForSdk
|
||||
public static boolean isBstar(Context context) {
|
||||
if (zzl == null) {
|
||||
boolean z3 = false;
|
||||
if (PlatformVersion.isAtLeastR() && context.getPackageManager().hasSystemFeature("com.google.android.play.feature.HPE_EXPERIENCE")) {
|
||||
z3 = true;
|
||||
}
|
||||
zzl = Boolean.valueOf(z3);
|
||||
}
|
||||
return zzl.booleanValue();
|
||||
}
|
||||
|
||||
@KeepForSdk
|
||||
public static boolean isLatchsky(Context context) {
|
||||
if (zzf == null) {
|
||||
PackageManager packageManager = context.getPackageManager();
|
||||
boolean z3 = false;
|
||||
if (packageManager.hasSystemFeature("com.google.android.feature.services_updater") && packageManager.hasSystemFeature("cn.google.services")) {
|
||||
z3 = true;
|
||||
}
|
||||
zzf = Boolean.valueOf(z3);
|
||||
}
|
||||
return zzf.booleanValue();
|
||||
}
|
||||
|
||||
@KeepForSdk
|
||||
public static boolean isPhone(Context context) {
|
||||
if (zza == null) {
|
||||
boolean z3 = false;
|
||||
if (!isTablet(context) && !isWearable(context) && !zzb(context)) {
|
||||
if (zzh == null) {
|
||||
zzh = Boolean.valueOf(context.getPackageManager().hasSystemFeature("org.chromium.arc"));
|
||||
}
|
||||
if (!zzh.booleanValue() && !isAuto(context) && !isTv(context)) {
|
||||
if (zzk == null) {
|
||||
zzk = Boolean.valueOf(context.getPackageManager().hasSystemFeature("com.google.android.feature.AMATI_EXPERIENCE"));
|
||||
}
|
||||
if (!zzk.booleanValue() && !isBstar(context)) {
|
||||
z3 = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
zza = Boolean.valueOf(z3);
|
||||
}
|
||||
return zza.booleanValue();
|
||||
}
|
||||
|
||||
@KeepForSdk
|
||||
public static boolean isSevenInchTablet(Context context) {
|
||||
return zzc(context.getResources());
|
||||
}
|
||||
|
||||
@KeepForSdk
|
||||
@TargetApi(21)
|
||||
public static boolean isSidewinder(Context context) {
|
||||
return zza(context);
|
||||
}
|
||||
|
||||
@KeepForSdk
|
||||
public static boolean isTablet(Context context) {
|
||||
return isTablet(context.getResources());
|
||||
}
|
||||
|
||||
@KeepForSdk
|
||||
public static boolean isTv(Context context) {
|
||||
PackageManager packageManager = context.getPackageManager();
|
||||
if (zzj == null) {
|
||||
boolean z3 = true;
|
||||
if (!packageManager.hasSystemFeature("com.google.android.tv") && !packageManager.hasSystemFeature("android.hardware.type.television") && !packageManager.hasSystemFeature("android.software.leanback")) {
|
||||
z3 = false;
|
||||
}
|
||||
zzj = Boolean.valueOf(z3);
|
||||
}
|
||||
return zzj.booleanValue();
|
||||
}
|
||||
|
||||
@KeepForSdk
|
||||
public static boolean isUserBuild() {
|
||||
int i = GooglePlayServicesUtilLight.GOOGLE_PLAY_SERVICES_VERSION_CODE;
|
||||
return "user".equals(Build.TYPE);
|
||||
}
|
||||
|
||||
@KeepForSdk
|
||||
@TargetApi(20)
|
||||
public static boolean isWearable(Context context) {
|
||||
PackageManager packageManager = context.getPackageManager();
|
||||
if (zzd == null) {
|
||||
boolean z3 = false;
|
||||
if (PlatformVersion.isAtLeastKitKatWatch() && packageManager.hasSystemFeature("android.hardware.type.watch")) {
|
||||
z3 = true;
|
||||
}
|
||||
zzd = Boolean.valueOf(z3);
|
||||
}
|
||||
return zzd.booleanValue();
|
||||
}
|
||||
|
||||
@KeepForSdk
|
||||
@TargetApi(26)
|
||||
public static boolean isWearableWithoutPlayStore(Context context) {
|
||||
if (isWearable(context) && !PlatformVersion.isAtLeastN()) {
|
||||
return true;
|
||||
}
|
||||
if (zza(context)) {
|
||||
return !PlatformVersion.isAtLeastO() || PlatformVersion.isAtLeastR();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@TargetApi(21)
|
||||
public static boolean zza(Context context) {
|
||||
if (zze == null) {
|
||||
boolean z3 = false;
|
||||
if (PlatformVersion.isAtLeastLollipop() && context.getPackageManager().hasSystemFeature("cn.google")) {
|
||||
z3 = true;
|
||||
}
|
||||
zze = Boolean.valueOf(z3);
|
||||
}
|
||||
return zze.booleanValue();
|
||||
}
|
||||
|
||||
public static boolean zzb(Context context) {
|
||||
if (zzg == null) {
|
||||
boolean z3 = true;
|
||||
if (!context.getPackageManager().hasSystemFeature("android.hardware.type.iot") && !context.getPackageManager().hasSystemFeature("android.hardware.type.embedded")) {
|
||||
z3 = false;
|
||||
}
|
||||
zzg = Boolean.valueOf(z3);
|
||||
}
|
||||
return zzg.booleanValue();
|
||||
}
|
||||
|
||||
public static boolean zzc(Resources resources) {
|
||||
boolean z3 = false;
|
||||
if (resources == null) {
|
||||
return false;
|
||||
}
|
||||
if (zzc == null) {
|
||||
Configuration configuration = resources.getConfiguration();
|
||||
if ((configuration.screenLayout & 15) <= 3 && configuration.smallestScreenWidthDp >= 600) {
|
||||
z3 = true;
|
||||
}
|
||||
zzc = Boolean.valueOf(z3);
|
||||
}
|
||||
return zzc.booleanValue();
|
||||
}
|
||||
|
||||
@KeepForSdk
|
||||
public static boolean isTablet(Resources resources) {
|
||||
if (resources == null) {
|
||||
return false;
|
||||
}
|
||||
if (zzb == null) {
|
||||
zzb = Boolean.valueOf((resources.getConfiguration().screenLayout & 15) > 3 || zzc(resources));
|
||||
}
|
||||
return zzb.booleanValue();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package com.google.android.gms.common.util;
|
||||
|
||||
import com.google.android.gms.common.annotation.KeepForSdk;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Target({ElementType.TYPE})
|
||||
@KeepForSdk
|
||||
/* loaded from: classes3.dex */
|
||||
public @interface DynamiteApi {
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
package com.google.android.gms.common.util;
|
||||
|
||||
import com.google.android.gms.common.annotation.KeepForSdk;
|
||||
|
||||
@KeepForSdk
|
||||
/* loaded from: classes3.dex */
|
||||
public final class GmsVersion {
|
||||
|
||||
@KeepForSdk
|
||||
public static final int VERSION_HALLOUMI = 4100000;
|
||||
|
||||
@KeepForSdk
|
||||
public static final int VERSION_JARLSBERG = 4300000;
|
||||
|
||||
@KeepForSdk
|
||||
public static final int VERSION_KENAFA = 4400000;
|
||||
|
||||
@KeepForSdk
|
||||
public static final int VERSION_LONGHORN = 5000000;
|
||||
|
||||
@KeepForSdk
|
||||
public static final int VERSION_MANCHEGO = 6000000;
|
||||
|
||||
@KeepForSdk
|
||||
public static final int VERSION_ORLA = 7000000;
|
||||
|
||||
@KeepForSdk
|
||||
public static final int VERSION_PARMESAN = 7200000;
|
||||
|
||||
@KeepForSdk
|
||||
public static final int VERSION_QUESO = 7500000;
|
||||
|
||||
@KeepForSdk
|
||||
public static final int VERSION_REBLOCHON = 7800000;
|
||||
|
||||
@KeepForSdk
|
||||
public static final int VERSION_SAGA = 8000000;
|
||||
|
||||
private GmsVersion() {
|
||||
}
|
||||
|
||||
@KeepForSdk
|
||||
public static boolean isAtLeastFenacho(int i) {
|
||||
return i >= 3200000;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
package com.google.android.gms.common.util;
|
||||
|
||||
import com.google.android.gms.common.annotation.KeepForSdk;
|
||||
import com.google.android.gms.common.internal.ShowFirstParty;
|
||||
import kotlin.UByte;
|
||||
|
||||
@ShowFirstParty
|
||||
@KeepForSdk
|
||||
/* loaded from: classes3.dex */
|
||||
public class Hex {
|
||||
private static final char[] zza = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'};
|
||||
private static final char[] zzb = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'};
|
||||
|
||||
@KeepForSdk
|
||||
public static String bytesToStringLowercase(byte[] bArr) {
|
||||
int length = bArr.length;
|
||||
char[] cArr = new char[length + length];
|
||||
int i = 0;
|
||||
for (byte b4 : bArr) {
|
||||
int i4 = b4 & UByte.MAX_VALUE;
|
||||
int i5 = i + 1;
|
||||
char[] cArr2 = zzb;
|
||||
cArr[i] = cArr2[i4 >>> 4];
|
||||
i += 2;
|
||||
cArr[i5] = cArr2[b4 & 15];
|
||||
}
|
||||
return new String(cArr);
|
||||
}
|
||||
|
||||
@KeepForSdk
|
||||
public static String bytesToStringUppercase(byte[] bArr) {
|
||||
return bytesToStringUppercase(bArr, false);
|
||||
}
|
||||
|
||||
@KeepForSdk
|
||||
public static byte[] stringToBytes(String str) throws IllegalArgumentException {
|
||||
int length = str.length();
|
||||
if (length % 2 != 0) {
|
||||
throw new IllegalArgumentException("Hex string has odd number of characters");
|
||||
}
|
||||
byte[] bArr = new byte[length / 2];
|
||||
int i = 0;
|
||||
while (i < length) {
|
||||
int i4 = i + 2;
|
||||
bArr[i / 2] = (byte) Integer.parseInt(str.substring(i, i4), 16);
|
||||
i = i4;
|
||||
}
|
||||
return bArr;
|
||||
}
|
||||
|
||||
@KeepForSdk
|
||||
public static String bytesToStringUppercase(byte[] bArr, boolean z3) {
|
||||
int length = bArr.length;
|
||||
StringBuilder sb = new StringBuilder(length + length);
|
||||
for (int i = 0; i < length && (!z3 || i != length - 1 || (bArr[i] & UByte.MAX_VALUE) != 0); i++) {
|
||||
char[] cArr = zza;
|
||||
sb.append(cArr[(bArr[i] & 240) >>> 4]);
|
||||
sb.append(cArr[bArr[i] & 15]);
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
package com.google.android.gms.common.util;
|
||||
|
||||
import com.google.android.gms.common.annotation.KeepForSdk;
|
||||
import kotlin.UByte;
|
||||
|
||||
@KeepForSdk
|
||||
/* loaded from: classes3.dex */
|
||||
public final class HexDumpUtils {
|
||||
@KeepForSdk
|
||||
public static String dump(byte[] bArr, int i, int i4, boolean z3) {
|
||||
int length;
|
||||
if (bArr == null || (length = bArr.length) == 0 || i < 0 || i4 <= 0 || i + i4 > length) {
|
||||
return null;
|
||||
}
|
||||
StringBuilder sb = new StringBuilder(((i4 + 15) / 16) * (z3 ? 75 : 57));
|
||||
int i5 = i4;
|
||||
int i6 = 0;
|
||||
int i7 = 0;
|
||||
while (i5 > 0) {
|
||||
if (i6 == 0) {
|
||||
if (i4 < 65536) {
|
||||
sb.append(String.format("%04X:", Integer.valueOf(i)));
|
||||
} else {
|
||||
sb.append(String.format("%08X:", Integer.valueOf(i)));
|
||||
}
|
||||
i7 = i;
|
||||
} else if (i6 == 8) {
|
||||
sb.append(" -");
|
||||
}
|
||||
sb.append(String.format(" %02X", Integer.valueOf(bArr[i] & UByte.MAX_VALUE)));
|
||||
i5--;
|
||||
i6++;
|
||||
if (z3 && (i6 == 16 || i5 == 0)) {
|
||||
int i8 = 16 - i6;
|
||||
if (i8 > 0) {
|
||||
for (int i9 = 0; i9 < i8; i9++) {
|
||||
sb.append(" ");
|
||||
}
|
||||
}
|
||||
if (i8 >= 8) {
|
||||
sb.append(" ");
|
||||
}
|
||||
sb.append(" ");
|
||||
for (int i10 = 0; i10 < i6; i10++) {
|
||||
char c4 = (char) bArr[i7 + i10];
|
||||
if (c4 < ' ' || c4 > '~') {
|
||||
c4 = '.';
|
||||
}
|
||||
sb.append(c4);
|
||||
}
|
||||
}
|
||||
if (i6 == 16 || i5 == 0) {
|
||||
sb.append('\n');
|
||||
i6 = 0;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
package com.google.android.gms.common.util;
|
||||
|
||||
import com.google.android.gms.common.annotation.KeepForSdk;
|
||||
import com.google.android.gms.internal.common.zzo;
|
||||
import com.google.android.gms.internal.common.zzx;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URI;
|
||||
import java.net.URLDecoder;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.regex.Pattern;
|
||||
import kotlin.text.Typography;
|
||||
|
||||
@KeepForSdk
|
||||
/* loaded from: classes3.dex */
|
||||
public class HttpUtils {
|
||||
private static final Pattern zza = Pattern.compile("^(25[0-5]|2[0-4]\\d|[0-1]?\\d?\\d)(\\.(25[0-5]|2[0-4]\\d|[0-1]?\\d?\\d)){3}$");
|
||||
private static final Pattern zzb = Pattern.compile("^(?:[0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}$");
|
||||
private static final Pattern zzc = Pattern.compile("^((?:[0-9A-Fa-f]{1,4}(?::[0-9A-Fa-f]{1,4})*)?)::((?:[0-9A-Fa-f]{1,4}(?::[0-9A-Fa-f]{1,4})*)?)$");
|
||||
|
||||
private HttpUtils() {
|
||||
}
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
/* JADX WARN: Type inference failed for: r0v0, types: [java.util.Map] */
|
||||
/* JADX WARN: Type inference failed for: r0v1, types: [java.util.Map<java.lang.String, java.lang.String>] */
|
||||
/* JADX WARN: Type inference failed for: r0v2, types: [java.util.HashMap] */
|
||||
@KeepForSdk
|
||||
public static Map<String, String> parse(URI uri, String str) {
|
||||
?? r02 = Collections.EMPTY_MAP;
|
||||
String rawQuery = uri.getRawQuery();
|
||||
if (rawQuery != null && rawQuery.length() > 0) {
|
||||
r02 = new HashMap();
|
||||
zzx zzc2 = zzx.zzc(zzo.zzb('='));
|
||||
Iterator it = zzx.zzc(zzo.zzb(Typography.amp)).zzb().zzd(rawQuery).iterator();
|
||||
while (it.hasNext()) {
|
||||
List zzf = zzc2.zzf((String) it.next());
|
||||
if (zzf.isEmpty() || zzf.size() > 2) {
|
||||
throw new IllegalArgumentException("bad parameter");
|
||||
}
|
||||
r02.put(zza((String) zzf.get(0), str), zzf.size() == 2 ? zza((String) zzf.get(1), str) : null);
|
||||
}
|
||||
}
|
||||
return r02;
|
||||
}
|
||||
|
||||
private static String zza(String str, String str2) {
|
||||
if (str2 == null) {
|
||||
str2 = "ISO-8859-1";
|
||||
}
|
||||
try {
|
||||
return URLDecoder.decode(str, str2);
|
||||
} catch (UnsupportedEncodingException e4) {
|
||||
throw new IllegalArgumentException(e4);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,116 @@
|
||||
package com.google.android.gms.common.util;
|
||||
|
||||
import android.os.ParcelFileDescriptor;
|
||||
import com.google.android.gms.common.annotation.KeepForSdk;
|
||||
import com.google.android.gms.common.internal.Preconditions;
|
||||
import com.google.android.gms.common.internal.ShowFirstParty;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.Closeable;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import kotlin.UByte;
|
||||
import kotlin.io.ConstantsKt;
|
||||
|
||||
@ShowFirstParty
|
||||
@KeepForSdk
|
||||
@Deprecated
|
||||
/* loaded from: classes3.dex */
|
||||
public final class IOUtils {
|
||||
private IOUtils() {
|
||||
}
|
||||
|
||||
@KeepForSdk
|
||||
public static void closeQuietly(ParcelFileDescriptor parcelFileDescriptor) {
|
||||
if (parcelFileDescriptor != null) {
|
||||
try {
|
||||
parcelFileDescriptor.close();
|
||||
} catch (IOException unused) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@KeepForSdk
|
||||
@Deprecated
|
||||
public static long copyStream(InputStream inputStream, OutputStream outputStream) throws IOException {
|
||||
return copyStream(inputStream, outputStream, false, 1024);
|
||||
}
|
||||
|
||||
@KeepForSdk
|
||||
public static boolean isGzipByteBuffer(byte[] bArr) {
|
||||
if (bArr.length > 1) {
|
||||
if ((((bArr[1] & UByte.MAX_VALUE) << 8) | (bArr[0] & UByte.MAX_VALUE)) == 35615) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@KeepForSdk
|
||||
@Deprecated
|
||||
public static byte[] readInputStreamFully(InputStream inputStream) throws IOException {
|
||||
return readInputStreamFully(inputStream, true);
|
||||
}
|
||||
|
||||
@KeepForSdk
|
||||
@Deprecated
|
||||
public static byte[] toByteArray(InputStream inputStream) throws IOException {
|
||||
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
|
||||
Preconditions.checkNotNull(inputStream);
|
||||
Preconditions.checkNotNull(byteArrayOutputStream);
|
||||
byte[] bArr = new byte[ConstantsKt.DEFAULT_BLOCK_SIZE];
|
||||
while (true) {
|
||||
int read = inputStream.read(bArr);
|
||||
if (read == -1) {
|
||||
return byteArrayOutputStream.toByteArray();
|
||||
}
|
||||
byteArrayOutputStream.write(bArr, 0, read);
|
||||
}
|
||||
}
|
||||
|
||||
@KeepForSdk
|
||||
public static void closeQuietly(Closeable closeable) {
|
||||
if (closeable != null) {
|
||||
try {
|
||||
closeable.close();
|
||||
} catch (IOException unused) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@KeepForSdk
|
||||
@Deprecated
|
||||
public static long copyStream(InputStream inputStream, OutputStream outputStream, boolean z3, int i) throws IOException {
|
||||
byte[] bArr = new byte[i];
|
||||
long j4 = 0;
|
||||
while (true) {
|
||||
try {
|
||||
int read = inputStream.read(bArr, 0, i);
|
||||
if (read == -1) {
|
||||
break;
|
||||
}
|
||||
j4 += read;
|
||||
outputStream.write(bArr, 0, read);
|
||||
} catch (Throwable th) {
|
||||
if (z3) {
|
||||
closeQuietly(inputStream);
|
||||
closeQuietly(outputStream);
|
||||
}
|
||||
throw th;
|
||||
}
|
||||
}
|
||||
if (z3) {
|
||||
closeQuietly(inputStream);
|
||||
closeQuietly(outputStream);
|
||||
}
|
||||
return j4;
|
||||
}
|
||||
|
||||
@KeepForSdk
|
||||
@Deprecated
|
||||
public static byte[] readInputStreamFully(InputStream inputStream, boolean z3) throws IOException {
|
||||
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
|
||||
copyStream(inputStream, byteArrayOutputStream, z3, 1024);
|
||||
return byteArrayOutputStream.toByteArray();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,153 @@
|
||||
package com.google.android.gms.common.util;
|
||||
|
||||
import android.text.TextUtils;
|
||||
import com.google.android.gms.common.annotation.KeepForSdk;
|
||||
import com.google.android.gms.common.internal.Preconditions;
|
||||
import com.google.firebase.sessions.settings.RemoteSettings;
|
||||
import java.util.Iterator;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
|
||||
@VisibleForTesting
|
||||
@KeepForSdk
|
||||
/* loaded from: classes3.dex */
|
||||
public final class JsonUtils {
|
||||
private static final Pattern zza = Pattern.compile("\\\\.");
|
||||
private static final Pattern zzb = Pattern.compile("[\\\\\"/\b\f\n\r\t]");
|
||||
|
||||
private JsonUtils() {
|
||||
}
|
||||
|
||||
@KeepForSdk
|
||||
public static boolean areJsonValuesEquivalent(Object obj, Object obj2) {
|
||||
if (obj == null && obj2 == null) {
|
||||
return true;
|
||||
}
|
||||
if (obj == null || obj2 == null) {
|
||||
return false;
|
||||
}
|
||||
if ((obj instanceof JSONObject) && (obj2 instanceof JSONObject)) {
|
||||
JSONObject jSONObject = (JSONObject) obj;
|
||||
JSONObject jSONObject2 = (JSONObject) obj2;
|
||||
if (jSONObject.length() != jSONObject2.length()) {
|
||||
return false;
|
||||
}
|
||||
Iterator<String> keys = jSONObject.keys();
|
||||
while (keys.hasNext()) {
|
||||
String next = keys.next();
|
||||
if (!jSONObject2.has(next)) {
|
||||
return false;
|
||||
}
|
||||
try {
|
||||
Preconditions.checkNotNull(next);
|
||||
} catch (JSONException unused) {
|
||||
}
|
||||
if (!areJsonValuesEquivalent(jSONObject.get(next), jSONObject2.get(next))) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
if (!(obj instanceof JSONArray) || !(obj2 instanceof JSONArray)) {
|
||||
return obj.equals(obj2);
|
||||
}
|
||||
JSONArray jSONArray = (JSONArray) obj;
|
||||
JSONArray jSONArray2 = (JSONArray) obj2;
|
||||
if (jSONArray.length() != jSONArray2.length()) {
|
||||
return false;
|
||||
}
|
||||
for (int i = 0; i < jSONArray.length(); i++) {
|
||||
if (!areJsonValuesEquivalent(jSONArray.get(i), jSONArray2.get(i))) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@KeepForSdk
|
||||
public static String escapeString(String str) {
|
||||
if (TextUtils.isEmpty(str)) {
|
||||
return str;
|
||||
}
|
||||
Matcher matcher = zzb.matcher(str);
|
||||
StringBuffer stringBuffer = null;
|
||||
while (matcher.find()) {
|
||||
if (stringBuffer == null) {
|
||||
stringBuffer = new StringBuffer();
|
||||
}
|
||||
char charAt = matcher.group().charAt(0);
|
||||
if (charAt == '\f') {
|
||||
matcher.appendReplacement(stringBuffer, "\\\\f");
|
||||
} else if (charAt == '\r') {
|
||||
matcher.appendReplacement(stringBuffer, "\\\\r");
|
||||
} else if (charAt == '\"') {
|
||||
matcher.appendReplacement(stringBuffer, "\\\\\\\"");
|
||||
} else if (charAt == '/') {
|
||||
matcher.appendReplacement(stringBuffer, "\\\\/");
|
||||
} else if (charAt != '\\') {
|
||||
switch (charAt) {
|
||||
case '\b':
|
||||
matcher.appendReplacement(stringBuffer, "\\\\b");
|
||||
break;
|
||||
case '\t':
|
||||
matcher.appendReplacement(stringBuffer, "\\\\t");
|
||||
break;
|
||||
case '\n':
|
||||
matcher.appendReplacement(stringBuffer, "\\\\n");
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
matcher.appendReplacement(stringBuffer, "\\\\\\\\");
|
||||
}
|
||||
}
|
||||
if (stringBuffer == null) {
|
||||
return str;
|
||||
}
|
||||
matcher.appendTail(stringBuffer);
|
||||
return stringBuffer.toString();
|
||||
}
|
||||
|
||||
@KeepForSdk
|
||||
public static String unescapeString(String str) {
|
||||
if (TextUtils.isEmpty(str)) {
|
||||
return str;
|
||||
}
|
||||
String zza2 = zzc.zza(str);
|
||||
Matcher matcher = zza.matcher(zza2);
|
||||
StringBuffer stringBuffer = null;
|
||||
while (matcher.find()) {
|
||||
if (stringBuffer == null) {
|
||||
stringBuffer = new StringBuffer();
|
||||
}
|
||||
char charAt = matcher.group().charAt(1);
|
||||
if (charAt == '\"') {
|
||||
matcher.appendReplacement(stringBuffer, "\"");
|
||||
} else if (charAt == '/') {
|
||||
matcher.appendReplacement(stringBuffer, RemoteSettings.FORWARD_SLASH_STRING);
|
||||
} else if (charAt == '\\') {
|
||||
matcher.appendReplacement(stringBuffer, "\\\\");
|
||||
} else if (charAt == 'b') {
|
||||
matcher.appendReplacement(stringBuffer, "\b");
|
||||
} else if (charAt == 'f') {
|
||||
matcher.appendReplacement(stringBuffer, "\f");
|
||||
} else if (charAt == 'n') {
|
||||
matcher.appendReplacement(stringBuffer, "\n");
|
||||
} else if (charAt == 'r') {
|
||||
matcher.appendReplacement(stringBuffer, "\r");
|
||||
} else {
|
||||
if (charAt != 't') {
|
||||
throw new IllegalStateException("Found an escaped character that should never be.");
|
||||
}
|
||||
matcher.appendReplacement(stringBuffer, "\t");
|
||||
}
|
||||
}
|
||||
if (stringBuffer == null) {
|
||||
return zza2;
|
||||
}
|
||||
matcher.appendTail(stringBuffer);
|
||||
return stringBuffer.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package com.google.android.gms.common.util;
|
||||
|
||||
import com.google.android.gms.common.annotation.KeepForSdk;
|
||||
import java.util.HashMap;
|
||||
|
||||
@KeepForSdk
|
||||
/* loaded from: classes3.dex */
|
||||
public class MapUtils {
|
||||
@KeepForSdk
|
||||
public static void writeStringMapToJson(StringBuilder sb, HashMap<String, String> hashMap) {
|
||||
sb.append("{");
|
||||
boolean z3 = true;
|
||||
for (String str : hashMap.keySet()) {
|
||||
if (!z3) {
|
||||
sb.append(",");
|
||||
}
|
||||
String str2 = hashMap.get(str);
|
||||
sb.append("\"");
|
||||
sb.append(str);
|
||||
sb.append("\":");
|
||||
if (str2 == null) {
|
||||
sb.append("null");
|
||||
} else {
|
||||
sb.append("\"");
|
||||
sb.append(str2);
|
||||
sb.append("\"");
|
||||
}
|
||||
z3 = false;
|
||||
}
|
||||
sb.append("}");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
package com.google.android.gms.common.util;
|
||||
|
||||
import com.google.android.gms.common.annotation.KeepForSdk;
|
||||
import kotlin.KotlinVersion;
|
||||
|
||||
@KeepForSdk
|
||||
/* loaded from: classes3.dex */
|
||||
public class MurmurHash3 {
|
||||
private MurmurHash3() {
|
||||
}
|
||||
|
||||
@KeepForSdk
|
||||
public static int murmurhash3_x86_32(byte[] bArr, int i, int i4, int i5) {
|
||||
int i6 = (i4 & (-4)) + i;
|
||||
while (i < i6) {
|
||||
int i7 = ((bArr[i] & KotlinVersion.MAX_COMPONENT_VALUE) | ((bArr[i + 1] & KotlinVersion.MAX_COMPONENT_VALUE) << 8) | ((bArr[i + 2] & KotlinVersion.MAX_COMPONENT_VALUE) << 16) | (bArr[i + 3] << 24)) * (-862048943);
|
||||
int i8 = i5 ^ (((i7 << 15) | (i7 >>> 17)) * 461845907);
|
||||
i5 = (((i8 >>> 19) | (i8 << 13)) * 5) - 430675100;
|
||||
i += 4;
|
||||
}
|
||||
int i9 = i4 & 3;
|
||||
if (i9 != 1) {
|
||||
if (i9 != 2) {
|
||||
r3 = i9 == 3 ? (bArr[i6 + 2] & KotlinVersion.MAX_COMPONENT_VALUE) << 16 : 0;
|
||||
int i10 = i5 ^ i4;
|
||||
int i11 = (i10 ^ (i10 >>> 16)) * (-2048144789);
|
||||
int i12 = (i11 ^ (i11 >>> 13)) * (-1028477387);
|
||||
return i12 ^ (i12 >>> 16);
|
||||
}
|
||||
r3 |= (bArr[i6 + 1] & KotlinVersion.MAX_COMPONENT_VALUE) << 8;
|
||||
}
|
||||
int i13 = ((bArr[i6] & KotlinVersion.MAX_COMPONENT_VALUE) | r3) * (-862048943);
|
||||
i5 ^= ((i13 >>> 17) | (i13 << 15)) * 461845907;
|
||||
int i102 = i5 ^ i4;
|
||||
int i112 = (i102 ^ (i102 >>> 16)) * (-2048144789);
|
||||
int i122 = (i112 ^ (i112 >>> 13)) * (-1028477387);
|
||||
return i122 ^ (i122 >>> 16);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package com.google.android.gms.common.util;
|
||||
|
||||
import com.google.android.gms.common.annotation.KeepForSdk;
|
||||
|
||||
@VisibleForTesting
|
||||
@KeepForSdk
|
||||
/* loaded from: classes3.dex */
|
||||
public class NumberUtils {
|
||||
private NumberUtils() {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,144 @@
|
||||
package com.google.android.gms.common.util;
|
||||
|
||||
import K.b;
|
||||
import android.os.Build;
|
||||
import com.google.android.gms.common.annotation.KeepForSdk;
|
||||
import java.util.Locale;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
|
||||
@VisibleForTesting
|
||||
@KeepForSdk
|
||||
/* loaded from: classes3.dex */
|
||||
public final class PlatformVersion {
|
||||
private PlatformVersion() {
|
||||
}
|
||||
|
||||
@KeepForSdk
|
||||
public static boolean isAtLeastHoneycomb() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@KeepForSdk
|
||||
public static boolean isAtLeastHoneycombMR1() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@KeepForSdk
|
||||
public static boolean isAtLeastIceCreamSandwich() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@KeepForSdk
|
||||
public static boolean isAtLeastIceCreamSandwichMR1() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@KeepForSdk
|
||||
public static boolean isAtLeastJellyBean() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@KeepForSdk
|
||||
public static boolean isAtLeastJellyBeanMR1() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@KeepForSdk
|
||||
public static boolean isAtLeastJellyBeanMR2() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@KeepForSdk
|
||||
public static boolean isAtLeastKitKat() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@KeepForSdk
|
||||
public static boolean isAtLeastKitKatWatch() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@KeepForSdk
|
||||
public static boolean isAtLeastLollipop() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@KeepForSdk
|
||||
public static boolean isAtLeastLollipopMR1() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@KeepForSdk
|
||||
public static boolean isAtLeastM() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@KeepForSdk
|
||||
public static boolean isAtLeastN() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@KeepForSdk
|
||||
public static boolean isAtLeastO() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@KeepForSdk
|
||||
public static boolean isAtLeastP() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@KeepForSdk
|
||||
public static boolean isAtLeastQ() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@KeepForSdk
|
||||
public static boolean isAtLeastR() {
|
||||
return Build.VERSION.SDK_INT >= 30;
|
||||
}
|
||||
|
||||
@KeepForSdk
|
||||
public static boolean isAtLeastS() {
|
||||
return Build.VERSION.SDK_INT >= 31;
|
||||
}
|
||||
|
||||
@KeepForSdk
|
||||
public static boolean isAtLeastSv2() {
|
||||
return Build.VERSION.SDK_INT >= 32;
|
||||
}
|
||||
|
||||
@KeepForSdk
|
||||
public static boolean isAtLeastT() {
|
||||
return Build.VERSION.SDK_INT >= 33 || Build.VERSION.CODENAME.charAt(0) == 'T';
|
||||
}
|
||||
|
||||
@KeepForSdk
|
||||
public static boolean isAtLeastU() {
|
||||
if (!isAtLeastT()) {
|
||||
return false;
|
||||
}
|
||||
int i = b.f966a;
|
||||
int i4 = Build.VERSION.SDK_INT;
|
||||
if (i4 >= 34) {
|
||||
return true;
|
||||
}
|
||||
if (i4 >= 33) {
|
||||
String buildCodename = Build.VERSION.CODENAME;
|
||||
Intrinsics.checkNotNullExpressionValue(buildCodename, "CODENAME");
|
||||
Intrinsics.checkNotNullParameter("UpsideDownCake", "codename");
|
||||
Intrinsics.checkNotNullParameter(buildCodename, "buildCodename");
|
||||
if (!Intrinsics.areEqual("REL", buildCodename)) {
|
||||
Locale locale = Locale.ROOT;
|
||||
String upperCase = buildCodename.toUpperCase(locale);
|
||||
Intrinsics.checkNotNullExpressionValue(upperCase, "this as java.lang.String).toUpperCase(Locale.ROOT)");
|
||||
String upperCase2 = "UpsideDownCake".toUpperCase(locale);
|
||||
Intrinsics.checkNotNullExpressionValue(upperCase2, "this as java.lang.String).toUpperCase(Locale.ROOT)");
|
||||
if (upperCase.compareTo(upperCase2) >= 0) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package com.google.android.gms.common.util;
|
||||
|
||||
import com.google.android.gms.common.annotation.KeepForSdk;
|
||||
|
||||
@KeepForSdk
|
||||
/* loaded from: classes3.dex */
|
||||
public interface Predicate<T> {
|
||||
@KeepForSdk
|
||||
boolean apply(T t2);
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
package com.google.android.gms.common.util;
|
||||
|
||||
import android.os.Process;
|
||||
import android.os.StrictMode;
|
||||
import com.google.android.gms.common.annotation.KeepForSdk;
|
||||
import com.google.android.gms.common.internal.Preconditions;
|
||||
import java.io.BufferedReader;
|
||||
import java.io.FileReader;
|
||||
import java.io.IOException;
|
||||
|
||||
@KeepForSdk
|
||||
/* loaded from: classes3.dex */
|
||||
public class ProcessUtils {
|
||||
private static String zza;
|
||||
private static int zzb;
|
||||
|
||||
private ProcessUtils() {
|
||||
}
|
||||
|
||||
@KeepForSdk
|
||||
public static String getMyProcessName() {
|
||||
BufferedReader bufferedReader;
|
||||
if (zza == null) {
|
||||
int i = zzb;
|
||||
if (i == 0) {
|
||||
i = Process.myPid();
|
||||
zzb = i;
|
||||
}
|
||||
String str = null;
|
||||
str = null;
|
||||
str = null;
|
||||
BufferedReader bufferedReader2 = null;
|
||||
if (i > 0) {
|
||||
try {
|
||||
String str2 = "/proc/" + i + "/cmdline";
|
||||
StrictMode.ThreadPolicy allowThreadDiskReads = StrictMode.allowThreadDiskReads();
|
||||
try {
|
||||
bufferedReader = new BufferedReader(new FileReader(str2));
|
||||
try {
|
||||
String readLine = bufferedReader.readLine();
|
||||
Preconditions.checkNotNull(readLine);
|
||||
str = readLine.trim();
|
||||
} catch (IOException unused) {
|
||||
} catch (Throwable th) {
|
||||
th = th;
|
||||
bufferedReader2 = bufferedReader;
|
||||
IOUtils.closeQuietly(bufferedReader2);
|
||||
throw th;
|
||||
}
|
||||
} finally {
|
||||
StrictMode.setThreadPolicy(allowThreadDiskReads);
|
||||
}
|
||||
} catch (IOException unused2) {
|
||||
bufferedReader = null;
|
||||
} catch (Throwable th2) {
|
||||
th = th2;
|
||||
}
|
||||
IOUtils.closeQuietly(bufferedReader);
|
||||
}
|
||||
zza = str;
|
||||
}
|
||||
return zza;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
package com.google.android.gms.common.util;
|
||||
|
||||
import com.google.android.gms.common.annotation.KeepForSdk;
|
||||
|
||||
@KeepForSdk
|
||||
/* loaded from: classes3.dex */
|
||||
public @interface RetainForClient {
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.google.android.gms.common.util;
|
||||
|
||||
import com.google.android.gms.common.annotation.KeepForSdk;
|
||||
import com.google.android.gms.common.api.Scope;
|
||||
import com.google.android.gms.common.internal.Preconditions;
|
||||
import java.util.Set;
|
||||
|
||||
@KeepForSdk
|
||||
/* loaded from: classes3.dex */
|
||||
public final class ScopeUtil {
|
||||
private ScopeUtil() {
|
||||
}
|
||||
|
||||
@KeepForSdk
|
||||
public static String[] toScopeString(Set<Scope> set) {
|
||||
Preconditions.checkNotNull(set, "scopes can't be null.");
|
||||
Scope[] scopeArr = (Scope[]) set.toArray(new Scope[set.size()]);
|
||||
Preconditions.checkNotNull(scopeArr, "scopes can't be null.");
|
||||
String[] strArr = new String[scopeArr.length];
|
||||
for (int i = 0; i < scopeArr.length; i++) {
|
||||
strArr[i] = scopeArr[i].getScopeUri();
|
||||
}
|
||||
return strArr;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.google.android.gms.common.util;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
import com.google.android.gms.common.annotation.KeepForSdk;
|
||||
|
||||
@KeepForSdk
|
||||
/* loaded from: classes3.dex */
|
||||
public class SharedPreferencesUtils {
|
||||
private SharedPreferencesUtils() {
|
||||
}
|
||||
|
||||
@KeepForSdk
|
||||
@Deprecated
|
||||
public static void publishWorldReadableSharedPreferences(Context context, SharedPreferences.Editor editor, String str) {
|
||||
throw new IllegalStateException("world-readable shared preferences should only be used by apk");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.google.android.gms.common.util;
|
||||
|
||||
import android.text.TextUtils;
|
||||
import com.google.android.gms.common.annotation.KeepForSdk;
|
||||
import java.util.regex.Pattern;
|
||||
import org.checkerframework.checker.nullness.qual.EnsuresNonNullIf;
|
||||
|
||||
@VisibleForTesting
|
||||
@KeepForSdk
|
||||
/* loaded from: classes3.dex */
|
||||
public class Strings {
|
||||
private static final Pattern zza = Pattern.compile("\\$\\{(.*?)\\}");
|
||||
|
||||
private Strings() {
|
||||
}
|
||||
|
||||
@KeepForSdk
|
||||
public static String emptyToNull(String str) {
|
||||
if (TextUtils.isEmpty(str)) {
|
||||
return null;
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
||||
@EnsuresNonNullIf(expression = {"#1"}, result = false)
|
||||
@KeepForSdk
|
||||
public static boolean isEmptyOrWhitespace(String str) {
|
||||
return str == null || str.trim().isEmpty();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package com.google.android.gms.common.util;
|
||||
|
||||
import android.annotation.TargetApi;
|
||||
import android.content.Context;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.util.Log;
|
||||
import com.google.android.gms.common.GoogleSignatureVerifier;
|
||||
import com.google.android.gms.common.annotation.KeepForSdk;
|
||||
import com.google.android.gms.common.wrappers.Wrappers;
|
||||
|
||||
@KeepForSdk
|
||||
/* loaded from: classes3.dex */
|
||||
public final class UidVerifier {
|
||||
private UidVerifier() {
|
||||
}
|
||||
|
||||
@KeepForSdk
|
||||
public static boolean isGooglePlayServicesUid(Context context, int i) {
|
||||
if (!uidHasPackageName(context, i, "com.google.android.gms")) {
|
||||
return false;
|
||||
}
|
||||
try {
|
||||
return GoogleSignatureVerifier.getInstance(context).isGooglePublicSignedPackage(context.getPackageManager().getPackageInfo("com.google.android.gms", 64));
|
||||
} catch (PackageManager.NameNotFoundException unused) {
|
||||
if (Log.isLoggable("UidVerifier", 3)) {
|
||||
Log.d("UidVerifier", "Package manager can't find google play services package, defaulting to false");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@KeepForSdk
|
||||
@TargetApi(19)
|
||||
public static boolean uidHasPackageName(Context context, int i, String str) {
|
||||
return Wrappers.packageManager(context).zza(i, str);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
package com.google.android.gms.common.util;
|
||||
|
||||
/* loaded from: classes3.dex */
|
||||
public @interface VisibleForTesting {
|
||||
}
|
||||
@@ -0,0 +1,307 @@
|
||||
package com.google.android.gms.common.util;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.pm.ApplicationInfo;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.os.WorkSource;
|
||||
import android.util.Log;
|
||||
import com.google.android.gms.common.annotation.KeepForSdk;
|
||||
import com.google.android.gms.common.internal.Preconditions;
|
||||
import com.google.android.gms.common.wrappers.Wrappers;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@KeepForSdk
|
||||
/* loaded from: classes3.dex */
|
||||
public class WorkSourceUtil {
|
||||
private static final int zza;
|
||||
private static final Method zzb;
|
||||
private static final Method zzc;
|
||||
private static final Method zzd;
|
||||
private static final Method zze;
|
||||
private static final Method zzf;
|
||||
private static final Method zzg;
|
||||
private static final Method zzh;
|
||||
private static final Method zzi;
|
||||
|
||||
/* JADX WARN: Can't wrap try/catch for region: R(24:1|(2:2|3)|4|(21:49|50|7|8|9|10|11|12|13|(12:41|42|16|(9:36|37|19|(6:31|32|22|(2:27|28)|24|25)|21|22|(0)|24|25)|18|19|(0)|21|22|(0)|24|25)|15|16|(0)|18|19|(0)|21|22|(0)|24|25)|6|7|8|9|10|11|12|13|(0)|15|16|(0)|18|19|(0)|21|22|(0)|24|25) */
|
||||
/* JADX WARN: Can't wrap try/catch for region: R(25:1|2|3|4|(21:49|50|7|8|9|10|11|12|13|(12:41|42|16|(9:36|37|19|(6:31|32|22|(2:27|28)|24|25)|21|22|(0)|24|25)|18|19|(0)|21|22|(0)|24|25)|15|16|(0)|18|19|(0)|21|22|(0)|24|25)|6|7|8|9|10|11|12|13|(0)|15|16|(0)|18|19|(0)|21|22|(0)|24|25) */
|
||||
/* JADX WARN: Code restructure failed: missing block: B:46:0x0045, code lost:
|
||||
|
||||
r4 = null;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:48:0x0037, code lost:
|
||||
|
||||
r4 = null;
|
||||
*/
|
||||
/* JADX WARN: Removed duplicated region for block: B:27:0x009c A[EXC_TOP_SPLITTER, SYNTHETIC] */
|
||||
/* JADX WARN: Removed duplicated region for block: B:31:0x007c A[EXC_TOP_SPLITTER, SYNTHETIC] */
|
||||
/* JADX WARN: Removed duplicated region for block: B:36:0x0064 A[EXC_TOP_SPLITTER, SYNTHETIC] */
|
||||
/* JADX WARN: Removed duplicated region for block: B:41:0x004e A[EXC_TOP_SPLITTER, SYNTHETIC] */
|
||||
static {
|
||||
/*
|
||||
java.lang.String r0 = "add"
|
||||
java.lang.Class r1 = java.lang.Integer.TYPE
|
||||
java.lang.Class<android.os.WorkSource> r2 = android.os.WorkSource.class
|
||||
int r3 = android.os.Process.myUid()
|
||||
com.google.android.gms.common.util.WorkSourceUtil.zza = r3
|
||||
r3 = 0
|
||||
java.lang.Class[] r4 = new java.lang.Class[]{r1} // Catch: java.lang.Exception -> L16
|
||||
java.lang.reflect.Method r4 = r2.getMethod(r0, r4) // Catch: java.lang.Exception -> L16
|
||||
goto L17
|
||||
L16:
|
||||
r4 = r3
|
||||
L17:
|
||||
com.google.android.gms.common.util.WorkSourceUtil.zzb = r4
|
||||
boolean r4 = com.google.android.gms.common.util.PlatformVersion.isAtLeastJellyBeanMR2()
|
||||
java.lang.Class<java.lang.String> r5 = java.lang.String.class
|
||||
if (r4 == 0) goto L2a
|
||||
java.lang.Class[] r4 = new java.lang.Class[]{r1, r5} // Catch: java.lang.Exception -> L2a
|
||||
java.lang.reflect.Method r0 = r2.getMethod(r0, r4) // Catch: java.lang.Exception -> L2a
|
||||
goto L2b
|
||||
L2a:
|
||||
r0 = r3
|
||||
L2b:
|
||||
com.google.android.gms.common.util.WorkSourceUtil.zzc = r0
|
||||
r0 = 0
|
||||
java.lang.String r4 = "size"
|
||||
java.lang.Class[] r6 = new java.lang.Class[r0] // Catch: java.lang.Exception -> L37
|
||||
java.lang.reflect.Method r4 = r2.getMethod(r4, r6) // Catch: java.lang.Exception -> L37
|
||||
goto L38
|
||||
L37:
|
||||
r4 = r3
|
||||
L38:
|
||||
com.google.android.gms.common.util.WorkSourceUtil.zzd = r4
|
||||
java.lang.Class[] r4 = new java.lang.Class[]{r1} // Catch: java.lang.Exception -> L45
|
||||
java.lang.String r6 = "get"
|
||||
java.lang.reflect.Method r4 = r2.getMethod(r6, r4) // Catch: java.lang.Exception -> L45
|
||||
goto L46
|
||||
L45:
|
||||
r4 = r3
|
||||
L46:
|
||||
com.google.android.gms.common.util.WorkSourceUtil.zze = r4
|
||||
boolean r4 = com.google.android.gms.common.util.PlatformVersion.isAtLeastJellyBeanMR2()
|
||||
if (r4 == 0) goto L59
|
||||
java.lang.Class[] r4 = new java.lang.Class[]{r1} // Catch: java.lang.Exception -> L59
|
||||
java.lang.String r6 = "getName"
|
||||
java.lang.reflect.Method r4 = r2.getMethod(r6, r4) // Catch: java.lang.Exception -> L59
|
||||
goto L5a
|
||||
L59:
|
||||
r4 = r3
|
||||
L5a:
|
||||
com.google.android.gms.common.util.WorkSourceUtil.zzf = r4
|
||||
boolean r4 = com.google.android.gms.common.util.PlatformVersion.isAtLeastP()
|
||||
java.lang.String r6 = "WorkSourceUtil"
|
||||
if (r4 == 0) goto L73
|
||||
java.lang.String r4 = "createWorkChain"
|
||||
java.lang.Class[] r7 = new java.lang.Class[r0] // Catch: java.lang.Exception -> L6d
|
||||
java.lang.reflect.Method r4 = r2.getMethod(r4, r7) // Catch: java.lang.Exception -> L6d
|
||||
goto L74
|
||||
L6d:
|
||||
r4 = move-exception
|
||||
java.lang.String r7 = "Missing WorkChain API createWorkChain"
|
||||
android.util.Log.w(r6, r7, r4)
|
||||
L73:
|
||||
r4 = r3
|
||||
L74:
|
||||
com.google.android.gms.common.util.WorkSourceUtil.zzg = r4
|
||||
boolean r4 = com.google.android.gms.common.util.PlatformVersion.isAtLeastP()
|
||||
if (r4 == 0) goto L93
|
||||
java.lang.String r4 = "android.os.WorkSource$WorkChain"
|
||||
java.lang.Class r4 = java.lang.Class.forName(r4) // Catch: java.lang.Exception -> L8d
|
||||
java.lang.Class[] r1 = new java.lang.Class[]{r1, r5} // Catch: java.lang.Exception -> L8d
|
||||
java.lang.String r5 = "addNode"
|
||||
java.lang.reflect.Method r1 = r4.getMethod(r5, r1) // Catch: java.lang.Exception -> L8d
|
||||
goto L94
|
||||
L8d:
|
||||
r1 = move-exception
|
||||
java.lang.String r4 = "Missing WorkChain class"
|
||||
android.util.Log.w(r6, r4, r1)
|
||||
L93:
|
||||
r1 = r3
|
||||
L94:
|
||||
com.google.android.gms.common.util.WorkSourceUtil.zzh = r1
|
||||
boolean r1 = com.google.android.gms.common.util.PlatformVersion.isAtLeastP()
|
||||
if (r1 == 0) goto La8
|
||||
java.lang.String r1 = "isEmpty"
|
||||
java.lang.Class[] r0 = new java.lang.Class[r0] // Catch: java.lang.Exception -> La8
|
||||
java.lang.reflect.Method r3 = r2.getMethod(r1, r0) // Catch: java.lang.Exception -> La8
|
||||
r0 = 1
|
||||
r3.setAccessible(r0) // Catch: java.lang.Exception -> La8
|
||||
La8:
|
||||
com.google.android.gms.common.util.WorkSourceUtil.zzi = r3
|
||||
return
|
||||
*/
|
||||
throw new UnsupportedOperationException("Method not decompiled: com.google.android.gms.common.util.WorkSourceUtil.<clinit>():void");
|
||||
}
|
||||
|
||||
private WorkSourceUtil() {
|
||||
}
|
||||
|
||||
@KeepForSdk
|
||||
public static void add(WorkSource workSource, int i, String str) {
|
||||
Method method = zzc;
|
||||
if (method != null) {
|
||||
if (str == null) {
|
||||
str = "";
|
||||
}
|
||||
try {
|
||||
method.invoke(workSource, Integer.valueOf(i), str);
|
||||
return;
|
||||
} catch (Exception e4) {
|
||||
Log.wtf("WorkSourceUtil", "Unable to assign blame through WorkSource", e4);
|
||||
return;
|
||||
}
|
||||
}
|
||||
Method method2 = zzb;
|
||||
if (method2 != null) {
|
||||
try {
|
||||
method2.invoke(workSource, Integer.valueOf(i));
|
||||
} catch (Exception e5) {
|
||||
Log.wtf("WorkSourceUtil", "Unable to assign blame through WorkSource", e5);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@KeepForSdk
|
||||
public static WorkSource fromPackage(Context context, String str) {
|
||||
if (context != null && context.getPackageManager() != null && str != null) {
|
||||
try {
|
||||
ApplicationInfo applicationInfo = Wrappers.packageManager(context).getApplicationInfo(str, 0);
|
||||
if (applicationInfo == null) {
|
||||
Log.e("WorkSourceUtil", "Could not get applicationInfo from package: ".concat(str));
|
||||
return null;
|
||||
}
|
||||
int i = applicationInfo.uid;
|
||||
WorkSource workSource = new WorkSource();
|
||||
add(workSource, i, str);
|
||||
return workSource;
|
||||
} catch (PackageManager.NameNotFoundException unused) {
|
||||
Log.e("WorkSourceUtil", "Could not find package: ".concat(str));
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@KeepForSdk
|
||||
public static WorkSource fromPackageAndModuleExperimentalPi(Context context, String str, String str2) {
|
||||
Method method;
|
||||
if (context == null || context.getPackageManager() == null || str2 == null || str == null) {
|
||||
Log.w("WorkSourceUtil", "Unexpected null arguments");
|
||||
return null;
|
||||
}
|
||||
int i = -1;
|
||||
try {
|
||||
ApplicationInfo applicationInfo = Wrappers.packageManager(context).getApplicationInfo(str, 0);
|
||||
if (applicationInfo == null) {
|
||||
Log.e("WorkSourceUtil", "Could not get applicationInfo from package: ".concat(str));
|
||||
} else {
|
||||
i = applicationInfo.uid;
|
||||
}
|
||||
} catch (PackageManager.NameNotFoundException unused) {
|
||||
Log.e("WorkSourceUtil", "Could not find package: ".concat(str));
|
||||
}
|
||||
if (i < 0) {
|
||||
return null;
|
||||
}
|
||||
WorkSource workSource = new WorkSource();
|
||||
Method method2 = zzg;
|
||||
if (method2 == null || (method = zzh) == null) {
|
||||
add(workSource, i, str);
|
||||
} else {
|
||||
try {
|
||||
Object invoke = method2.invoke(workSource, new Object[0]);
|
||||
int i4 = zza;
|
||||
if (i != i4) {
|
||||
method.invoke(invoke, Integer.valueOf(i), str);
|
||||
}
|
||||
method.invoke(invoke, Integer.valueOf(i4), str2);
|
||||
} catch (Exception e4) {
|
||||
Log.w("WorkSourceUtil", "Unable to assign chained blame through WorkSource", e4);
|
||||
}
|
||||
}
|
||||
return workSource;
|
||||
}
|
||||
|
||||
@KeepForSdk
|
||||
public static int get(WorkSource workSource, int i) {
|
||||
Method method = zze;
|
||||
if (method == null) {
|
||||
return 0;
|
||||
}
|
||||
try {
|
||||
Object invoke = method.invoke(workSource, Integer.valueOf(i));
|
||||
Preconditions.checkNotNull(invoke);
|
||||
return ((Integer) invoke).intValue();
|
||||
} catch (Exception e4) {
|
||||
Log.wtf("WorkSourceUtil", "Unable to assign blame through WorkSource", e4);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@KeepForSdk
|
||||
public static String getName(WorkSource workSource, int i) {
|
||||
Method method = zzf;
|
||||
if (method == null) {
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
return (String) method.invoke(workSource, Integer.valueOf(i));
|
||||
} catch (Exception e4) {
|
||||
Log.wtf("WorkSourceUtil", "Unable to assign blame through WorkSource", e4);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@KeepForSdk
|
||||
public static List<String> getNames(WorkSource workSource) {
|
||||
ArrayList arrayList = new ArrayList();
|
||||
int size = workSource == null ? 0 : size(workSource);
|
||||
if (size != 0) {
|
||||
for (int i = 0; i < size; i++) {
|
||||
String name = getName(workSource, i);
|
||||
if (!Strings.isEmptyOrWhitespace(name)) {
|
||||
Preconditions.checkNotNull(name);
|
||||
arrayList.add(name);
|
||||
}
|
||||
}
|
||||
}
|
||||
return arrayList;
|
||||
}
|
||||
|
||||
@KeepForSdk
|
||||
public static boolean hasWorkSourcePermission(Context context) {
|
||||
return (context == null || context.getPackageManager() == null || Wrappers.packageManager(context).checkPermission("android.permission.UPDATE_DEVICE_STATS", context.getPackageName()) != 0) ? false : true;
|
||||
}
|
||||
|
||||
@KeepForSdk
|
||||
public static boolean isEmpty(WorkSource workSource) {
|
||||
Method method = zzi;
|
||||
if (method != null) {
|
||||
try {
|
||||
Object invoke = method.invoke(workSource, new Object[0]);
|
||||
Preconditions.checkNotNull(invoke);
|
||||
return ((Boolean) invoke).booleanValue();
|
||||
} catch (Exception e4) {
|
||||
Log.e("WorkSourceUtil", "Unable to check WorkSource emptiness", e4);
|
||||
}
|
||||
}
|
||||
return size(workSource) == 0;
|
||||
}
|
||||
|
||||
@KeepForSdk
|
||||
public static int size(WorkSource workSource) {
|
||||
Method method = zzd;
|
||||
if (method != null) {
|
||||
try {
|
||||
Object invoke = method.invoke(workSource, new Object[0]);
|
||||
Preconditions.checkNotNull(invoke);
|
||||
return ((Integer) invoke).intValue();
|
||||
} catch (Exception e4) {
|
||||
Log.wtf("WorkSourceUtil", "Unable to assign blame through WorkSource", e4);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.google.android.gms.common.util.concurrent;
|
||||
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import com.google.android.gms.common.annotation.KeepForSdk;
|
||||
import com.google.android.gms.internal.common.zzi;
|
||||
import java.util.concurrent.Executor;
|
||||
|
||||
@KeepForSdk
|
||||
/* loaded from: classes3.dex */
|
||||
public class HandlerExecutor implements Executor {
|
||||
private final Handler zza;
|
||||
|
||||
@KeepForSdk
|
||||
public HandlerExecutor(Looper looper) {
|
||||
this.zza = new zzi(looper);
|
||||
}
|
||||
|
||||
@Override // java.util.concurrent.Executor
|
||||
public final void execute(Runnable runnable) {
|
||||
this.zza.post(runnable);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.google.android.gms.common.util.concurrent;
|
||||
|
||||
import com.google.android.gms.common.annotation.KeepForSdk;
|
||||
import com.google.android.gms.common.internal.Preconditions;
|
||||
import java.util.concurrent.Executors;
|
||||
import java.util.concurrent.ThreadFactory;
|
||||
|
||||
@KeepForSdk
|
||||
/* loaded from: classes3.dex */
|
||||
public class NamedThreadFactory implements ThreadFactory {
|
||||
private final String zza;
|
||||
private final ThreadFactory zzb = Executors.defaultThreadFactory();
|
||||
|
||||
@KeepForSdk
|
||||
public NamedThreadFactory(String str) {
|
||||
Preconditions.checkNotNull(str, "Name must not be null");
|
||||
this.zza = str;
|
||||
}
|
||||
|
||||
@Override // java.util.concurrent.ThreadFactory
|
||||
public final Thread newThread(Runnable runnable) {
|
||||
Thread newThread = this.zzb.newThread(new zza(runnable, 0));
|
||||
newThread.setName(this.zza);
|
||||
return newThread;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.google.android.gms.common.util.concurrent;
|
||||
|
||||
import com.google.android.gms.common.annotation.KeepForSdk;
|
||||
import com.google.android.gms.common.internal.Preconditions;
|
||||
import java.util.concurrent.Executors;
|
||||
import java.util.concurrent.ThreadFactory;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
@KeepForSdk
|
||||
/* loaded from: classes3.dex */
|
||||
public class NumberedThreadFactory implements ThreadFactory {
|
||||
private final String zza;
|
||||
private final AtomicInteger zzb = new AtomicInteger();
|
||||
private final ThreadFactory zzc = Executors.defaultThreadFactory();
|
||||
|
||||
@KeepForSdk
|
||||
public NumberedThreadFactory(String str) {
|
||||
Preconditions.checkNotNull(str, "Name must not be null");
|
||||
this.zza = str;
|
||||
}
|
||||
|
||||
@Override // java.util.concurrent.ThreadFactory
|
||||
public final Thread newThread(Runnable runnable) {
|
||||
Thread newThread = this.zzc.newThread(new zza(runnable, 0));
|
||||
newThread.setName(this.zza + "[" + this.zzb.getAndIncrement() + "]");
|
||||
return newThread;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.google.android.gms.common.util.concurrent;
|
||||
|
||||
import android.os.Process;
|
||||
|
||||
/* loaded from: classes3.dex */
|
||||
final class zza implements Runnable {
|
||||
private final Runnable zza;
|
||||
|
||||
public zza(Runnable runnable, int i) {
|
||||
this.zza = runnable;
|
||||
}
|
||||
|
||||
@Override // java.lang.Runnable
|
||||
public final void run() {
|
||||
Process.setThreadPriority(0);
|
||||
this.zza.run();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package com.google.android.gms.common.util;
|
||||
|
||||
/* loaded from: classes3.dex */
|
||||
public final class zza {
|
||||
public static int zza(int i) {
|
||||
if (i == -1) {
|
||||
return -1;
|
||||
}
|
||||
return i / 1000;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package com.google.android.gms.common.util;
|
||||
|
||||
import android.os.Looper;
|
||||
|
||||
/* loaded from: classes3.dex */
|
||||
public final class zzb {
|
||||
public static boolean zza() {
|
||||
return Looper.getMainLooper() == Looper.myLooper();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
package com.google.android.gms.common.util;
|
||||
|
||||
import android.text.TextUtils;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
/* loaded from: classes3.dex */
|
||||
final class zzc {
|
||||
private static final Pattern zza = Pattern.compile("\\\\u[0-9a-fA-F]{4}");
|
||||
|
||||
public static String zza(String str) {
|
||||
if (TextUtils.isEmpty(str)) {
|
||||
return str;
|
||||
}
|
||||
Matcher matcher = zza.matcher(str);
|
||||
int i = 0;
|
||||
StringBuilder sb = null;
|
||||
while (matcher.find()) {
|
||||
if (sb == null) {
|
||||
sb = new StringBuilder();
|
||||
}
|
||||
int start = matcher.start();
|
||||
int i4 = start;
|
||||
while (i4 >= 0 && str.charAt(i4) == '\\') {
|
||||
i4--;
|
||||
}
|
||||
if ((start - i4) % 2 != 0) {
|
||||
int parseInt = Integer.parseInt(matcher.group().substring(2), 16);
|
||||
sb.append((CharSequence) str, i, matcher.start());
|
||||
if (parseInt == 92) {
|
||||
sb.append("\\\\");
|
||||
} else {
|
||||
sb.append(Character.toChars(parseInt));
|
||||
}
|
||||
i = matcher.end();
|
||||
}
|
||||
}
|
||||
if (sb == null) {
|
||||
return str;
|
||||
}
|
||||
if (i < matcher.regionEnd()) {
|
||||
sb.append((CharSequence) str, i, matcher.regionEnd());
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user