Files
Daniel Elliott c080f0d97f Add Discord community version (64-bit only)
- 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
2026-02-18 15:48:36 -08:00

154 lines
5.5 KiB
Java

package com.google.android.gms.internal.ads;
import java.security.GeneralSecurityException;
import java.security.SecureRandom;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
/* loaded from: classes3.dex */
public final class zzged {
private final List zza = new ArrayList();
private final zzglo zzb = zzglo.zza;
private boolean zzc = false;
/* JADX INFO: Access modifiers changed from: private */
public final void zzd() {
Iterator it = this.zza.iterator();
while (it.hasNext()) {
((zzgeb) it.next()).zza = false;
}
}
public final zzged zza(zzgeb zzgebVar) {
if (zzgebVar.zzf != null) {
throw new IllegalStateException("Entry has already been added to a KeysetHandle.Builder");
}
if (zzgebVar.zza) {
zzd();
}
zzgebVar.zzf = this;
this.zza.add(zzgebVar);
return this;
}
public final zzgeg zzb() throws GeneralSecurityException {
zzgec zzgecVar;
int i;
int i2;
zzgec zzgecVar2;
zzgec zzgecVar3;
if (this.zzc) {
throw new GeneralSecurityException("KeysetHandle.Builder#build must only be called once");
}
char c = 1;
this.zzc = true;
List list = this.zza;
zzgst zzc = zzgsx.zzc();
ArrayList arrayList = new ArrayList(list.size());
List list2 = this.zza;
int i3 = 0;
int i4 = 0;
while (i4 < list2.size() - 1) {
int i5 = i4 + 1;
zzgec zzgecVar4 = ((zzgeb) list2.get(i4)).zze;
zzgecVar2 = zzgec.zza;
if (zzgecVar4 == zzgecVar2) {
zzgec zzgecVar5 = ((zzgeb) list2.get(i5)).zze;
zzgecVar3 = zzgec.zza;
if (zzgecVar5 != zzgecVar3) {
throw new GeneralSecurityException("Entries with 'withRandomId()' may only be followed by other entries with 'withRandomId()'.");
}
}
i4 = i5;
}
HashSet hashSet = new HashSet();
Integer num = null;
for (zzgeb zzgebVar : this.zza) {
zzgdz unused = zzgebVar.zzb;
if (zzgebVar.zze == null) {
throw new GeneralSecurityException("No ID was set (with withFixedId or withRandomId)");
}
zzgec zzgecVar6 = zzgebVar.zze;
zzgecVar = zzgec.zza;
int i6 = 4;
if (zzgecVar6 == zzgecVar) {
i = i3;
while (true) {
if (i != 0 && !hashSet.contains(Integer.valueOf(i))) {
break;
}
SecureRandom secureRandom = new SecureRandom();
byte[] bArr = new byte[i6];
int i7 = i3;
while (i7 == 0) {
secureRandom.nextBytes(bArr);
i7 = ((bArr[2] & 255) << 8) | ((bArr[i3] & 255) << 24) | ((bArr[c] & 255) << 16) | (bArr[3] & 255);
i3 = 0;
i6 = 4;
}
i = i7;
}
} else {
zzgec unused2 = zzgebVar.zze;
i = 0;
}
Integer valueOf = Integer.valueOf(i);
if (hashSet.contains(valueOf)) {
throw new GeneralSecurityException("Id " + i + " is used twice in the keyset");
}
hashSet.add(valueOf);
zzgeb.zza(zzgebVar);
zzgdx zza = zzgma.zzb().zza(zzgebVar.zzd, c != zzgebVar.zzd.zza() ? null : valueOf);
zzgee zzgeeVar = new zzgee(zza, zzgebVar.zzb, i, zzgebVar.zza, null);
zzgdz zzgdzVar = zzgebVar.zzb;
zzgnh zzgnhVar = (zzgnh) zzgmk.zzc().zzd(zza, zzgnh.class, zzgeo.zza());
Integer zzf = zzgnhVar.zzf();
if (zzf != null && zzf.intValue() != i) {
throw new GeneralSecurityException("Wrong ID set for key with ID requirement");
}
zzgdz zzgdzVar2 = zzgdz.zza;
if (zzgdzVar2.equals(zzgdzVar)) {
i2 = 3;
} else if (zzgdz.zzb.equals(zzgdzVar)) {
i2 = 4;
} else {
if (!zzgdz.zzc.equals(zzgdzVar)) {
throw new IllegalStateException("Unknown key status");
}
i2 = 5;
}
zzgsu zzc2 = zzgsv.zzc();
zzgsi zza2 = zzgsl.zza();
zza2.zzb(zzgnhVar.zzg());
zza2.zzc(zzgnhVar.zze());
zza2.zza(zzgnhVar.zzb());
zzc2.zza(zza2);
zzc2.zzd(i2);
zzc2.zzb(i);
zzc2.zzc(zzgnhVar.zzc());
zzc.zza((zzgsv) zzc2.zzbr());
if (zzgebVar.zza) {
if (num != null) {
throw new GeneralSecurityException("Two primaries were set");
}
if (zzgebVar.zzb != zzgdzVar2) {
throw new GeneralSecurityException("Primary key is not enabled");
}
num = valueOf;
}
arrayList.add(zzgeeVar);
c = 1;
i3 = 0;
}
if (num == null) {
throw new GeneralSecurityException("No primary was set");
}
zzc.zzb(num.intValue());
zzgsx zzgsxVar = (zzgsx) zzc.zzbr();
zzgeg.zzh(zzgsxVar);
return new zzgeg(zzgsxVar, arrayList, this.zzb, null);
}
}