package f7; import java.nio.charset.StandardCharsets; import javax.crypto.Cipher; import javax.crypto.spec.IvParameterSpec; import javax.crypto.spec.SecretKeySpec; /* loaded from: classes2.dex */ public abstract class a { /* renamed from: a, reason: collision with root package name */ public static byte[] f9592a = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* renamed from: b, reason: collision with root package name */ private static final char[] f9593b = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'}; /* renamed from: c, reason: collision with root package name */ public static SecretKeySpec f9594c; public static String a(String str, String str2) { byte[] bytes = str.getBytes(StandardCharsets.UTF_8); String substring = str2.substring(0, 16); if (f9594c == null) { byte[] bArr = new byte[16]; byte[] bytes2 = str2.getBytes(StandardCharsets.UTF_8); int length = bytes2.length; System.arraycopy(bytes2, 0, bArr, 0, length <= 16 ? length : 16); f9594c = new SecretKeySpec(bArr, "AES"); } Cipher cipher = Cipher.getInstance("AES/CBC/PKCS5Padding"); cipher.init(1, f9594c, new IvParameterSpec(substring.getBytes())); return new String(b(cipher.doFinal(bytes))); } public static char[] b(byte[] bArr) { char[] cArr = new char[bArr.length << 1]; int i10 = 0; for (byte b10 : bArr) { int i11 = i10 + 1; char[] cArr2 = f9593b; cArr[i10] = cArr2[(b10 & 240) >>> 4]; i10 = i11 + 1; cArr[i11] = cArr2[b10 & 15]; } return cArr; } }