- Added realracing3-community.apk (71.57 MB) - Removed 32-bit support (armeabi-v7a) - Only includes arm64-v8a libraries - Decompiled source code included - Added README-community.md with analysis
51 lines
1.9 KiB
Java
51 lines
1.9 KiB
Java
package com.facebook.internal.security;
|
|
|
|
import android.content.Context;
|
|
import android.content.pm.PackageManager;
|
|
import android.content.pm.Signature;
|
|
import android.util.Base64;
|
|
import androidx.annotation.VisibleForTesting;
|
|
import java.security.MessageDigest;
|
|
import java.security.NoSuchAlgorithmException;
|
|
import kotlin.jvm.internal.Intrinsics;
|
|
|
|
/* loaded from: classes2.dex */
|
|
public final class CertificateUtil {
|
|
public static final String DELIMITER = ":";
|
|
public static final CertificateUtil INSTANCE = new CertificateUtil();
|
|
|
|
@VisibleForTesting(otherwise = 2)
|
|
public static /* synthetic */ void getDELIMITER$facebook_core_release$annotations() {
|
|
}
|
|
|
|
private CertificateUtil() {
|
|
}
|
|
|
|
public static final String getCertificateHash(Context ctx) {
|
|
Intrinsics.checkNotNullParameter(ctx, "ctx");
|
|
try {
|
|
Signature[] signatures = ctx.getPackageManager().getPackageInfo(ctx.getPackageName(), 64).signatures;
|
|
StringBuilder sb = new StringBuilder();
|
|
MessageDigest messageDigest = MessageDigest.getInstance("SHA1");
|
|
Intrinsics.checkNotNullExpressionValue(signatures, "signatures");
|
|
int length = signatures.length;
|
|
int i = 0;
|
|
while (i < length) {
|
|
Signature signature = signatures[i];
|
|
i++;
|
|
messageDigest.update(signature.toByteArray());
|
|
sb.append(Base64.encodeToString(messageDigest.digest(), 0));
|
|
sb.append(DELIMITER);
|
|
}
|
|
if (sb.length() > 0) {
|
|
sb.setLength(sb.length() - 1);
|
|
}
|
|
String sb2 = sb.toString();
|
|
Intrinsics.checkNotNullExpressionValue(sb2, "sb.toString()");
|
|
return sb2;
|
|
} catch (PackageManager.NameNotFoundException | NoSuchAlgorithmException unused) {
|
|
return "";
|
|
}
|
|
}
|
|
}
|