what-the-bank/sources/com/google/android/gms/common/util/AndroidUtilsLight.java

38 lines
1.3 KiB
Java
Raw Permalink Normal View History

2024-07-27 18:17:47 +07:00
package com.google.android.gms.common.util;
import android.content.Context;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import com.google.android.gms.common.wrappers.Wrappers;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
/* loaded from: classes.dex */
public class AndroidUtilsLight {
private static volatile int zza = -1;
@Deprecated
public static byte[] getPackageCertificateHashBytes(Context context, String str) throws PackageManager.NameNotFoundException {
MessageDigest zza2;
PackageInfo packageInfo = Wrappers.packageManager(context).getPackageInfo(str, 64);
if (packageInfo.signatures == null || packageInfo.signatures.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;
}
}