alexandroid/decompiled/jadx/sources/com/google/protobuf/Descriptors.java
KaKi87 a47fad5135 📦 Add decompiled Alexa 2.2.730155.0 (jadx, apktool, Hermes strings)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-07 00:04:16 +01:00

2036 lines
92 KiB
Java

package com.google.protobuf;
import com.amazon.rtcsc.service.deviceconfiguration.util.DeviceConfigConstants;
import com.google.protobuf.DescriptorProtos;
import com.google.protobuf.FieldSet;
import com.google.protobuf.Internal;
import com.google.protobuf.Message;
import com.google.protobuf.MessageLite;
import com.google.protobuf.TextFormat;
import com.google.protobuf.WireFormat;
import defpackage.a$$ExternalSyntheticOutline0;
import java.lang.ref.WeakReference;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.WeakHashMap;
import java.util.logging.Logger;
import okio.Buffer$$ExternalSyntheticBUOutline0;
import rx.Single$$ExternalSyntheticBUOutline0;
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
/* loaded from: classes8.dex */
public final class Descriptors {
private static final Logger logger = Logger.getLogger(Descriptors.class.getName());
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
/* renamed from: com.google.protobuf.Descriptors$1, reason: invalid class name */
public static /* synthetic */ class AnonymousClass1 {
static final /* synthetic */ int[] $SwitchMap$com$google$protobuf$Descriptors$FieldDescriptor$JavaType;
static final /* synthetic */ int[] $SwitchMap$com$google$protobuf$Descriptors$FieldDescriptor$Type;
static {
int[] iArr = new int[FieldDescriptor.JavaType.values().length];
$SwitchMap$com$google$protobuf$Descriptors$FieldDescriptor$JavaType = iArr;
try {
iArr[FieldDescriptor.JavaType.ENUM.ordinal()] = 1;
} catch (NoSuchFieldError unused) {
}
try {
$SwitchMap$com$google$protobuf$Descriptors$FieldDescriptor$JavaType[FieldDescriptor.JavaType.MESSAGE.ordinal()] = 2;
} catch (NoSuchFieldError unused2) {
}
int[] iArr2 = new int[FieldDescriptor.Type.values().length];
$SwitchMap$com$google$protobuf$Descriptors$FieldDescriptor$Type = iArr2;
try {
iArr2[FieldDescriptor.Type.INT32.ordinal()] = 1;
} catch (NoSuchFieldError unused3) {
}
try {
$SwitchMap$com$google$protobuf$Descriptors$FieldDescriptor$Type[FieldDescriptor.Type.SINT32.ordinal()] = 2;
} catch (NoSuchFieldError unused4) {
}
try {
$SwitchMap$com$google$protobuf$Descriptors$FieldDescriptor$Type[FieldDescriptor.Type.SFIXED32.ordinal()] = 3;
} catch (NoSuchFieldError unused5) {
}
try {
$SwitchMap$com$google$protobuf$Descriptors$FieldDescriptor$Type[FieldDescriptor.Type.UINT32.ordinal()] = 4;
} catch (NoSuchFieldError unused6) {
}
try {
$SwitchMap$com$google$protobuf$Descriptors$FieldDescriptor$Type[FieldDescriptor.Type.FIXED32.ordinal()] = 5;
} catch (NoSuchFieldError unused7) {
}
try {
$SwitchMap$com$google$protobuf$Descriptors$FieldDescriptor$Type[FieldDescriptor.Type.INT64.ordinal()] = 6;
} catch (NoSuchFieldError unused8) {
}
try {
$SwitchMap$com$google$protobuf$Descriptors$FieldDescriptor$Type[FieldDescriptor.Type.SINT64.ordinal()] = 7;
} catch (NoSuchFieldError unused9) {
}
try {
$SwitchMap$com$google$protobuf$Descriptors$FieldDescriptor$Type[FieldDescriptor.Type.SFIXED64.ordinal()] = 8;
} catch (NoSuchFieldError unused10) {
}
try {
$SwitchMap$com$google$protobuf$Descriptors$FieldDescriptor$Type[FieldDescriptor.Type.UINT64.ordinal()] = 9;
} catch (NoSuchFieldError unused11) {
}
try {
$SwitchMap$com$google$protobuf$Descriptors$FieldDescriptor$Type[FieldDescriptor.Type.FIXED64.ordinal()] = 10;
} catch (NoSuchFieldError unused12) {
}
try {
$SwitchMap$com$google$protobuf$Descriptors$FieldDescriptor$Type[FieldDescriptor.Type.FLOAT.ordinal()] = 11;
} catch (NoSuchFieldError unused13) {
}
try {
$SwitchMap$com$google$protobuf$Descriptors$FieldDescriptor$Type[FieldDescriptor.Type.DOUBLE.ordinal()] = 12;
} catch (NoSuchFieldError unused14) {
}
try {
$SwitchMap$com$google$protobuf$Descriptors$FieldDescriptor$Type[FieldDescriptor.Type.BOOL.ordinal()] = 13;
} catch (NoSuchFieldError unused15) {
}
try {
$SwitchMap$com$google$protobuf$Descriptors$FieldDescriptor$Type[FieldDescriptor.Type.STRING.ordinal()] = 14;
} catch (NoSuchFieldError unused16) {
}
try {
$SwitchMap$com$google$protobuf$Descriptors$FieldDescriptor$Type[FieldDescriptor.Type.BYTES.ordinal()] = 15;
} catch (NoSuchFieldError unused17) {
}
try {
$SwitchMap$com$google$protobuf$Descriptors$FieldDescriptor$Type[FieldDescriptor.Type.ENUM.ordinal()] = 16;
} catch (NoSuchFieldError unused18) {
}
try {
$SwitchMap$com$google$protobuf$Descriptors$FieldDescriptor$Type[FieldDescriptor.Type.MESSAGE.ordinal()] = 17;
} catch (NoSuchFieldError unused19) {
}
try {
$SwitchMap$com$google$protobuf$Descriptors$FieldDescriptor$Type[FieldDescriptor.Type.GROUP.ordinal()] = 18;
} catch (NoSuchFieldError unused20) {
}
}
}
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
public static abstract class GenericDescriptor {
public abstract FileDescriptor getFile();
public abstract String getFullName();
public abstract String getName();
public abstract Message toProto();
}
/* JADX INFO: Access modifiers changed from: private */
public static String computeFullName(FileDescriptor fileDescriptor, Descriptor descriptor, String str) {
if (descriptor != null) {
return descriptor.getFullName() + '.' + str;
}
if (fileDescriptor.getPackage().length() <= 0) {
return str;
}
return fileDescriptor.getPackage() + '.' + str;
}
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
public static final class Descriptor extends GenericDescriptor {
private final Descriptor containingType;
private final EnumDescriptor[] enumTypes;
private final FieldDescriptor[] extensions;
private final FieldDescriptor[] fields;
private final FileDescriptor file;
private final String fullName;
private final int index;
private final Descriptor[] nestedTypes;
private final OneofDescriptor[] oneofs;
private DescriptorProtos.DescriptorProto proto;
private Descriptor(DescriptorProtos.DescriptorProto descriptorProto, FileDescriptor fileDescriptor, Descriptor descriptor, int i) throws DescriptorValidationException {
this.index = i;
this.proto = descriptorProto;
this.fullName = Descriptors.computeFullName(fileDescriptor, descriptor, descriptorProto.getName());
this.file = fileDescriptor;
this.containingType = descriptor;
this.oneofs = new OneofDescriptor[descriptorProto.getOneofDeclCount()];
for (int i2 = 0; i2 < descriptorProto.getOneofDeclCount(); i2++) {
this.oneofs[i2] = new OneofDescriptor(descriptorProto.getOneofDecl(i2), fileDescriptor, this, i2, null);
}
this.nestedTypes = new Descriptor[descriptorProto.getNestedTypeCount()];
for (int i3 = 0; i3 < descriptorProto.getNestedTypeCount(); i3++) {
this.nestedTypes[i3] = new Descriptor(descriptorProto.getNestedType(i3), fileDescriptor, this, i3);
}
this.enumTypes = new EnumDescriptor[descriptorProto.getEnumTypeCount()];
for (int i4 = 0; i4 < descriptorProto.getEnumTypeCount(); i4++) {
this.enumTypes[i4] = new EnumDescriptor(descriptorProto.getEnumType(i4), fileDescriptor, this, i4, null);
}
this.fields = new FieldDescriptor[descriptorProto.getFieldCount()];
for (int i5 = 0; i5 < descriptorProto.getFieldCount(); i5++) {
this.fields[i5] = new FieldDescriptor(descriptorProto.getField(i5), fileDescriptor, this, i5, false, null);
}
this.extensions = new FieldDescriptor[descriptorProto.getExtensionCount()];
for (int i6 = 0; i6 < descriptorProto.getExtensionCount(); i6++) {
this.extensions[i6] = new FieldDescriptor(descriptorProto.getExtension(i6), fileDescriptor, this, i6, true, null);
}
for (int i7 = 0; i7 < descriptorProto.getOneofDeclCount(); i7++) {
OneofDescriptor oneofDescriptor = this.oneofs[i7];
oneofDescriptor.fields = new FieldDescriptor[oneofDescriptor.getFieldCount()];
this.oneofs[i7].fieldCount = 0;
}
for (int i8 = 0; i8 < descriptorProto.getFieldCount(); i8++) {
OneofDescriptor containingOneof = this.fields[i8].getContainingOneof();
if (containingOneof != null) {
containingOneof.fields[OneofDescriptor.access$1908(containingOneof)] = this.fields[i8];
}
}
fileDescriptor.pool.addSymbol(this);
}
/* JADX INFO: Access modifiers changed from: private */
public void crossLink() throws DescriptorValidationException {
for (Descriptor descriptor : this.nestedTypes) {
descriptor.crossLink();
}
for (FieldDescriptor fieldDescriptor : this.fields) {
fieldDescriptor.crossLink();
}
for (FieldDescriptor fieldDescriptor2 : this.extensions) {
fieldDescriptor2.crossLink();
}
}
/* JADX INFO: Access modifiers changed from: private */
public void setProto(DescriptorProtos.DescriptorProto descriptorProto) {
this.proto = descriptorProto;
int i = 0;
int i2 = 0;
while (true) {
Descriptor[] descriptorArr = this.nestedTypes;
if (i2 >= descriptorArr.length) {
break;
}
descriptorArr[i2].setProto(descriptorProto.getNestedType(i2));
i2++;
}
int i3 = 0;
while (true) {
OneofDescriptor[] oneofDescriptorArr = this.oneofs;
if (i3 >= oneofDescriptorArr.length) {
break;
}
oneofDescriptorArr[i3].setProto(descriptorProto.getOneofDecl(i3));
i3++;
}
int i4 = 0;
while (true) {
EnumDescriptor[] enumDescriptorArr = this.enumTypes;
if (i4 >= enumDescriptorArr.length) {
break;
}
enumDescriptorArr[i4].setProto(descriptorProto.getEnumType(i4));
i4++;
}
int i5 = 0;
while (true) {
FieldDescriptor[] fieldDescriptorArr = this.fields;
if (i5 >= fieldDescriptorArr.length) {
break;
}
fieldDescriptorArr[i5].setProto(descriptorProto.getField(i5));
i5++;
}
while (true) {
FieldDescriptor[] fieldDescriptorArr2 = this.extensions;
if (i >= fieldDescriptorArr2.length) {
return;
}
fieldDescriptorArr2[i].setProto(descriptorProto.getExtension(i));
i++;
}
}
public EnumDescriptor findEnumTypeByName(String str) {
GenericDescriptor findSymbol = this.file.pool.findSymbol(a$$ExternalSyntheticOutline0.m(new StringBuilder(), this.fullName, '.', str));
if (findSymbol == null || !(findSymbol instanceof EnumDescriptor)) {
return null;
}
return (EnumDescriptor) findSymbol;
}
public FieldDescriptor findFieldByName(String str) {
GenericDescriptor findSymbol = this.file.pool.findSymbol(a$$ExternalSyntheticOutline0.m(new StringBuilder(), this.fullName, '.', str));
if (findSymbol == null || !(findSymbol instanceof FieldDescriptor)) {
return null;
}
return (FieldDescriptor) findSymbol;
}
public FieldDescriptor findFieldByNumber(int i) {
return (FieldDescriptor) this.file.pool.fieldsByNumber.get(new DescriptorPool.DescriptorIntPair(this, i));
}
public Descriptor findNestedTypeByName(String str) {
GenericDescriptor findSymbol = this.file.pool.findSymbol(a$$ExternalSyntheticOutline0.m(new StringBuilder(), this.fullName, '.', str));
if (findSymbol == null || !(findSymbol instanceof Descriptor)) {
return null;
}
return (Descriptor) findSymbol;
}
public Descriptor getContainingType() {
return this.containingType;
}
public List<EnumDescriptor> getEnumTypes() {
return Collections.unmodifiableList(Arrays.asList(this.enumTypes));
}
public List<FieldDescriptor> getExtensions() {
return Collections.unmodifiableList(Arrays.asList(this.extensions));
}
public List<FieldDescriptor> getFields() {
return Collections.unmodifiableList(Arrays.asList(this.fields));
}
@Override // com.google.protobuf.Descriptors.GenericDescriptor
public FileDescriptor getFile() {
return this.file;
}
@Override // com.google.protobuf.Descriptors.GenericDescriptor
public String getFullName() {
return this.fullName;
}
public int getIndex() {
return this.index;
}
@Override // com.google.protobuf.Descriptors.GenericDescriptor
public String getName() {
return this.proto.getName();
}
public List<Descriptor> getNestedTypes() {
return Collections.unmodifiableList(Arrays.asList(this.nestedTypes));
}
public List<OneofDescriptor> getOneofs() {
return Collections.unmodifiableList(Arrays.asList(this.oneofs));
}
public DescriptorProtos.MessageOptions getOptions() {
return this.proto.getOptions();
}
public boolean isExtendable() {
return this.proto.getExtensionRangeList().size() != 0;
}
public boolean isExtensionNumber(int i) {
for (DescriptorProtos.DescriptorProto.ExtensionRange extensionRange : this.proto.getExtensionRangeList()) {
if (extensionRange.getStart() <= i && i < extensionRange.getEnd()) {
return true;
}
}
return false;
}
public boolean isReservedName(String str) {
Internal.checkNotNull(str);
Iterator<String> it2 = this.proto.getReservedNameList().iterator();
while (it2.hasNext()) {
if (it2.next().equals(str)) {
return true;
}
}
return false;
}
public boolean isReservedNumber(int i) {
for (DescriptorProtos.DescriptorProto.ReservedRange reservedRange : this.proto.getReservedRangeList()) {
if (reservedRange.getStart() <= i && i < reservedRange.getEnd()) {
return true;
}
}
return false;
}
@Override // com.google.protobuf.Descriptors.GenericDescriptor
public DescriptorProtos.DescriptorProto toProto() {
return this.proto;
}
public Descriptor(String str) throws DescriptorValidationException {
String str2;
String str3;
int lastIndexOf = str.lastIndexOf(46);
if (lastIndexOf != -1) {
str3 = str.substring(lastIndexOf + 1);
str2 = str.substring(0, lastIndexOf);
} else {
str2 = "";
str3 = str;
}
this.index = 0;
this.proto = DescriptorProtos.DescriptorProto.newBuilder().setName(str3).addExtensionRange(DescriptorProtos.DescriptorProto.ExtensionRange.newBuilder().setStart(1).setEnd(536870912).build()).build();
this.fullName = str;
this.containingType = null;
this.nestedTypes = new Descriptor[0];
this.enumTypes = new EnumDescriptor[0];
this.fields = new FieldDescriptor[0];
this.extensions = new FieldDescriptor[0];
this.oneofs = new OneofDescriptor[0];
this.file = new FileDescriptor(str2, this);
}
public /* synthetic */ Descriptor(DescriptorProtos.DescriptorProto descriptorProto, FileDescriptor fileDescriptor, Descriptor descriptor, int i, AnonymousClass1 anonymousClass1) throws DescriptorValidationException {
this(descriptorProto, fileDescriptor, descriptor, i);
}
}
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
public static final class EnumDescriptor extends GenericDescriptor implements Internal.EnumLiteMap<EnumValueDescriptor> {
private final Descriptor containingType;
private final FileDescriptor file;
private final String fullName;
private final int index;
private DescriptorProtos.EnumDescriptorProto proto;
private final WeakHashMap<Integer, WeakReference<EnumValueDescriptor>> unknownValues;
private EnumValueDescriptor[] values;
private EnumDescriptor(DescriptorProtos.EnumDescriptorProto enumDescriptorProto, FileDescriptor fileDescriptor, Descriptor descriptor, int i) throws DescriptorValidationException {
this.unknownValues = new WeakHashMap<>();
this.index = i;
this.proto = enumDescriptorProto;
this.fullName = Descriptors.computeFullName(fileDescriptor, descriptor, enumDescriptorProto.getName());
this.file = fileDescriptor;
this.containingType = descriptor;
if (enumDescriptorProto.getValueCount() == 0) {
throw new DescriptorValidationException(this, "Enums must contain at least one value.", (AnonymousClass1) null);
}
this.values = new EnumValueDescriptor[enumDescriptorProto.getValueCount()];
for (int i2 = 0; i2 < enumDescriptorProto.getValueCount(); i2++) {
this.values[i2] = new EnumValueDescriptor(enumDescriptorProto.getValue(i2), fileDescriptor, this, i2, null);
}
fileDescriptor.pool.addSymbol(this);
}
/* JADX INFO: Access modifiers changed from: private */
public void setProto(DescriptorProtos.EnumDescriptorProto enumDescriptorProto) {
this.proto = enumDescriptorProto;
int i = 0;
while (true) {
EnumValueDescriptor[] enumValueDescriptorArr = this.values;
if (i >= enumValueDescriptorArr.length) {
return;
}
enumValueDescriptorArr[i].setProto(enumDescriptorProto.getValue(i));
i++;
}
}
public EnumValueDescriptor findValueByName(String str) {
GenericDescriptor findSymbol = this.file.pool.findSymbol(a$$ExternalSyntheticOutline0.m(new StringBuilder(), this.fullName, '.', str));
if (findSymbol == null || !(findSymbol instanceof EnumValueDescriptor)) {
return null;
}
return (EnumValueDescriptor) findSymbol;
}
/* JADX WARN: Can't rename method to resolve collision */
@Override // com.google.protobuf.Internal.EnumLiteMap
public EnumValueDescriptor findValueByNumber(int i) {
return (EnumValueDescriptor) this.file.pool.enumValuesByNumber.get(new DescriptorPool.DescriptorIntPair(this, i));
}
public EnumValueDescriptor findValueByNumberCreatingIfUnknown(int i) {
EnumValueDescriptor findValueByNumber = findValueByNumber(i);
if (findValueByNumber != null) {
return findValueByNumber;
}
synchronized (this) {
try {
Integer num = new Integer(i);
WeakReference<EnumValueDescriptor> weakReference = this.unknownValues.get(num);
if (weakReference != null) {
findValueByNumber = weakReference.get();
}
if (findValueByNumber == null) {
findValueByNumber = new EnumValueDescriptor(this.file, this, num, (AnonymousClass1) null);
this.unknownValues.put(num, new WeakReference<>(findValueByNumber));
}
} catch (Throwable th) {
throw th;
}
}
return findValueByNumber;
}
public Descriptor getContainingType() {
return this.containingType;
}
@Override // com.google.protobuf.Descriptors.GenericDescriptor
public FileDescriptor getFile() {
return this.file;
}
@Override // com.google.protobuf.Descriptors.GenericDescriptor
public String getFullName() {
return this.fullName;
}
public int getIndex() {
return this.index;
}
@Override // com.google.protobuf.Descriptors.GenericDescriptor
public String getName() {
return this.proto.getName();
}
public DescriptorProtos.EnumOptions getOptions() {
return this.proto.getOptions();
}
public int getUnknownEnumValueDescriptorCount() {
return this.unknownValues.size();
}
public List<EnumValueDescriptor> getValues() {
return Collections.unmodifiableList(Arrays.asList(this.values));
}
@Override // com.google.protobuf.Descriptors.GenericDescriptor
public DescriptorProtos.EnumDescriptorProto toProto() {
return this.proto;
}
public /* synthetic */ EnumDescriptor(DescriptorProtos.EnumDescriptorProto enumDescriptorProto, FileDescriptor fileDescriptor, Descriptor descriptor, int i, AnonymousClass1 anonymousClass1) throws DescriptorValidationException {
this(enumDescriptorProto, fileDescriptor, descriptor, i);
}
}
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
public static final class EnumValueDescriptor extends GenericDescriptor implements Internal.EnumLite {
private final FileDescriptor file;
private final String fullName;
private final int index;
private Integer number;
private DescriptorProtos.EnumValueDescriptorProto proto;
private final EnumDescriptor type;
private EnumValueDescriptor(FileDescriptor fileDescriptor, EnumDescriptor enumDescriptor, Integer num) {
DescriptorProtos.EnumValueDescriptorProto build = DescriptorProtos.EnumValueDescriptorProto.newBuilder().setName("UNKNOWN_ENUM_VALUE_" + enumDescriptor.getName() + "_" + num).setNumber(num.intValue()).build();
this.index = -1;
this.proto = build;
this.file = fileDescriptor;
this.type = enumDescriptor;
this.fullName = enumDescriptor.getFullName() + '.' + build.getName();
this.number = num;
}
/* JADX INFO: Access modifiers changed from: private */
public void setProto(DescriptorProtos.EnumValueDescriptorProto enumValueDescriptorProto) {
this.proto = enumValueDescriptorProto;
}
@Override // com.google.protobuf.Descriptors.GenericDescriptor
public FileDescriptor getFile() {
return this.file;
}
@Override // com.google.protobuf.Descriptors.GenericDescriptor
public String getFullName() {
return this.fullName;
}
public int getIndex() {
return this.index;
}
@Override // com.google.protobuf.Descriptors.GenericDescriptor
public String getName() {
return this.proto.getName();
}
@Override // com.google.protobuf.Internal.EnumLite
public int getNumber() {
return this.proto.getNumber();
}
public DescriptorProtos.EnumValueOptions getOptions() {
return this.proto.getOptions();
}
public EnumDescriptor getType() {
return this.type;
}
public String toString() {
return this.proto.getName();
}
@Override // com.google.protobuf.Descriptors.GenericDescriptor
public DescriptorProtos.EnumValueDescriptorProto toProto() {
return this.proto;
}
public /* synthetic */ EnumValueDescriptor(FileDescriptor fileDescriptor, EnumDescriptor enumDescriptor, Integer num, AnonymousClass1 anonymousClass1) {
this(fileDescriptor, enumDescriptor, num);
}
private EnumValueDescriptor(DescriptorProtos.EnumValueDescriptorProto enumValueDescriptorProto, FileDescriptor fileDescriptor, EnumDescriptor enumDescriptor, int i) throws DescriptorValidationException {
this.index = i;
this.proto = enumValueDescriptorProto;
this.file = fileDescriptor;
this.type = enumDescriptor;
this.fullName = enumDescriptor.getFullName() + '.' + enumValueDescriptorProto.getName();
fileDescriptor.pool.addSymbol(this);
fileDescriptor.pool.addEnumValueByNumber(this);
}
public /* synthetic */ EnumValueDescriptor(DescriptorProtos.EnumValueDescriptorProto enumValueDescriptorProto, FileDescriptor fileDescriptor, EnumDescriptor enumDescriptor, int i, AnonymousClass1 anonymousClass1) throws DescriptorValidationException {
this(enumValueDescriptorProto, fileDescriptor, enumDescriptor, i);
}
}
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
public static final class FieldDescriptor extends GenericDescriptor implements Comparable<FieldDescriptor>, FieldSet.FieldDescriptorLite<FieldDescriptor> {
private static final WireFormat.FieldType[] table = WireFormat.FieldType.values();
private OneofDescriptor containingOneof;
private Descriptor containingType;
private Object defaultValue;
private EnumDescriptor enumType;
private final Descriptor extensionScope;
private final FileDescriptor file;
private final String fullName;
private final int index;
private final String jsonName;
private Descriptor messageType;
private DescriptorProtos.FieldDescriptorProto proto;
private Type type;
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
public enum JavaType {
INT(0),
LONG(0L),
FLOAT(Float.valueOf(0.0f)),
DOUBLE(Double.valueOf(0.0d)),
BOOLEAN(Boolean.FALSE),
STRING(""),
BYTE_STRING(ByteString.EMPTY),
ENUM(null),
MESSAGE(null);
private final Object defaultDefault;
JavaType(Object obj) {
this.defaultDefault = obj;
}
}
static {
if (Type.values().length == DescriptorProtos.FieldDescriptorProto.Type.values().length) {
return;
}
Single$$ExternalSyntheticBUOutline0.m("descriptor.proto has a new declared type but Descriptors.java wasn't updated.");
}
private FieldDescriptor(DescriptorProtos.FieldDescriptorProto fieldDescriptorProto, FileDescriptor fileDescriptor, Descriptor descriptor, int i, boolean z) throws DescriptorValidationException {
this.index = i;
this.proto = fieldDescriptorProto;
this.fullName = Descriptors.computeFullName(fileDescriptor, descriptor, fieldDescriptorProto.getName());
this.file = fileDescriptor;
if (fieldDescriptorProto.hasJsonName()) {
this.jsonName = fieldDescriptorProto.getJsonName();
} else {
this.jsonName = fieldNameToJsonName(fieldDescriptorProto.getName());
}
if (fieldDescriptorProto.hasType()) {
this.type = Type.valueOf(fieldDescriptorProto.getType());
}
AnonymousClass1 anonymousClass1 = null;
if (getNumber() <= 0) {
throw new DescriptorValidationException(this, "Field numbers must be positive integers.", anonymousClass1);
}
if (z) {
if (!fieldDescriptorProto.hasExtendee()) {
throw new DescriptorValidationException(this, "FieldDescriptorProto.extendee not set for extension field.", anonymousClass1);
}
this.containingType = null;
if (descriptor != null) {
this.extensionScope = descriptor;
} else {
this.extensionScope = null;
}
if (fieldDescriptorProto.hasOneofIndex()) {
throw new DescriptorValidationException(this, "FieldDescriptorProto.oneof_index set for extension field.", anonymousClass1);
}
this.containingOneof = null;
} else {
if (fieldDescriptorProto.hasExtendee()) {
throw new DescriptorValidationException(this, "FieldDescriptorProto.extendee set for non-extension field.", anonymousClass1);
}
this.containingType = descriptor;
if (!fieldDescriptorProto.hasOneofIndex()) {
this.containingOneof = null;
} else {
if (fieldDescriptorProto.getOneofIndex() < 0 || fieldDescriptorProto.getOneofIndex() >= descriptor.toProto().getOneofDeclCount()) {
throw new DescriptorValidationException(this, "FieldDescriptorProto.oneof_index is out of range for type " + descriptor.getName(), anonymousClass1);
}
OneofDescriptor oneofDescriptor = descriptor.getOneofs().get(fieldDescriptorProto.getOneofIndex());
this.containingOneof = oneofDescriptor;
OneofDescriptor.access$1908(oneofDescriptor);
}
this.extensionScope = null;
}
fileDescriptor.pool.addSymbol(this);
}
/* JADX INFO: Access modifiers changed from: private */
/* JADX WARN: Can't fix incorrect switch cases order, some code will duplicate */
public void crossLink() throws DescriptorValidationException {
AnonymousClass1 anonymousClass1 = null;
if (this.proto.hasExtendee()) {
GenericDescriptor lookupSymbol = this.file.pool.lookupSymbol(this.proto.getExtendee(), this, DescriptorPool.SearchFilter.TYPES_ONLY);
if (!(lookupSymbol instanceof Descriptor)) {
throw new DescriptorValidationException(this, DeviceConfigConstants.DOUBLE_QUOTE + this.proto.getExtendee() + "\" is not a message type.", anonymousClass1);
}
this.containingType = (Descriptor) lookupSymbol;
if (!getContainingType().isExtensionNumber(getNumber())) {
throw new DescriptorValidationException(this, DeviceConfigConstants.DOUBLE_QUOTE + getContainingType().getFullName() + "\" does not declare " + getNumber() + " as an extension number.", anonymousClass1);
}
}
if (this.proto.hasTypeName()) {
GenericDescriptor lookupSymbol2 = this.file.pool.lookupSymbol(this.proto.getTypeName(), this, DescriptorPool.SearchFilter.TYPES_ONLY);
if (!this.proto.hasType()) {
if (lookupSymbol2 instanceof Descriptor) {
this.type = Type.MESSAGE;
} else {
if (!(lookupSymbol2 instanceof EnumDescriptor)) {
throw new DescriptorValidationException(this, DeviceConfigConstants.DOUBLE_QUOTE + this.proto.getTypeName() + "\" is not a type.", anonymousClass1);
}
this.type = Type.ENUM;
}
}
if (getJavaType() == JavaType.MESSAGE) {
if (!(lookupSymbol2 instanceof Descriptor)) {
throw new DescriptorValidationException(this, DeviceConfigConstants.DOUBLE_QUOTE + this.proto.getTypeName() + "\" is not a message type.", anonymousClass1);
}
this.messageType = (Descriptor) lookupSymbol2;
if (this.proto.hasDefaultValue()) {
throw new DescriptorValidationException(this, "Messages can't have default values.", anonymousClass1);
}
} else {
if (getJavaType() != JavaType.ENUM) {
throw new DescriptorValidationException(this, "Field with primitive type has type_name.", anonymousClass1);
}
if (!(lookupSymbol2 instanceof EnumDescriptor)) {
throw new DescriptorValidationException(this, DeviceConfigConstants.DOUBLE_QUOTE + this.proto.getTypeName() + "\" is not an enum type.", anonymousClass1);
}
this.enumType = (EnumDescriptor) lookupSymbol2;
}
} else if (getJavaType() == JavaType.MESSAGE || getJavaType() == JavaType.ENUM) {
throw new DescriptorValidationException(this, "Field with message or enum type missing type_name.", anonymousClass1);
}
if (this.proto.getOptions().getPacked() && !isPackable()) {
throw new DescriptorValidationException(this, "[packed = true] can only be specified for repeated primitive fields.", anonymousClass1);
}
if (this.proto.hasDefaultValue()) {
if (isRepeated()) {
throw new DescriptorValidationException(this, "Repeated fields cannot have default values.", anonymousClass1);
}
try {
switch (AnonymousClass1.$SwitchMap$com$google$protobuf$Descriptors$FieldDescriptor$Type[getType().ordinal()]) {
case 1:
case 2:
case 3:
this.defaultValue = Integer.valueOf(TextFormat.parseInt32(this.proto.getDefaultValue()));
break;
case 4:
case 5:
this.defaultValue = Integer.valueOf(TextFormat.parseUInt32(this.proto.getDefaultValue()));
break;
case 6:
case 7:
case 8:
this.defaultValue = Long.valueOf(TextFormat.parseInt64(this.proto.getDefaultValue()));
break;
case 9:
case 10:
this.defaultValue = Long.valueOf(TextFormat.parseUInt64(this.proto.getDefaultValue()));
break;
case 11:
if (!this.proto.getDefaultValue().equals("inf")) {
if (!this.proto.getDefaultValue().equals("-inf")) {
if (!this.proto.getDefaultValue().equals("nan")) {
this.defaultValue = Float.valueOf(this.proto.getDefaultValue());
break;
} else {
this.defaultValue = Float.valueOf(Float.NaN);
break;
}
} else {
this.defaultValue = Float.valueOf(Float.NEGATIVE_INFINITY);
break;
}
} else {
this.defaultValue = Float.valueOf(Float.POSITIVE_INFINITY);
break;
}
case 12:
if (!this.proto.getDefaultValue().equals("inf")) {
if (!this.proto.getDefaultValue().equals("-inf")) {
if (!this.proto.getDefaultValue().equals("nan")) {
this.defaultValue = Double.valueOf(this.proto.getDefaultValue());
break;
} else {
this.defaultValue = Double.valueOf(Double.NaN);
break;
}
} else {
this.defaultValue = Double.valueOf(Double.NEGATIVE_INFINITY);
break;
}
} else {
this.defaultValue = Double.valueOf(Double.POSITIVE_INFINITY);
break;
}
case 13:
this.defaultValue = Boolean.valueOf(this.proto.getDefaultValue());
break;
case 14:
this.defaultValue = this.proto.getDefaultValue();
break;
case 15:
try {
this.defaultValue = TextFormat.unescapeBytes(this.proto.getDefaultValue());
break;
} catch (TextFormat.InvalidEscapeSequenceException e) {
throw new DescriptorValidationException(this, "Couldn't parse default value: " + e.getMessage(), e, anonymousClass1);
}
case 16:
EnumValueDescriptor findValueByName = this.enumType.findValueByName(this.proto.getDefaultValue());
this.defaultValue = findValueByName;
if (findValueByName == null) {
throw new DescriptorValidationException(this, "Unknown enum default value: \"" + this.proto.getDefaultValue() + '\"', anonymousClass1);
}
break;
case 17:
case 18:
throw new DescriptorValidationException(this, "Message type had default value.", anonymousClass1);
}
} catch (NumberFormatException e2) {
throw new DescriptorValidationException(this, "Could not parse default value: \"" + this.proto.getDefaultValue() + '\"', e2, anonymousClass1);
}
} else if (isRepeated()) {
this.defaultValue = Collections.EMPTY_LIST;
} else {
int i = AnonymousClass1.$SwitchMap$com$google$protobuf$Descriptors$FieldDescriptor$JavaType[getJavaType().ordinal()];
if (i == 1) {
this.defaultValue = this.enumType.getValues().get(0);
} else if (i != 2) {
this.defaultValue = getJavaType().defaultDefault;
} else {
this.defaultValue = null;
}
}
if (!isExtension()) {
this.file.pool.addFieldByNumber(this);
}
Descriptor descriptor = this.containingType;
if (descriptor == null || !descriptor.getOptions().getMessageSetWireFormat()) {
return;
}
if (!isExtension()) {
throw new DescriptorValidationException(this, "MessageSets cannot have fields, only extensions.", anonymousClass1);
}
if (!isOptional() || getType() != Type.MESSAGE) {
throw new DescriptorValidationException(this, "Extensions of MessageSets must be optional messages.", anonymousClass1);
}
}
private static String fieldNameToJsonName(String str) {
StringBuilder sb = new StringBuilder(str.length());
boolean z = false;
for (int i = 0; i < str.length(); i++) {
char charAt = str.charAt(i);
Character valueOf = Character.valueOf(charAt);
if (charAt == '_') {
z = true;
} else if (z) {
sb.append(Character.toUpperCase(charAt));
z = false;
} else {
sb.append(valueOf);
}
}
return sb.toString();
}
/* JADX INFO: Access modifiers changed from: private */
public void setProto(DescriptorProtos.FieldDescriptorProto fieldDescriptorProto) {
this.proto = fieldDescriptorProto;
}
@Override // java.lang.Comparable
public int compareTo(FieldDescriptor fieldDescriptor) {
if (fieldDescriptor.containingType == this.containingType) {
return getNumber() - fieldDescriptor.getNumber();
}
Single$$ExternalSyntheticBUOutline0.m$3("FieldDescriptors can only be compared to other FieldDescriptors for fields of the same message type.");
return 0;
}
public OneofDescriptor getContainingOneof() {
return this.containingOneof;
}
public Descriptor getContainingType() {
return this.containingType;
}
public Object getDefaultValue() {
if (getJavaType() != JavaType.MESSAGE) {
return this.defaultValue;
}
Buffer$$ExternalSyntheticBUOutline0.m$1("FieldDescriptor.getDefaultValue() called on an embedded message field.");
return null;
}
@Override // com.google.protobuf.FieldSet.FieldDescriptorLite
public EnumDescriptor getEnumType() {
if (getJavaType() == JavaType.ENUM) {
return this.enumType;
}
Buffer$$ExternalSyntheticBUOutline0.m$1("This field is not of enum type.");
return null;
}
public Descriptor getExtensionScope() {
if (isExtension()) {
return this.extensionScope;
}
Buffer$$ExternalSyntheticBUOutline0.m$1("This field is not an extension.");
return null;
}
@Override // com.google.protobuf.Descriptors.GenericDescriptor
public FileDescriptor getFile() {
return this.file;
}
@Override // com.google.protobuf.Descriptors.GenericDescriptor
public String getFullName() {
return this.fullName;
}
public int getIndex() {
return this.index;
}
public JavaType getJavaType() {
return this.type.getJavaType();
}
public String getJsonName() {
return this.jsonName;
}
@Override // com.google.protobuf.FieldSet.FieldDescriptorLite
public WireFormat.JavaType getLiteJavaType() {
return getLiteType().getJavaType();
}
@Override // com.google.protobuf.FieldSet.FieldDescriptorLite
public WireFormat.FieldType getLiteType() {
return table[this.type.ordinal()];
}
public Descriptor getMessageType() {
if (getJavaType() == JavaType.MESSAGE) {
return this.messageType;
}
Buffer$$ExternalSyntheticBUOutline0.m$1("This field is not of message type.");
return null;
}
@Override // com.google.protobuf.Descriptors.GenericDescriptor
public String getName() {
return this.proto.getName();
}
@Override // com.google.protobuf.FieldSet.FieldDescriptorLite
public int getNumber() {
return this.proto.getNumber();
}
public DescriptorProtos.FieldOptions getOptions() {
return this.proto.getOptions();
}
public Type getType() {
return this.type;
}
public boolean hasDefaultValue() {
return this.proto.hasDefaultValue();
}
@Override // com.google.protobuf.FieldSet.FieldDescriptorLite
public MessageLite.Builder internalMergeFrom(MessageLite.Builder builder, MessageLite messageLite) {
return ((Message.Builder) builder).mergeFrom((Message) messageLite);
}
public boolean isExtension() {
return this.proto.hasExtendee();
}
public boolean isMapField() {
return getType() == Type.MESSAGE && isRepeated() && getMessageType().getOptions().getMapEntry();
}
public boolean isOptional() {
return this.proto.getLabel() == DescriptorProtos.FieldDescriptorProto.Label.LABEL_OPTIONAL;
}
public boolean isPackable() {
return isRepeated() && getLiteType().isPackable();
}
@Override // com.google.protobuf.FieldSet.FieldDescriptorLite
public boolean isPacked() {
if (isPackable()) {
return getFile().getSyntax() == FileDescriptor.Syntax.PROTO2 ? getOptions().getPacked() : !getOptions().hasPacked() || getOptions().getPacked();
}
return false;
}
@Override // com.google.protobuf.FieldSet.FieldDescriptorLite
public boolean isRepeated() {
return this.proto.getLabel() == DescriptorProtos.FieldDescriptorProto.Label.LABEL_REPEATED;
}
public boolean isRequired() {
return this.proto.getLabel() == DescriptorProtos.FieldDescriptorProto.Label.LABEL_REQUIRED;
}
public boolean needsUtf8Check() {
if (this.type != Type.STRING) {
return false;
}
if (getContainingType().getOptions().getMapEntry() || getFile().getSyntax() == FileDescriptor.Syntax.PROTO3) {
return true;
}
return getFile().getOptions().getJavaStringCheckUtf8();
}
public String toString() {
return getFullName();
}
@Override // com.google.protobuf.Descriptors.GenericDescriptor
public DescriptorProtos.FieldDescriptorProto toProto() {
return this.proto;
}
/* JADX WARN: Enum visitor error
jadx.core.utils.exceptions.JadxRuntimeException: Init of enum field 'INT64' uses external variables
at jadx.core.dex.visitors.EnumVisitor.createEnumFieldByConstructor(EnumVisitor.java:451)
at jadx.core.dex.visitors.EnumVisitor.processEnumFieldByRegister(EnumVisitor.java:395)
at jadx.core.dex.visitors.EnumVisitor.extractEnumFieldsFromFilledArray(EnumVisitor.java:324)
at jadx.core.dex.visitors.EnumVisitor.extractEnumFieldsFromInsn(EnumVisitor.java:262)
at jadx.core.dex.visitors.EnumVisitor.convertToEnum(EnumVisitor.java:151)
at jadx.core.dex.visitors.EnumVisitor.visit(EnumVisitor.java:100)
*/
/* JADX WARN: Failed to restore enum class, 'enum' modifier and super class removed */
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
public static final class Type {
private static final /* synthetic */ Type[] $VALUES;
public static final Type BOOL;
public static final Type BYTES;
public static final Type DOUBLE;
public static final Type ENUM;
public static final Type FIXED32;
public static final Type FIXED64;
public static final Type FLOAT;
public static final Type GROUP;
public static final Type INT32;
public static final Type INT64;
public static final Type MESSAGE;
public static final Type SFIXED32;
public static final Type SFIXED64;
public static final Type SINT32;
public static final Type SINT64;
public static final Type STRING;
public static final Type UINT32;
public static final Type UINT64;
private JavaType javaType;
static {
Type type = new Type("DOUBLE", 0, JavaType.DOUBLE);
DOUBLE = type;
Type type2 = new Type("FLOAT", 1, JavaType.FLOAT);
FLOAT = type2;
JavaType javaType = JavaType.LONG;
Type type3 = new Type("INT64", 2, javaType);
INT64 = type3;
Type type4 = new Type("UINT64", 3, javaType);
UINT64 = type4;
JavaType javaType2 = JavaType.INT;
Type type5 = new Type("INT32", 4, javaType2);
INT32 = type5;
Type type6 = new Type("FIXED64", 5, javaType);
FIXED64 = type6;
Type type7 = new Type("FIXED32", 6, javaType2);
FIXED32 = type7;
Type type8 = new Type("BOOL", 7, JavaType.BOOLEAN);
BOOL = type8;
Type type9 = new Type("STRING", 8, JavaType.STRING);
STRING = type9;
JavaType javaType3 = JavaType.MESSAGE;
Type type10 = new Type("GROUP", 9, javaType3);
GROUP = type10;
Type type11 = new Type("MESSAGE", 10, javaType3);
MESSAGE = type11;
Type type12 = new Type("BYTES", 11, JavaType.BYTE_STRING);
BYTES = type12;
Type type13 = new Type("UINT32", 12, javaType2);
UINT32 = type13;
Type type14 = new Type("ENUM", 13, JavaType.ENUM);
ENUM = type14;
Type type15 = new Type("SFIXED32", 14, javaType2);
SFIXED32 = type15;
Type type16 = new Type("SFIXED64", 15, javaType);
SFIXED64 = type16;
Type type17 = new Type("SINT32", 16, javaType2);
SINT32 = type17;
Type type18 = new Type("SINT64", 17, javaType);
SINT64 = type18;
$VALUES = new Type[]{type, type2, type3, type4, type5, type6, type7, type8, type9, type10, type11, type12, type13, type14, type15, type16, type17, type18};
}
private Type(String str, int i, JavaType javaType) {
this.javaType = javaType;
}
public static Type valueOf(DescriptorProtos.FieldDescriptorProto.Type type) {
return values()[type.getNumber() - 1];
}
public static Type[] values() {
return (Type[]) $VALUES.clone();
}
public JavaType getJavaType() {
return this.javaType;
}
public DescriptorProtos.FieldDescriptorProto.Type toProto() {
return DescriptorProtos.FieldDescriptorProto.Type.forNumber(ordinal() + 1);
}
public static Type valueOf(String str) {
return (Type) java.lang.Enum.valueOf(Type.class, str);
}
}
public /* synthetic */ FieldDescriptor(DescriptorProtos.FieldDescriptorProto fieldDescriptorProto, FileDescriptor fileDescriptor, Descriptor descriptor, int i, boolean z, AnonymousClass1 anonymousClass1) throws DescriptorValidationException {
this(fieldDescriptorProto, fileDescriptor, descriptor, i, z);
}
}
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
public static final class FileDescriptor extends GenericDescriptor {
private final FileDescriptor[] dependencies;
private final EnumDescriptor[] enumTypes;
private final FieldDescriptor[] extensions;
private final Descriptor[] messageTypes;
private final DescriptorPool pool;
private DescriptorProtos.FileDescriptorProto proto;
private final FileDescriptor[] publicDependencies;
private final ServiceDescriptor[] services;
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
public interface InternalDescriptorAssigner {
ExtensionRegistry assignDescriptors(FileDescriptor fileDescriptor);
}
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
public enum Syntax {
UNKNOWN("unknown"),
PROTO2("proto2"),
PROTO3("proto3");
private final String name;
Syntax(String str) {
this.name = str;
}
}
private FileDescriptor(DescriptorProtos.FileDescriptorProto fileDescriptorProto, FileDescriptor[] fileDescriptorArr, DescriptorPool descriptorPool, boolean z) throws DescriptorValidationException {
AnonymousClass1 anonymousClass1;
this.pool = descriptorPool;
this.proto = fileDescriptorProto;
this.dependencies = (FileDescriptor[]) fileDescriptorArr.clone();
HashMap hashMap = new HashMap();
for (FileDescriptor fileDescriptor : fileDescriptorArr) {
hashMap.put(fileDescriptor.getName(), fileDescriptor);
}
ArrayList arrayList = new ArrayList();
int i = 0;
while (true) {
anonymousClass1 = null;
if (i >= fileDescriptorProto.getPublicDependencyCount()) {
FileDescriptor[] fileDescriptorArr2 = new FileDescriptor[arrayList.size()];
this.publicDependencies = fileDescriptorArr2;
arrayList.toArray(fileDescriptorArr2);
descriptorPool.addPackage(getPackage(), this);
this.messageTypes = new Descriptor[fileDescriptorProto.getMessageTypeCount()];
for (int i2 = 0; i2 < fileDescriptorProto.getMessageTypeCount(); i2++) {
this.messageTypes[i2] = new Descriptor(fileDescriptorProto.getMessageType(i2), this, null, i2, null);
}
this.enumTypes = new EnumDescriptor[fileDescriptorProto.getEnumTypeCount()];
for (int i3 = 0; i3 < fileDescriptorProto.getEnumTypeCount(); i3++) {
this.enumTypes[i3] = new EnumDescriptor(fileDescriptorProto.getEnumType(i3), this, null, i3, null);
}
this.services = new ServiceDescriptor[fileDescriptorProto.getServiceCount()];
for (int i4 = 0; i4 < fileDescriptorProto.getServiceCount(); i4++) {
this.services[i4] = new ServiceDescriptor(fileDescriptorProto.getService(i4), this, i4, anonymousClass1);
}
this.extensions = new FieldDescriptor[fileDescriptorProto.getExtensionCount()];
for (int i5 = 0; i5 < fileDescriptorProto.getExtensionCount(); i5++) {
this.extensions[i5] = new FieldDescriptor(fileDescriptorProto.getExtension(i5), this, null, i5, true, null);
}
return;
}
int publicDependency = fileDescriptorProto.getPublicDependency(i);
if (publicDependency < 0 || publicDependency >= fileDescriptorProto.getDependencyCount()) {
break;
}
String dependency = fileDescriptorProto.getDependency(publicDependency);
FileDescriptor fileDescriptor2 = (FileDescriptor) hashMap.get(dependency);
if (fileDescriptor2 != null) {
arrayList.add(fileDescriptor2);
} else if (!z) {
throw new DescriptorValidationException(this, a$$ExternalSyntheticOutline0.m("Invalid public dependency: ", dependency), anonymousClass1);
}
i++;
}
throw new DescriptorValidationException(this, "Invalid public dependency index.", anonymousClass1);
}
public static FileDescriptor buildFrom(DescriptorProtos.FileDescriptorProto fileDescriptorProto, FileDescriptor[] fileDescriptorArr, boolean z) throws DescriptorValidationException {
FileDescriptor fileDescriptor = new FileDescriptor(fileDescriptorProto, fileDescriptorArr, new DescriptorPool(fileDescriptorArr, z), z);
fileDescriptor.crossLink();
return fileDescriptor;
}
private void crossLink() throws DescriptorValidationException {
for (Descriptor descriptor : this.messageTypes) {
descriptor.crossLink();
}
for (ServiceDescriptor serviceDescriptor : this.services) {
serviceDescriptor.crossLink();
}
for (FieldDescriptor fieldDescriptor : this.extensions) {
fieldDescriptor.crossLink();
}
}
public static void internalBuildGeneratedFileFrom(String[] strArr, FileDescriptor[] fileDescriptorArr, InternalDescriptorAssigner internalDescriptorAssigner) {
StringBuilder sb = new StringBuilder();
for (String str : strArr) {
sb.append(str);
}
byte[] bytes = sb.toString().getBytes(Internal.ISO_8859_1);
try {
DescriptorProtos.FileDescriptorProto parseFrom = DescriptorProtos.FileDescriptorProto.parseFrom(bytes);
try {
FileDescriptor buildFrom = buildFrom(parseFrom, fileDescriptorArr, true);
ExtensionRegistry assignDescriptors = internalDescriptorAssigner.assignDescriptors(buildFrom);
if (assignDescriptors != null) {
try {
buildFrom.setProto(DescriptorProtos.FileDescriptorProto.parseFrom(bytes, assignDescriptors));
} catch (InvalidProtocolBufferException e) {
Single$$ExternalSyntheticBUOutline0.m("Failed to parse protocol buffer descriptor for generated code.", e);
}
}
} catch (DescriptorValidationException e2) {
throw new IllegalArgumentException("Invalid embedded descriptor for \"" + parseFrom.getName() + "\".", e2);
}
} catch (InvalidProtocolBufferException e3) {
Single$$ExternalSyntheticBUOutline0.m("Failed to parse protocol buffer descriptor for generated code.", e3);
}
}
public static void internalUpdateFileDescriptor(FileDescriptor fileDescriptor, ExtensionRegistry extensionRegistry) {
try {
fileDescriptor.setProto(DescriptorProtos.FileDescriptorProto.parseFrom(fileDescriptor.proto.toByteString(), extensionRegistry));
} catch (InvalidProtocolBufferException e) {
Single$$ExternalSyntheticBUOutline0.m("Failed to parse protocol buffer descriptor for generated code.", e);
}
}
private void setProto(DescriptorProtos.FileDescriptorProto fileDescriptorProto) {
this.proto = fileDescriptorProto;
int i = 0;
int i2 = 0;
while (true) {
Descriptor[] descriptorArr = this.messageTypes;
if (i2 >= descriptorArr.length) {
break;
}
descriptorArr[i2].setProto(fileDescriptorProto.getMessageType(i2));
i2++;
}
int i3 = 0;
while (true) {
EnumDescriptor[] enumDescriptorArr = this.enumTypes;
if (i3 >= enumDescriptorArr.length) {
break;
}
enumDescriptorArr[i3].setProto(fileDescriptorProto.getEnumType(i3));
i3++;
}
int i4 = 0;
while (true) {
ServiceDescriptor[] serviceDescriptorArr = this.services;
if (i4 >= serviceDescriptorArr.length) {
break;
}
serviceDescriptorArr[i4].setProto(fileDescriptorProto.getService(i4));
i4++;
}
while (true) {
FieldDescriptor[] fieldDescriptorArr = this.extensions;
if (i >= fieldDescriptorArr.length) {
return;
}
fieldDescriptorArr[i].setProto(fileDescriptorProto.getExtension(i));
i++;
}
}
public EnumDescriptor findEnumTypeByName(String str) {
if (str.indexOf(46) != -1) {
return null;
}
if (getPackage().length() > 0) {
str = getPackage() + '.' + str;
}
GenericDescriptor findSymbol = this.pool.findSymbol(str);
if (findSymbol != null && (findSymbol instanceof EnumDescriptor) && findSymbol.getFile() == this) {
return (EnumDescriptor) findSymbol;
}
return null;
}
public FieldDescriptor findExtensionByName(String str) {
if (str.indexOf(46) != -1) {
return null;
}
if (getPackage().length() > 0) {
str = getPackage() + '.' + str;
}
GenericDescriptor findSymbol = this.pool.findSymbol(str);
if (findSymbol != null && (findSymbol instanceof FieldDescriptor) && findSymbol.getFile() == this) {
return (FieldDescriptor) findSymbol;
}
return null;
}
public Descriptor findMessageTypeByName(String str) {
if (str.indexOf(46) != -1) {
return null;
}
if (getPackage().length() > 0) {
str = getPackage() + '.' + str;
}
GenericDescriptor findSymbol = this.pool.findSymbol(str);
if (findSymbol != null && (findSymbol instanceof Descriptor) && findSymbol.getFile() == this) {
return (Descriptor) findSymbol;
}
return null;
}
public ServiceDescriptor findServiceByName(String str) {
if (str.indexOf(46) != -1) {
return null;
}
if (getPackage().length() > 0) {
str = getPackage() + '.' + str;
}
GenericDescriptor findSymbol = this.pool.findSymbol(str);
if (findSymbol != null && (findSymbol instanceof ServiceDescriptor) && findSymbol.getFile() == this) {
return (ServiceDescriptor) findSymbol;
}
return null;
}
public List<FileDescriptor> getDependencies() {
return Collections.unmodifiableList(Arrays.asList(this.dependencies));
}
public List<EnumDescriptor> getEnumTypes() {
return Collections.unmodifiableList(Arrays.asList(this.enumTypes));
}
public List<FieldDescriptor> getExtensions() {
return Collections.unmodifiableList(Arrays.asList(this.extensions));
}
@Override // com.google.protobuf.Descriptors.GenericDescriptor
public String getFullName() {
return this.proto.getName();
}
public List<Descriptor> getMessageTypes() {
return Collections.unmodifiableList(Arrays.asList(this.messageTypes));
}
@Override // com.google.protobuf.Descriptors.GenericDescriptor
public String getName() {
return this.proto.getName();
}
public DescriptorProtos.FileOptions getOptions() {
return this.proto.getOptions();
}
public String getPackage() {
return this.proto.getPackage();
}
public List<FileDescriptor> getPublicDependencies() {
return Collections.unmodifiableList(Arrays.asList(this.publicDependencies));
}
public List<ServiceDescriptor> getServices() {
return Collections.unmodifiableList(Arrays.asList(this.services));
}
public Syntax getSyntax() {
Syntax syntax = Syntax.PROTO3;
return syntax.name.equals(this.proto.getSyntax()) ? syntax : Syntax.PROTO2;
}
public boolean supportsUnknownEnumValue() {
return getSyntax() == Syntax.PROTO3;
}
@Override // com.google.protobuf.Descriptors.GenericDescriptor
public DescriptorProtos.FileDescriptorProto toProto() {
return this.proto;
}
public static FileDescriptor buildFrom(DescriptorProtos.FileDescriptorProto fileDescriptorProto, FileDescriptor[] fileDescriptorArr) throws DescriptorValidationException {
return buildFrom(fileDescriptorProto, fileDescriptorArr, false);
}
@Override // com.google.protobuf.Descriptors.GenericDescriptor
public FileDescriptor getFile() {
return this;
}
public static void internalBuildGeneratedFileFrom(String[] strArr, Class<?> cls, String[] strArr2, String[] strArr3, InternalDescriptorAssigner internalDescriptorAssigner) {
ArrayList arrayList = new ArrayList();
for (int i = 0; i < strArr2.length; i++) {
try {
arrayList.add((FileDescriptor) cls.getClassLoader().loadClass(strArr2[i]).getField("descriptor").get(null));
} catch (Exception unused) {
Descriptors.logger.warning("Descriptors for \"" + strArr3[i] + "\" can not be found.");
}
}
FileDescriptor[] fileDescriptorArr = new FileDescriptor[arrayList.size()];
arrayList.toArray(fileDescriptorArr);
internalBuildGeneratedFileFrom(strArr, fileDescriptorArr, internalDescriptorAssigner);
}
public FileDescriptor(String str, Descriptor descriptor) throws DescriptorValidationException {
DescriptorPool descriptorPool = new DescriptorPool(new FileDescriptor[0], true);
this.pool = descriptorPool;
this.proto = DescriptorProtos.FileDescriptorProto.newBuilder().setName(descriptor.getFullName() + ".placeholder.proto").setPackage(str).addMessageType(descriptor.toProto()).build();
this.dependencies = new FileDescriptor[0];
this.publicDependencies = new FileDescriptor[0];
this.messageTypes = new Descriptor[]{descriptor};
this.enumTypes = new EnumDescriptor[0];
this.services = new ServiceDescriptor[0];
this.extensions = new FieldDescriptor[0];
descriptorPool.addPackage(str, this);
descriptorPool.addSymbol(descriptor);
}
}
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
public static final class MethodDescriptor extends GenericDescriptor {
private final FileDescriptor file;
private final String fullName;
private final int index;
private Descriptor inputType;
private Descriptor outputType;
private DescriptorProtos.MethodDescriptorProto proto;
private final ServiceDescriptor service;
private MethodDescriptor(DescriptorProtos.MethodDescriptorProto methodDescriptorProto, FileDescriptor fileDescriptor, ServiceDescriptor serviceDescriptor, int i) throws DescriptorValidationException {
this.index = i;
this.proto = methodDescriptorProto;
this.file = fileDescriptor;
this.service = serviceDescriptor;
this.fullName = serviceDescriptor.getFullName() + '.' + methodDescriptorProto.getName();
fileDescriptor.pool.addSymbol(this);
}
/* JADX INFO: Access modifiers changed from: private */
public void crossLink() throws DescriptorValidationException {
DescriptorPool descriptorPool = this.file.pool;
String inputType = this.proto.getInputType();
DescriptorPool.SearchFilter searchFilter = DescriptorPool.SearchFilter.TYPES_ONLY;
GenericDescriptor lookupSymbol = descriptorPool.lookupSymbol(inputType, this, searchFilter);
AnonymousClass1 anonymousClass1 = null;
if (!(lookupSymbol instanceof Descriptor)) {
throw new DescriptorValidationException(this, DeviceConfigConstants.DOUBLE_QUOTE + this.proto.getInputType() + "\" is not a message type.", anonymousClass1);
}
this.inputType = (Descriptor) lookupSymbol;
GenericDescriptor lookupSymbol2 = this.file.pool.lookupSymbol(this.proto.getOutputType(), this, searchFilter);
if (lookupSymbol2 instanceof Descriptor) {
this.outputType = (Descriptor) lookupSymbol2;
return;
}
throw new DescriptorValidationException(this, DeviceConfigConstants.DOUBLE_QUOTE + this.proto.getOutputType() + "\" is not a message type.", anonymousClass1);
}
/* JADX INFO: Access modifiers changed from: private */
public void setProto(DescriptorProtos.MethodDescriptorProto methodDescriptorProto) {
this.proto = methodDescriptorProto;
}
@Override // com.google.protobuf.Descriptors.GenericDescriptor
public FileDescriptor getFile() {
return this.file;
}
@Override // com.google.protobuf.Descriptors.GenericDescriptor
public String getFullName() {
return this.fullName;
}
public int getIndex() {
return this.index;
}
public Descriptor getInputType() {
return this.inputType;
}
@Override // com.google.protobuf.Descriptors.GenericDescriptor
public String getName() {
return this.proto.getName();
}
public DescriptorProtos.MethodOptions getOptions() {
return this.proto.getOptions();
}
public Descriptor getOutputType() {
return this.outputType;
}
public ServiceDescriptor getService() {
return this.service;
}
@Override // com.google.protobuf.Descriptors.GenericDescriptor
public DescriptorProtos.MethodDescriptorProto toProto() {
return this.proto;
}
public /* synthetic */ MethodDescriptor(DescriptorProtos.MethodDescriptorProto methodDescriptorProto, FileDescriptor fileDescriptor, ServiceDescriptor serviceDescriptor, int i, AnonymousClass1 anonymousClass1) throws DescriptorValidationException {
this(methodDescriptorProto, fileDescriptor, serviceDescriptor, i);
}
}
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
public static final class ServiceDescriptor extends GenericDescriptor {
private final FileDescriptor file;
private final String fullName;
private final int index;
private MethodDescriptor[] methods;
private DescriptorProtos.ServiceDescriptorProto proto;
private ServiceDescriptor(DescriptorProtos.ServiceDescriptorProto serviceDescriptorProto, FileDescriptor fileDescriptor, int i) throws DescriptorValidationException {
this.index = i;
this.proto = serviceDescriptorProto;
this.fullName = Descriptors.computeFullName(fileDescriptor, null, serviceDescriptorProto.getName());
this.file = fileDescriptor;
this.methods = new MethodDescriptor[serviceDescriptorProto.getMethodCount()];
for (int i2 = 0; i2 < serviceDescriptorProto.getMethodCount(); i2++) {
this.methods[i2] = new MethodDescriptor(serviceDescriptorProto.getMethod(i2), fileDescriptor, this, i2, null);
}
fileDescriptor.pool.addSymbol(this);
}
/* JADX INFO: Access modifiers changed from: private */
public void crossLink() throws DescriptorValidationException {
for (MethodDescriptor methodDescriptor : this.methods) {
methodDescriptor.crossLink();
}
}
/* JADX INFO: Access modifiers changed from: private */
public void setProto(DescriptorProtos.ServiceDescriptorProto serviceDescriptorProto) {
this.proto = serviceDescriptorProto;
int i = 0;
while (true) {
MethodDescriptor[] methodDescriptorArr = this.methods;
if (i >= methodDescriptorArr.length) {
return;
}
methodDescriptorArr[i].setProto(serviceDescriptorProto.getMethod(i));
i++;
}
}
public MethodDescriptor findMethodByName(String str) {
GenericDescriptor findSymbol = this.file.pool.findSymbol(a$$ExternalSyntheticOutline0.m(new StringBuilder(), this.fullName, '.', str));
if (findSymbol == null || !(findSymbol instanceof MethodDescriptor)) {
return null;
}
return (MethodDescriptor) findSymbol;
}
@Override // com.google.protobuf.Descriptors.GenericDescriptor
public FileDescriptor getFile() {
return this.file;
}
@Override // com.google.protobuf.Descriptors.GenericDescriptor
public String getFullName() {
return this.fullName;
}
public int getIndex() {
return this.index;
}
public List<MethodDescriptor> getMethods() {
return Collections.unmodifiableList(Arrays.asList(this.methods));
}
@Override // com.google.protobuf.Descriptors.GenericDescriptor
public String getName() {
return this.proto.getName();
}
public DescriptorProtos.ServiceOptions getOptions() {
return this.proto.getOptions();
}
@Override // com.google.protobuf.Descriptors.GenericDescriptor
public DescriptorProtos.ServiceDescriptorProto toProto() {
return this.proto;
}
public /* synthetic */ ServiceDescriptor(DescriptorProtos.ServiceDescriptorProto serviceDescriptorProto, FileDescriptor fileDescriptor, int i, AnonymousClass1 anonymousClass1) throws DescriptorValidationException {
this(serviceDescriptorProto, fileDescriptor, i);
}
}
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
public static final class OneofDescriptor {
private Descriptor containingType;
private int fieldCount;
private FieldDescriptor[] fields;
private final FileDescriptor file;
private final String fullName;
private final int index;
private DescriptorProtos.OneofDescriptorProto proto;
private OneofDescriptor(DescriptorProtos.OneofDescriptorProto oneofDescriptorProto, FileDescriptor fileDescriptor, Descriptor descriptor, int i) throws DescriptorValidationException {
this.proto = oneofDescriptorProto;
this.fullName = Descriptors.computeFullName(fileDescriptor, descriptor, oneofDescriptorProto.getName());
this.file = fileDescriptor;
this.index = i;
this.containingType = descriptor;
this.fieldCount = 0;
}
public static /* synthetic */ int access$1908(OneofDescriptor oneofDescriptor) {
int i = oneofDescriptor.fieldCount;
oneofDescriptor.fieldCount = i + 1;
return i;
}
/* JADX INFO: Access modifiers changed from: private */
public void setProto(DescriptorProtos.OneofDescriptorProto oneofDescriptorProto) {
this.proto = oneofDescriptorProto;
}
public Descriptor getContainingType() {
return this.containingType;
}
public FieldDescriptor getField(int i) {
return this.fields[i];
}
public int getFieldCount() {
return this.fieldCount;
}
public List<FieldDescriptor> getFields() {
return Collections.unmodifiableList(Arrays.asList(this.fields));
}
public FileDescriptor getFile() {
return this.file;
}
public String getFullName() {
return this.fullName;
}
public int getIndex() {
return this.index;
}
public String getName() {
return this.proto.getName();
}
public DescriptorProtos.OneofOptions getOptions() {
return this.proto.getOptions();
}
public /* synthetic */ OneofDescriptor(DescriptorProtos.OneofDescriptorProto oneofDescriptorProto, FileDescriptor fileDescriptor, Descriptor descriptor, int i, AnonymousClass1 anonymousClass1) throws DescriptorValidationException {
this(oneofDescriptorProto, fileDescriptor, descriptor, i);
}
}
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
public static class DescriptorValidationException extends Exception {
private static final long serialVersionUID = 5750205775490483148L;
private final String description;
private final String name;
private final Message proto;
private DescriptorValidationException(GenericDescriptor genericDescriptor, String str) {
super(genericDescriptor.getFullName() + ": " + str);
this.name = genericDescriptor.getFullName();
this.proto = genericDescriptor.toProto();
this.description = str;
}
public String getDescription() {
return this.description;
}
public Message getProblemProto() {
return this.proto;
}
public String getProblemSymbolName() {
return this.name;
}
public /* synthetic */ DescriptorValidationException(GenericDescriptor genericDescriptor, String str, AnonymousClass1 anonymousClass1) {
this(genericDescriptor, str);
}
public /* synthetic */ DescriptorValidationException(GenericDescriptor genericDescriptor, String str, Throwable th, AnonymousClass1 anonymousClass1) {
this(genericDescriptor, str, th);
}
public /* synthetic */ DescriptorValidationException(FileDescriptor fileDescriptor, String str, AnonymousClass1 anonymousClass1) {
this(fileDescriptor, str);
}
private DescriptorValidationException(GenericDescriptor genericDescriptor, String str, Throwable th) {
this(genericDescriptor, str);
initCause(th);
}
private DescriptorValidationException(FileDescriptor fileDescriptor, String str) {
super(fileDescriptor.getName() + ": " + str);
this.name = fileDescriptor.getName();
this.proto = fileDescriptor.toProto();
this.description = str;
}
}
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
public static final class DescriptorPool {
private boolean allowUnknownDependencies;
private final Map<String, GenericDescriptor> descriptorsByName = new HashMap();
private final Map<DescriptorIntPair, FieldDescriptor> fieldsByNumber = new HashMap();
private final Map<DescriptorIntPair, EnumValueDescriptor> enumValuesByNumber = new HashMap();
private final Set<FileDescriptor> dependencies = new HashSet();
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
public static final class DescriptorIntPair {
private final GenericDescriptor descriptor;
private final int number;
public DescriptorIntPair(GenericDescriptor genericDescriptor, int i) {
this.descriptor = genericDescriptor;
this.number = i;
}
public boolean equals(Object obj) {
if (!(obj instanceof DescriptorIntPair)) {
return false;
}
DescriptorIntPair descriptorIntPair = (DescriptorIntPair) obj;
return this.descriptor == descriptorIntPair.descriptor && this.number == descriptorIntPair.number;
}
public int hashCode() {
return (this.descriptor.hashCode() * 65535) + this.number;
}
}
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
public static final class PackageDescriptor extends GenericDescriptor {
private final FileDescriptor file;
private final String fullName;
private final String name;
public PackageDescriptor(String str, String str2, FileDescriptor fileDescriptor) {
this.file = fileDescriptor;
this.fullName = str2;
this.name = str;
}
@Override // com.google.protobuf.Descriptors.GenericDescriptor
public FileDescriptor getFile() {
return this.file;
}
@Override // com.google.protobuf.Descriptors.GenericDescriptor
public String getFullName() {
return this.fullName;
}
@Override // com.google.protobuf.Descriptors.GenericDescriptor
public String getName() {
return this.name;
}
@Override // com.google.protobuf.Descriptors.GenericDescriptor
public Message toProto() {
return this.file.toProto();
}
}
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
public enum SearchFilter {
TYPES_ONLY,
AGGREGATES_ONLY,
ALL_SYMBOLS
}
public DescriptorPool(FileDescriptor[] fileDescriptorArr, boolean z) {
Set<FileDescriptor> set;
this.allowUnknownDependencies = z;
int i = 0;
while (true) {
int length = fileDescriptorArr.length;
set = this.dependencies;
if (i >= length) {
break;
}
set.add(fileDescriptorArr[i]);
importPublicDependencies(fileDescriptorArr[i]);
i++;
}
for (FileDescriptor fileDescriptor : set) {
try {
addPackage(fileDescriptor.getPackage(), fileDescriptor);
} catch (DescriptorValidationException e) {
Buffer$$ExternalSyntheticBUOutline0.m((Object) e);
throw null;
}
}
}
private void importPublicDependencies(FileDescriptor fileDescriptor) {
for (FileDescriptor fileDescriptor2 : fileDescriptor.getPublicDependencies()) {
if (this.dependencies.add(fileDescriptor2)) {
importPublicDependencies(fileDescriptor2);
}
}
}
public static void validateSymbolName(GenericDescriptor genericDescriptor) throws DescriptorValidationException {
String name = genericDescriptor.getName();
AnonymousClass1 anonymousClass1 = null;
if (name.length() == 0) {
throw new DescriptorValidationException(genericDescriptor, "Missing name.", anonymousClass1);
}
boolean z = true;
for (int i = 0; i < name.length(); i++) {
char charAt = name.charAt(i);
if (charAt >= 128) {
z = false;
}
if (!Character.isLetter(charAt) && charAt != '_' && (!Character.isDigit(charAt) || i <= 0)) {
z = false;
}
}
if (!z) {
throw new DescriptorValidationException(genericDescriptor, a$$ExternalSyntheticOutline0.m(DeviceConfigConstants.DOUBLE_QUOTE, name, "\" is not a valid identifier."), anonymousClass1);
}
}
public void addEnumValueByNumber(EnumValueDescriptor enumValueDescriptor) {
DescriptorIntPair descriptorIntPair = new DescriptorIntPair(enumValueDescriptor.getType(), enumValueDescriptor.getNumber());
EnumValueDescriptor put = this.enumValuesByNumber.put(descriptorIntPair, enumValueDescriptor);
if (put != null) {
this.enumValuesByNumber.put(descriptorIntPair, put);
}
}
public void addFieldByNumber(FieldDescriptor fieldDescriptor) throws DescriptorValidationException {
DescriptorIntPair descriptorIntPair = new DescriptorIntPair(fieldDescriptor.getContainingType(), fieldDescriptor.getNumber());
FieldDescriptor put = this.fieldsByNumber.put(descriptorIntPair, fieldDescriptor);
if (put == null) {
return;
}
this.fieldsByNumber.put(descriptorIntPair, put);
throw new DescriptorValidationException(fieldDescriptor, "Field number " + fieldDescriptor.getNumber() + " has already been used in \"" + fieldDescriptor.getContainingType().getFullName() + "\" by field \"" + put.getName() + "\".", (AnonymousClass1) null);
}
public void addPackage(String str, FileDescriptor fileDescriptor) throws DescriptorValidationException {
String substring;
int lastIndexOf = str.lastIndexOf(46);
if (lastIndexOf == -1) {
substring = str;
} else {
addPackage(str.substring(0, lastIndexOf), fileDescriptor);
substring = str.substring(lastIndexOf + 1);
}
GenericDescriptor put = this.descriptorsByName.put(str, new PackageDescriptor(substring, str, fileDescriptor));
if (put != null) {
this.descriptorsByName.put(str, put);
if (put instanceof PackageDescriptor) {
return;
}
StringBuilder m2m = a$$ExternalSyntheticOutline0.m2m(DeviceConfigConstants.DOUBLE_QUOTE, substring, "\" is already defined (as something other than a package) in file \"");
m2m.append(put.getFile().getName());
m2m.append("\".");
throw new DescriptorValidationException(fileDescriptor, m2m.toString(), (AnonymousClass1) null);
}
}
public void addSymbol(GenericDescriptor genericDescriptor) throws DescriptorValidationException {
validateSymbolName(genericDescriptor);
String fullName = genericDescriptor.getFullName();
int lastIndexOf = fullName.lastIndexOf(46);
GenericDescriptor put = this.descriptorsByName.put(fullName, genericDescriptor);
if (put != null) {
this.descriptorsByName.put(fullName, put);
AnonymousClass1 anonymousClass1 = null;
if (genericDescriptor.getFile() != put.getFile()) {
StringBuilder m2m = a$$ExternalSyntheticOutline0.m2m(DeviceConfigConstants.DOUBLE_QUOTE, fullName, "\" is already defined in file \"");
m2m.append(put.getFile().getName());
m2m.append("\".");
throw new DescriptorValidationException(genericDescriptor, m2m.toString(), anonymousClass1);
}
if (lastIndexOf == -1) {
throw new DescriptorValidationException(genericDescriptor, a$$ExternalSyntheticOutline0.m(DeviceConfigConstants.DOUBLE_QUOTE, fullName, "\" is already defined."), anonymousClass1);
}
throw new DescriptorValidationException(genericDescriptor, DeviceConfigConstants.DOUBLE_QUOTE + fullName.substring(lastIndexOf + 1) + "\" is already defined in \"" + fullName.substring(0, lastIndexOf) + "\".", anonymousClass1);
}
}
public GenericDescriptor findSymbol(String str, SearchFilter searchFilter) {
GenericDescriptor genericDescriptor = this.descriptorsByName.get(str);
if (genericDescriptor != null && (searchFilter == SearchFilter.ALL_SYMBOLS || ((searchFilter == SearchFilter.TYPES_ONLY && isType(genericDescriptor)) || (searchFilter == SearchFilter.AGGREGATES_ONLY && isAggregate(genericDescriptor))))) {
return genericDescriptor;
}
Iterator<FileDescriptor> it2 = this.dependencies.iterator();
while (it2.hasNext()) {
GenericDescriptor genericDescriptor2 = it2.next().pool.descriptorsByName.get(str);
if (genericDescriptor2 != null && (searchFilter == SearchFilter.ALL_SYMBOLS || ((searchFilter == SearchFilter.TYPES_ONLY && isType(genericDescriptor2)) || (searchFilter == SearchFilter.AGGREGATES_ONLY && isAggregate(genericDescriptor2))))) {
return genericDescriptor2;
}
}
return null;
}
public boolean isAggregate(GenericDescriptor genericDescriptor) {
return (genericDescriptor instanceof Descriptor) || (genericDescriptor instanceof EnumDescriptor) || (genericDescriptor instanceof PackageDescriptor) || (genericDescriptor instanceof ServiceDescriptor);
}
public boolean isType(GenericDescriptor genericDescriptor) {
return (genericDescriptor instanceof Descriptor) || (genericDescriptor instanceof EnumDescriptor);
}
public GenericDescriptor lookupSymbol(String str, GenericDescriptor genericDescriptor, SearchFilter searchFilter) throws DescriptorValidationException {
GenericDescriptor findSymbol;
String str2;
if (str.startsWith(".")) {
str2 = str.substring(1);
findSymbol = findSymbol(str2, searchFilter);
} else {
int indexOf = str.indexOf(46);
String substring = indexOf == -1 ? str : str.substring(0, indexOf);
StringBuilder sb = new StringBuilder(genericDescriptor.getFullName());
while (true) {
int lastIndexOf = sb.lastIndexOf(".");
if (lastIndexOf == -1) {
findSymbol = findSymbol(str, searchFilter);
str2 = str;
break;
}
int i = lastIndexOf + 1;
sb.setLength(i);
sb.append(substring);
GenericDescriptor findSymbol2 = findSymbol(sb.toString(), SearchFilter.AGGREGATES_ONLY);
if (findSymbol2 != null) {
if (indexOf != -1) {
sb.setLength(i);
sb.append(str);
findSymbol = findSymbol(sb.toString(), searchFilter);
} else {
findSymbol = findSymbol2;
}
str2 = sb.toString();
} else {
sb.setLength(lastIndexOf);
}
}
}
if (findSymbol != null) {
return findSymbol;
}
if (!this.allowUnknownDependencies || searchFilter != SearchFilter.TYPES_ONLY) {
throw new DescriptorValidationException(genericDescriptor, a$$ExternalSyntheticOutline0.m(DeviceConfigConstants.DOUBLE_QUOTE, str, "\" is not defined."), (AnonymousClass1) null);
}
Descriptors.logger.warning("The descriptor for message type \"" + str + "\" can not be found and a placeholder is created for it");
Descriptor descriptor = new Descriptor(str2);
this.dependencies.add(descriptor.getFile());
return descriptor;
}
public GenericDescriptor findSymbol(String str) {
return findSymbol(str, SearchFilter.ALL_SYMBOLS);
}
}
}