package com.google.protobuf; import com.google.protobuf.AbstractMessageLite; import com.google.protobuf.ArrayDecoders; import com.google.protobuf.FieldSet; import com.google.protobuf.GeneratedMessageLite; import com.google.protobuf.GeneratedMessageLite.Builder; import com.google.protobuf.Internal; import com.google.protobuf.MessageLite; import com.google.protobuf.WireFormat; import java.io.IOException; import java.io.InputStream; import java.io.ObjectStreamException; import java.io.Serializable; import java.lang.reflect.InvocationTargetException; import java.nio.ByteBuffer; import java.util.ArrayList; import java.util.Collections; import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; /* loaded from: classes3.dex */ public abstract class GeneratedMessageLite, BuilderType extends Builder> extends AbstractMessageLite { private static final int MEMOIZED_SERIALIZED_SIZE_MASK = Integer.MAX_VALUE; private static final int MUTABLE_FLAG_MASK = Integer.MIN_VALUE; static final int UNINITIALIZED_HASH_CODE = 0; static final int UNINITIALIZED_SERIALIZED_SIZE = Integer.MAX_VALUE; private static Map> defaultInstanceMap = new ConcurrentHashMap(); private int memoizedSerializedSize = -1; protected UnknownFieldSetLite unknownFields = UnknownFieldSetLite.getDefaultInstance(); public interface ExtendableMessageOrBuilder, BuilderType extends ExtendableBuilder> extends MessageLiteOrBuilder { Type getExtension(ExtensionLite extensionLite); Type getExtension(ExtensionLite> extensionLite, int i); int getExtensionCount(ExtensionLite> extensionLite); boolean hasExtension(ExtensionLite extensionLite); } public enum MethodToInvoke { GET_MEMOIZED_IS_INITIALIZED, SET_MEMOIZED_IS_INITIALIZED, BUILD_MESSAGE_INFO, NEW_MUTABLE_INSTANCE, NEW_BUILDER, GET_DEFAULT_INSTANCE, GET_PARSER } public void clearMemoizedHashCode() { this.memoizedHashCode = 0; } public abstract Object dynamicMethod(MethodToInvoke methodToInvoke, Object obj, Object obj2); public int getMemoizedHashCode() { return this.memoizedHashCode; } @Override // com.google.protobuf.AbstractMessageLite public int getMemoizedSerializedSize() { return this.memoizedSerializedSize & Integer.MAX_VALUE; } public boolean isMutable() { return (this.memoizedSerializedSize & Integer.MIN_VALUE) != 0; } public void markImmutable() { this.memoizedSerializedSize &= Integer.MAX_VALUE; } public void setMemoizedHashCode(int i) { this.memoizedHashCode = i; } public boolean hashCodeIsNotMemoized() { return getMemoizedHashCode() == 0; } @Override // com.google.protobuf.MessageLite public final Parser getParserForType() { return (Parser) dynamicMethod(MethodToInvoke.GET_PARSER); } @Override // com.google.protobuf.MessageLiteOrBuilder public final MessageType getDefaultInstanceForType() { return (MessageType) dynamicMethod(MethodToInvoke.GET_DEFAULT_INSTANCE); } @Override // com.google.protobuf.MessageLite public final BuilderType newBuilderForType() { return (BuilderType) dynamicMethod(MethodToInvoke.NEW_BUILDER); } public MessageType newMutableInstance() { return (MessageType) dynamicMethod(MethodToInvoke.NEW_MUTABLE_INSTANCE); } public String toString() { return MessageLiteToString.toString(this, super.toString()); } public int hashCode() { if (isMutable()) { return computeHashCode(); } if (hashCodeIsNotMemoized()) { setMemoizedHashCode(computeHashCode()); } return getMemoizedHashCode(); } public int computeHashCode() { return Protobuf.getInstance().schemaFor((Protobuf) this).hashCode(this); } public boolean equals(Object obj) { if (this == obj) { return true; } if (obj != null && getClass() == obj.getClass()) { return Protobuf.getInstance().schemaFor((Protobuf) this).equals(this, (GeneratedMessageLite) obj); } return false; } private final void ensureUnknownFieldsInitialized() { if (this.unknownFields == UnknownFieldSetLite.getDefaultInstance()) { this.unknownFields = UnknownFieldSetLite.newInstance(); } } public boolean parseUnknownField(int i, CodedInputStream codedInputStream) throws IOException { if (WireFormat.getTagWireType(i) == 4) { return false; } ensureUnknownFieldsInitialized(); return this.unknownFields.mergeFieldFrom(i, codedInputStream); } public void mergeVarintField(int i, int i2) { ensureUnknownFieldsInitialized(); this.unknownFields.mergeVarintField(i, i2); } public void mergeLengthDelimitedField(int i, ByteString byteString) { ensureUnknownFieldsInitialized(); this.unknownFields.mergeLengthDelimitedField(i, byteString); } public void makeImmutable() { Protobuf.getInstance().schemaFor((Protobuf) this).makeImmutable(this); markImmutable(); } public final , BuilderType extends Builder> BuilderType createBuilder() { return (BuilderType) dynamicMethod(MethodToInvoke.NEW_BUILDER); } public final , BuilderType extends Builder> BuilderType createBuilder(MessageType messagetype) { return (BuilderType) createBuilder().mergeFrom(messagetype); } @Override // com.google.protobuf.MessageLiteOrBuilder public final boolean isInitialized() { return isInitialized(this, true); } @Override // com.google.protobuf.MessageLite public final BuilderType toBuilder() { return (BuilderType) ((Builder) dynamicMethod(MethodToInvoke.NEW_BUILDER)).mergeFrom((Builder) this); } public Object dynamicMethod(MethodToInvoke methodToInvoke, Object obj) { return dynamicMethod(methodToInvoke, obj, null); } public Object dynamicMethod(MethodToInvoke methodToInvoke) { return dynamicMethod(methodToInvoke, null, null); } public void clearMemoizedSerializedSize() { setMemoizedSerializedSize(Integer.MAX_VALUE); } @Override // com.google.protobuf.AbstractMessageLite public void setMemoizedSerializedSize(int i) { if (i >= 0) { this.memoizedSerializedSize = (i & Integer.MAX_VALUE) | (this.memoizedSerializedSize & Integer.MIN_VALUE); } else { throw new IllegalStateException("serialized size must be non-negative, was " + i); } } @Override // com.google.protobuf.MessageLite public void writeTo(CodedOutputStream codedOutputStream) throws IOException { Protobuf.getInstance().schemaFor((Protobuf) this).writeTo(this, CodedOutputStreamWriter.forCodedOutput(codedOutputStream)); } @Override // com.google.protobuf.AbstractMessageLite public int getSerializedSize(Schema schema) { if (isMutable()) { int computeSerializedSize = computeSerializedSize(schema); if (computeSerializedSize >= 0) { return computeSerializedSize; } throw new IllegalStateException("serialized size must be non-negative, was " + computeSerializedSize); } if (getMemoizedSerializedSize() != Integer.MAX_VALUE) { return getMemoizedSerializedSize(); } int computeSerializedSize2 = computeSerializedSize(schema); setMemoizedSerializedSize(computeSerializedSize2); return computeSerializedSize2; } @Override // com.google.protobuf.MessageLite public int getSerializedSize() { return getSerializedSize(null); } private int computeSerializedSize(Schema schema) { if (schema == null) { return Protobuf.getInstance().schemaFor((Protobuf) this).getSerializedSize(this); } return schema.getSerializedSize(this); } public Object buildMessageInfo() throws Exception { return dynamicMethod(MethodToInvoke.BUILD_MESSAGE_INFO); } public static > T getDefaultInstance(Class cls) { GeneratedMessageLite generatedMessageLite = defaultInstanceMap.get(cls); if (generatedMessageLite == null) { try { Class.forName(cls.getName(), true, cls.getClassLoader()); generatedMessageLite = defaultInstanceMap.get(cls); } catch (ClassNotFoundException e) { throw new IllegalStateException("Class initialization cannot fail.", e); } } if (generatedMessageLite == null) { generatedMessageLite = (T) ((GeneratedMessageLite) UnsafeUtil.allocateInstance(cls)).getDefaultInstanceForType(); if (generatedMessageLite == null) { throw new IllegalStateException(); } defaultInstanceMap.put(cls, generatedMessageLite); } return (T) generatedMessageLite; } public static > void registerDefaultInstance(Class cls, T t) { t.markImmutable(); defaultInstanceMap.put(cls, t); } public static Object newMessageInfo(MessageLite messageLite, String str, Object[] objArr) { return new RawMessageInfo(messageLite, str, objArr); } public final void mergeUnknownFields(UnknownFieldSetLite unknownFieldSetLite) { this.unknownFields = UnknownFieldSetLite.mutableCopyOf(this.unknownFields, unknownFieldSetLite); } public static abstract class Builder, BuilderType extends Builder> extends AbstractMessageLite.Builder { private final MessageType defaultInstance; protected MessageType instance; @Override // com.google.protobuf.MessageLiteOrBuilder public MessageType getDefaultInstanceForType() { return this.defaultInstance; } public Builder(MessageType messagetype) { this.defaultInstance = messagetype; if (messagetype.isMutable()) { throw new IllegalArgumentException("Default instance must be immutable."); } this.instance = newMutableInstance(); } private MessageType newMutableInstance() { return (MessageType) this.defaultInstance.newMutableInstance(); } public final void copyOnWrite() { if (this.instance.isMutable()) { return; } copyOnWriteInternal(); } public void copyOnWriteInternal() { MessageType newMutableInstance = newMutableInstance(); mergeFromInstance(newMutableInstance, this.instance); this.instance = newMutableInstance; } @Override // com.google.protobuf.MessageLiteOrBuilder public final boolean isInitialized() { return GeneratedMessageLite.isInitialized(this.instance, false); } @Override // com.google.protobuf.MessageLite.Builder public final BuilderType clear() { if (this.defaultInstance.isMutable()) { throw new IllegalArgumentException("Default instance must be immutable."); } this.instance = newMutableInstance(); return this; } @Override // com.google.protobuf.AbstractMessageLite.Builder /* renamed from: clone, reason: merged with bridge method [inline-methods] */ public BuilderType mo856clone() { BuilderType buildertype = (BuilderType) getDefaultInstanceForType().newBuilderForType(); buildertype.instance = buildPartial(); return buildertype; } @Override // com.google.protobuf.MessageLite.Builder public MessageType buildPartial() { if (!this.instance.isMutable()) { return this.instance; } this.instance.makeImmutable(); return this.instance; } @Override // com.google.protobuf.MessageLite.Builder public final MessageType build() { MessageType buildPartial = buildPartial(); if (buildPartial.isInitialized()) { return buildPartial; } throw AbstractMessageLite.Builder.newUninitializedMessageException(buildPartial); } @Override // com.google.protobuf.AbstractMessageLite.Builder public BuilderType internalMergeFrom(MessageType messagetype) { return mergeFrom((Builder) messagetype); } public BuilderType mergeFrom(MessageType messagetype) { if (getDefaultInstanceForType().equals(messagetype)) { return this; } copyOnWrite(); mergeFromInstance(this.instance, messagetype); return this; } private static void mergeFromInstance(MessageType messagetype, MessageType messagetype2) { Protobuf.getInstance().schemaFor((Protobuf) messagetype).mergeFrom(messagetype, messagetype2); } @Override // com.google.protobuf.AbstractMessageLite.Builder, com.google.protobuf.MessageLite.Builder public BuilderType mergeFrom(byte[] bArr, int i, int i2, ExtensionRegistryLite extensionRegistryLite) throws InvalidProtocolBufferException { copyOnWrite(); try { Protobuf.getInstance().schemaFor((Protobuf) this.instance).mergeFrom(this.instance, bArr, i, i + i2, new ArrayDecoders.Registers(extensionRegistryLite)); return this; } catch (InvalidProtocolBufferException e) { throw e; } catch (IOException e2) { throw new RuntimeException("Reading from byte array should not throw IOException.", e2); } catch (IndexOutOfBoundsException unused) { throw InvalidProtocolBufferException.truncatedMessage(); } } @Override // com.google.protobuf.AbstractMessageLite.Builder, com.google.protobuf.MessageLite.Builder public BuilderType mergeFrom(byte[] bArr, int i, int i2) throws InvalidProtocolBufferException { return mergeFrom(bArr, i, i2, ExtensionRegistryLite.getEmptyRegistry()); } @Override // com.google.protobuf.AbstractMessageLite.Builder, com.google.protobuf.MessageLite.Builder public BuilderType mergeFrom(CodedInputStream codedInputStream, ExtensionRegistryLite extensionRegistryLite) throws IOException { copyOnWrite(); try { Protobuf.getInstance().schemaFor((Protobuf) this.instance).mergeFrom(this.instance, CodedInputStreamReader.forCodedInput(codedInputStream), extensionRegistryLite); return this; } catch (RuntimeException e) { if (e.getCause() instanceof IOException) { throw ((IOException) e.getCause()); } throw e; } } } public static abstract class ExtendableMessage, BuilderType extends ExtendableBuilder> extends GeneratedMessageLite implements ExtendableMessageOrBuilder { protected FieldSet extensions = FieldSet.emptySet(); @Override // com.google.protobuf.GeneratedMessageLite, com.google.protobuf.MessageLiteOrBuilder public /* bridge */ /* synthetic */ MessageLite getDefaultInstanceForType() { return super.getDefaultInstanceForType(); } @Override // com.google.protobuf.GeneratedMessageLite, com.google.protobuf.MessageLite public /* bridge */ /* synthetic */ MessageLite.Builder newBuilderForType() { return super.newBuilderForType(); } @Override // com.google.protobuf.GeneratedMessageLite, com.google.protobuf.MessageLite public /* bridge */ /* synthetic */ MessageLite.Builder toBuilder() { return super.toBuilder(); } public final void mergeExtensionFields(MessageType messagetype) { if (this.extensions.isImmutable()) { this.extensions = this.extensions.m857clone(); } this.extensions.mergeFrom(messagetype.extensions); } public boolean parseUnknownField(MessageType messagetype, CodedInputStream codedInputStream, ExtensionRegistryLite extensionRegistryLite, int i) throws IOException { int tagFieldNumber = WireFormat.getTagFieldNumber(i); return parseExtension(codedInputStream, extensionRegistryLite, extensionRegistryLite.findLiteExtensionByNumber(messagetype, tagFieldNumber), i, tagFieldNumber); } /* JADX WARN: Removed duplicated region for block: B:5:0x0038 */ /* JADX WARN: Removed duplicated region for block: B:8:0x003d */ /* Code decompiled incorrectly, please refer to instructions dump. To view partially-correct add '--show-bad-code' argument */ private boolean parseExtension(com.google.protobuf.CodedInputStream r6, com.google.protobuf.ExtensionRegistryLite r7, com.google.protobuf.GeneratedMessageLite.GeneratedExtension r8, int r9, int r10) throws java.io.IOException { /* Method dump skipped, instructions count: 293 To view this dump add '--comments-level debug' option */ throw new UnsupportedOperationException("Method not decompiled: com.google.protobuf.GeneratedMessageLite.ExtendableMessage.parseExtension(com.google.protobuf.CodedInputStream, com.google.protobuf.ExtensionRegistryLite, com.google.protobuf.GeneratedMessageLite$GeneratedExtension, int, int):boolean"); } public boolean parseUnknownFieldAsMessageSet(MessageType messagetype, CodedInputStream codedInputStream, ExtensionRegistryLite extensionRegistryLite, int i) throws IOException { if (i == WireFormat.MESSAGE_SET_ITEM_TAG) { mergeMessageSetExtensionFromCodedStream(messagetype, codedInputStream, extensionRegistryLite); return true; } if (WireFormat.getTagWireType(i) == 2) { return parseUnknownField(messagetype, codedInputStream, extensionRegistryLite, i); } return codedInputStream.skipField(i); } private void mergeMessageSetExtensionFromCodedStream(MessageType messagetype, CodedInputStream codedInputStream, ExtensionRegistryLite extensionRegistryLite) throws IOException { int i = 0; ByteString byteString = null; GeneratedExtension generatedExtension = null; while (true) { int readTag = codedInputStream.readTag(); if (readTag == 0) { break; } if (readTag == WireFormat.MESSAGE_SET_TYPE_ID_TAG) { i = codedInputStream.readUInt32(); if (i != 0) { generatedExtension = extensionRegistryLite.findLiteExtensionByNumber(messagetype, i); } } else if (readTag == WireFormat.MESSAGE_SET_MESSAGE_TAG) { if (i != 0 && generatedExtension != null) { eagerlyMergeMessageSetExtension(codedInputStream, generatedExtension, extensionRegistryLite, i); byteString = null; } else { byteString = codedInputStream.readBytes(); } } else if (!codedInputStream.skipField(readTag)) { break; } } codedInputStream.checkLastTagWas(WireFormat.MESSAGE_SET_ITEM_END_TAG); if (byteString == null || i == 0) { return; } if (generatedExtension != null) { mergeMessageSetExtensionFromBytes(byteString, extensionRegistryLite, generatedExtension); } else { mergeLengthDelimitedField(i, byteString); } } private void eagerlyMergeMessageSetExtension(CodedInputStream codedInputStream, GeneratedExtension generatedExtension, ExtensionRegistryLite extensionRegistryLite, int i) throws IOException { parseExtension(codedInputStream, extensionRegistryLite, generatedExtension, WireFormat.makeTag(i, 2), i); } private void mergeMessageSetExtensionFromBytes(ByteString byteString, ExtensionRegistryLite extensionRegistryLite, GeneratedExtension generatedExtension) throws IOException { MessageLite messageLite = (MessageLite) this.extensions.getField(generatedExtension.descriptor); MessageLite.Builder builder = messageLite != null ? messageLite.toBuilder() : null; if (builder == null) { builder = generatedExtension.getMessageDefaultInstance().newBuilderForType(); } builder.mergeFrom(byteString, extensionRegistryLite); ensureExtensionsAreMutable().setField(generatedExtension.descriptor, generatedExtension.singularToFieldSetType(builder.build())); } public FieldSet ensureExtensionsAreMutable() { if (this.extensions.isImmutable()) { this.extensions = this.extensions.m857clone(); } return this.extensions; } private void verifyExtensionContainingType(GeneratedExtension generatedExtension) { if (generatedExtension.getContainingTypeDefaultInstance() != getDefaultInstanceForType()) { throw new IllegalArgumentException("This extension is for a different message type. Please make sure that you are not suppressing any generics type warnings."); } } @Override // com.google.protobuf.GeneratedMessageLite.ExtendableMessageOrBuilder public final boolean hasExtension(ExtensionLite extensionLite) { GeneratedExtension checkIsLite = GeneratedMessageLite.checkIsLite(extensionLite); verifyExtensionContainingType(checkIsLite); return this.extensions.hasField(checkIsLite.descriptor); } @Override // com.google.protobuf.GeneratedMessageLite.ExtendableMessageOrBuilder public final int getExtensionCount(ExtensionLite> extensionLite) { GeneratedExtension checkIsLite = GeneratedMessageLite.checkIsLite(extensionLite); verifyExtensionContainingType(checkIsLite); return this.extensions.getRepeatedFieldCount(checkIsLite.descriptor); } @Override // com.google.protobuf.GeneratedMessageLite.ExtendableMessageOrBuilder public final Type getExtension(ExtensionLite extensionLite) { GeneratedExtension checkIsLite = GeneratedMessageLite.checkIsLite(extensionLite); verifyExtensionContainingType(checkIsLite); Object field = this.extensions.getField(checkIsLite.descriptor); if (field == null) { return checkIsLite.defaultValue; } return (Type) checkIsLite.fromFieldSetType(field); } @Override // com.google.protobuf.GeneratedMessageLite.ExtendableMessageOrBuilder public final Type getExtension(ExtensionLite> extensionLite, int i) { GeneratedExtension checkIsLite = GeneratedMessageLite.checkIsLite(extensionLite); verifyExtensionContainingType(checkIsLite); return (Type) checkIsLite.singularFromFieldSetType(this.extensions.getRepeatedField(checkIsLite.descriptor, i)); } public boolean extensionsAreInitialized() { return this.extensions.isInitialized(); } public class ExtensionWriter { private final Iterator> iter; private final boolean messageSetWireFormat; private Map.Entry next; public /* synthetic */ ExtensionWriter(ExtendableMessage extendableMessage, boolean z, AnonymousClass1 anonymousClass1) { this(z); } private ExtensionWriter(boolean z) { Iterator it = ExtendableMessage.this.extensions.iterator(); this.iter = it; if (it.hasNext()) { this.next = (Map.Entry) it.next(); } this.messageSetWireFormat = z; } public void writeUntil(int i, CodedOutputStream codedOutputStream) throws IOException { while (true) { Map.Entry entry = this.next; if (entry == null || entry.getKey().getNumber() >= i) { return; } ExtensionDescriptor key = this.next.getKey(); if (this.messageSetWireFormat && key.getLiteJavaType() == WireFormat.JavaType.MESSAGE && !key.isRepeated()) { codedOutputStream.writeMessageSetExtension(key.getNumber(), (MessageLite) this.next.getValue()); } else { FieldSet.writeField(key, this.next.getValue(), codedOutputStream); } if (this.iter.hasNext()) { this.next = this.iter.next(); } else { this.next = null; } } } } public ExtendableMessage.ExtensionWriter newExtensionWriter() { return new ExtensionWriter(this, false, null); } public ExtendableMessage.ExtensionWriter newMessageSetExtensionWriter() { return new ExtensionWriter(this, true, null); } public int extensionsSerializedSize() { return this.extensions.getSerializedSize(); } public int extensionsSerializedSizeAsMessageSet() { return this.extensions.getMessageSetSerializedSize(); } } /* renamed from: com.google.protobuf.GeneratedMessageLite$1, reason: invalid class name */ public static /* synthetic */ class AnonymousClass1 { static final /* synthetic */ int[] $SwitchMap$com$google$protobuf$WireFormat$JavaType; static { int[] iArr = new int[WireFormat.JavaType.values().length]; $SwitchMap$com$google$protobuf$WireFormat$JavaType = iArr; try { iArr[WireFormat.JavaType.MESSAGE.ordinal()] = 1; } catch (NoSuchFieldError unused) { } try { $SwitchMap$com$google$protobuf$WireFormat$JavaType[WireFormat.JavaType.ENUM.ordinal()] = 2; } catch (NoSuchFieldError unused2) { } } } public static abstract class ExtendableBuilder, BuilderType extends ExtendableBuilder> extends Builder implements ExtendableMessageOrBuilder { public ExtendableBuilder(MessageType messagetype) { super(messagetype); } public void internalSetExtensionSet(FieldSet fieldSet) { copyOnWrite(); ((ExtendableMessage) this.instance).extensions = fieldSet; } @Override // com.google.protobuf.GeneratedMessageLite.Builder public void copyOnWriteInternal() { super.copyOnWriteInternal(); if (((ExtendableMessage) this.instance).extensions != FieldSet.emptySet()) { MessageType messagetype = this.instance; ((ExtendableMessage) messagetype).extensions = ((ExtendableMessage) messagetype).extensions.m857clone(); } } private FieldSet ensureExtensionsAreMutable() { FieldSet fieldSet = ((ExtendableMessage) this.instance).extensions; if (!fieldSet.isImmutable()) { return fieldSet; } FieldSet m857clone = fieldSet.m857clone(); ((ExtendableMessage) this.instance).extensions = m857clone; return m857clone; } @Override // com.google.protobuf.GeneratedMessageLite.Builder, com.google.protobuf.MessageLite.Builder public final MessageType buildPartial() { if (!((ExtendableMessage) this.instance).isMutable()) { return (MessageType) this.instance; } ((ExtendableMessage) this.instance).extensions.makeImmutable(); return (MessageType) super.buildPartial(); } private void verifyExtensionContainingType(GeneratedExtension generatedExtension) { if (generatedExtension.getContainingTypeDefaultInstance() != getDefaultInstanceForType()) { throw new IllegalArgumentException("This extension is for a different message type. Please make sure that you are not suppressing any generics type warnings."); } } @Override // com.google.protobuf.GeneratedMessageLite.ExtendableMessageOrBuilder public final boolean hasExtension(ExtensionLite extensionLite) { return ((ExtendableMessage) this.instance).hasExtension(extensionLite); } @Override // com.google.protobuf.GeneratedMessageLite.ExtendableMessageOrBuilder public final int getExtensionCount(ExtensionLite> extensionLite) { return ((ExtendableMessage) this.instance).getExtensionCount(extensionLite); } @Override // com.google.protobuf.GeneratedMessageLite.ExtendableMessageOrBuilder public final Type getExtension(ExtensionLite extensionLite) { return (Type) ((ExtendableMessage) this.instance).getExtension(extensionLite); } @Override // com.google.protobuf.GeneratedMessageLite.ExtendableMessageOrBuilder public final Type getExtension(ExtensionLite> extensionLite, int i) { return (Type) ((ExtendableMessage) this.instance).getExtension(extensionLite, i); } public final BuilderType setExtension(ExtensionLite extensionLite, Type type) { GeneratedExtension checkIsLite = GeneratedMessageLite.checkIsLite(extensionLite); verifyExtensionContainingType(checkIsLite); copyOnWrite(); ensureExtensionsAreMutable().setField(checkIsLite.descriptor, checkIsLite.toFieldSetType(type)); return this; } public final BuilderType setExtension(ExtensionLite> extensionLite, int i, Type type) { GeneratedExtension checkIsLite = GeneratedMessageLite.checkIsLite(extensionLite); verifyExtensionContainingType(checkIsLite); copyOnWrite(); ensureExtensionsAreMutable().setRepeatedField(checkIsLite.descriptor, i, checkIsLite.singularToFieldSetType(type)); return this; } public final BuilderType addExtension(ExtensionLite> extensionLite, Type type) { GeneratedExtension checkIsLite = GeneratedMessageLite.checkIsLite(extensionLite); verifyExtensionContainingType(checkIsLite); copyOnWrite(); ensureExtensionsAreMutable().addRepeatedField(checkIsLite.descriptor, checkIsLite.singularToFieldSetType(type)); return this; } public final BuilderType clearExtension(ExtensionLite extensionLite) { GeneratedExtension checkIsLite = GeneratedMessageLite.checkIsLite(extensionLite); verifyExtensionContainingType(checkIsLite); copyOnWrite(); ensureExtensionsAreMutable().clearField(checkIsLite.descriptor); return this; } } public static GeneratedExtension newSingularGeneratedExtension(ContainingType containingtype, Type type, MessageLite messageLite, Internal.EnumLiteMap enumLiteMap, int i, WireFormat.FieldType fieldType, Class cls) { return new GeneratedExtension<>(containingtype, type, messageLite, new ExtensionDescriptor(enumLiteMap, i, fieldType, false, false), cls); } public static GeneratedExtension newRepeatedGeneratedExtension(ContainingType containingtype, MessageLite messageLite, Internal.EnumLiteMap enumLiteMap, int i, WireFormat.FieldType fieldType, boolean z, Class cls) { return new GeneratedExtension<>(containingtype, Collections.emptyList(), messageLite, new ExtensionDescriptor(enumLiteMap, i, fieldType, true, z), cls); } public static final class ExtensionDescriptor implements FieldSet.FieldDescriptorLite { final Internal.EnumLiteMap enumTypeMap; final boolean isPacked; final boolean isRepeated; final int number; final WireFormat.FieldType type; @Override // com.google.protobuf.FieldSet.FieldDescriptorLite public Internal.EnumLiteMap getEnumType() { return this.enumTypeMap; } @Override // com.google.protobuf.FieldSet.FieldDescriptorLite public WireFormat.FieldType getLiteType() { return this.type; } @Override // com.google.protobuf.FieldSet.FieldDescriptorLite public int getNumber() { return this.number; } @Override // com.google.protobuf.FieldSet.FieldDescriptorLite public boolean isPacked() { return this.isPacked; } @Override // com.google.protobuf.FieldSet.FieldDescriptorLite public boolean isRepeated() { return this.isRepeated; } public ExtensionDescriptor(Internal.EnumLiteMap enumLiteMap, int i, WireFormat.FieldType fieldType, boolean z, boolean z2) { this.enumTypeMap = enumLiteMap; this.number = i; this.type = fieldType; this.isRepeated = z; this.isPacked = z2; } @Override // com.google.protobuf.FieldSet.FieldDescriptorLite public WireFormat.JavaType getLiteJavaType() { return this.type.getJavaType(); } /* JADX WARN: Multi-variable type inference failed */ @Override // com.google.protobuf.FieldSet.FieldDescriptorLite public MessageLite.Builder internalMergeFrom(MessageLite.Builder builder, MessageLite messageLite) { return ((Builder) builder).mergeFrom((Builder) messageLite); } @Override // java.lang.Comparable public int compareTo(ExtensionDescriptor extensionDescriptor) { return this.number - extensionDescriptor.number; } } public static java.lang.reflect.Method getMethodOrDie(Class cls, String str, Class... clsArr) { try { return cls.getMethod(str, clsArr); } catch (NoSuchMethodException e) { throw new RuntimeException("Generated message class \"" + cls.getName() + "\" missing method \"" + str + "\".", e); } } public static Object invokeOrDie(java.lang.reflect.Method method, Object obj, Object... objArr) { try { return method.invoke(obj, objArr); } catch (IllegalAccessException e) { throw new RuntimeException("Couldn't use Java reflection to implement protocol message reflection.", e); } catch (InvocationTargetException e2) { Throwable cause = e2.getCause(); if (cause instanceof RuntimeException) { throw ((RuntimeException) cause); } if (cause instanceof Error) { throw ((Error) cause); } throw new RuntimeException("Unexpected exception thrown by generated accessor method.", cause); } } public static class GeneratedExtension extends ExtensionLite { final ContainingType containingTypeDefaultInstance; final Type defaultValue; final ExtensionDescriptor descriptor; final MessageLite messageDefaultInstance; public ContainingType getContainingTypeDefaultInstance() { return this.containingTypeDefaultInstance; } @Override // com.google.protobuf.ExtensionLite public Type getDefaultValue() { return this.defaultValue; } @Override // com.google.protobuf.ExtensionLite public MessageLite getMessageDefaultInstance() { return this.messageDefaultInstance; } public GeneratedExtension(ContainingType containingtype, Type type, MessageLite messageLite, ExtensionDescriptor extensionDescriptor, Class cls) { if (containingtype == null) { throw new IllegalArgumentException("Null containingTypeDefaultInstance"); } if (extensionDescriptor.getLiteType() == WireFormat.FieldType.MESSAGE && messageLite == null) { throw new IllegalArgumentException("Null messageDefaultInstance"); } this.containingTypeDefaultInstance = containingtype; this.defaultValue = type; this.messageDefaultInstance = messageLite; this.descriptor = extensionDescriptor; } @Override // com.google.protobuf.ExtensionLite public int getNumber() { return this.descriptor.getNumber(); } public Object fromFieldSetType(Object obj) { if (this.descriptor.isRepeated()) { if (this.descriptor.getLiteJavaType() != WireFormat.JavaType.ENUM) { return obj; } ArrayList arrayList = new ArrayList(); Iterator it = ((List) obj).iterator(); while (it.hasNext()) { arrayList.add(singularFromFieldSetType(it.next())); } return arrayList; } return singularFromFieldSetType(obj); } public Object singularFromFieldSetType(Object obj) { return this.descriptor.getLiteJavaType() == WireFormat.JavaType.ENUM ? this.descriptor.enumTypeMap.findValueByNumber(((Integer) obj).intValue()) : obj; } public Object toFieldSetType(Object obj) { if (this.descriptor.isRepeated()) { if (this.descriptor.getLiteJavaType() != WireFormat.JavaType.ENUM) { return obj; } ArrayList arrayList = new ArrayList(); Iterator it = ((List) obj).iterator(); while (it.hasNext()) { arrayList.add(singularToFieldSetType(it.next())); } return arrayList; } return singularToFieldSetType(obj); } public Object singularToFieldSetType(Object obj) { return this.descriptor.getLiteJavaType() == WireFormat.JavaType.ENUM ? Integer.valueOf(((Internal.EnumLite) obj).getNumber()) : obj; } @Override // com.google.protobuf.ExtensionLite public WireFormat.FieldType getLiteType() { return this.descriptor.getLiteType(); } @Override // com.google.protobuf.ExtensionLite public boolean isRepeated() { return this.descriptor.isRepeated; } } public static final class SerializedForm implements Serializable { private static final long serialVersionUID = 0; private final byte[] asBytes; private final Class messageClass; private final String messageClassName; public static SerializedForm of(MessageLite messageLite) { return new SerializedForm(messageLite); } public SerializedForm(MessageLite messageLite) { Class cls = messageLite.getClass(); this.messageClass = cls; this.messageClassName = cls.getName(); this.asBytes = messageLite.toByteArray(); } public Object readResolve() throws ObjectStreamException { try { java.lang.reflect.Field declaredField = resolveMessageClass().getDeclaredField("DEFAULT_INSTANCE"); declaredField.setAccessible(true); return ((MessageLite) declaredField.get(null)).newBuilderForType().mergeFrom(this.asBytes).buildPartial(); } catch (InvalidProtocolBufferException e) { throw new RuntimeException("Unable to understand proto buffer", e); } catch (ClassNotFoundException e2) { throw new RuntimeException("Unable to find proto buffer class: " + this.messageClassName, e2); } catch (IllegalAccessException e3) { throw new RuntimeException("Unable to call parsePartialFrom", e3); } catch (NoSuchFieldException unused) { return readResolveFallback(); } catch (SecurityException e4) { throw new RuntimeException("Unable to call DEFAULT_INSTANCE in " + this.messageClassName, e4); } } @Deprecated private Object readResolveFallback() throws ObjectStreamException { try { java.lang.reflect.Field declaredField = resolveMessageClass().getDeclaredField("defaultInstance"); declaredField.setAccessible(true); return ((MessageLite) declaredField.get(null)).newBuilderForType().mergeFrom(this.asBytes).buildPartial(); } catch (InvalidProtocolBufferException e) { throw new RuntimeException("Unable to understand proto buffer", e); } catch (ClassNotFoundException e2) { throw new RuntimeException("Unable to find proto buffer class: " + this.messageClassName, e2); } catch (IllegalAccessException e3) { throw new RuntimeException("Unable to call parsePartialFrom", e3); } catch (NoSuchFieldException e4) { throw new RuntimeException("Unable to find defaultInstance in " + this.messageClassName, e4); } catch (SecurityException e5) { throw new RuntimeException("Unable to call defaultInstance in " + this.messageClassName, e5); } } private Class resolveMessageClass() throws ClassNotFoundException { Class cls = this.messageClass; return cls != null ? cls : Class.forName(this.messageClassName); } } /* JADX INFO: Access modifiers changed from: private */ public static , BuilderType extends ExtendableBuilder, T> GeneratedExtension checkIsLite(ExtensionLite extensionLite) { if (!extensionLite.isLite()) { throw new IllegalArgumentException("Expected a lite extension."); } return (GeneratedExtension) extensionLite; } public static final > boolean isInitialized(T t, boolean z) { byte byteValue = ((Byte) t.dynamicMethod(MethodToInvoke.GET_MEMOIZED_IS_INITIALIZED)).byteValue(); if (byteValue == 1) { return true; } if (byteValue == 0) { return false; } boolean isInitialized = Protobuf.getInstance().schemaFor((Protobuf) t).isInitialized(t); if (z) { t.dynamicMethod(MethodToInvoke.SET_MEMOIZED_IS_INITIALIZED, isInitialized ? t : null); } return isInitialized; } public static Internal.IntList emptyIntList() { return IntArrayList.emptyList(); } /* JADX WARN: Type inference failed for: r1v1, types: [com.google.protobuf.Internal$IntList] */ public static Internal.IntList mutableCopy(Internal.IntList intList) { int size = intList.size(); return intList.mutableCopyWithCapacity2(size == 0 ? 10 : size * 2); } public static Internal.LongList emptyLongList() { return LongArrayList.emptyList(); } /* JADX WARN: Type inference failed for: r1v1, types: [com.google.protobuf.Internal$LongList] */ public static Internal.LongList mutableCopy(Internal.LongList longList) { int size = longList.size(); return longList.mutableCopyWithCapacity2(size == 0 ? 10 : size * 2); } public static Internal.FloatList emptyFloatList() { return FloatArrayList.emptyList(); } /* JADX WARN: Type inference failed for: r1v1, types: [com.google.protobuf.Internal$FloatList] */ public static Internal.FloatList mutableCopy(Internal.FloatList floatList) { int size = floatList.size(); return floatList.mutableCopyWithCapacity2(size == 0 ? 10 : size * 2); } public static Internal.DoubleList emptyDoubleList() { return DoubleArrayList.emptyList(); } /* JADX WARN: Type inference failed for: r1v1, types: [com.google.protobuf.Internal$DoubleList] */ public static Internal.DoubleList mutableCopy(Internal.DoubleList doubleList) { int size = doubleList.size(); return doubleList.mutableCopyWithCapacity2(size == 0 ? 10 : size * 2); } public static Internal.BooleanList emptyBooleanList() { return BooleanArrayList.emptyList(); } /* JADX WARN: Type inference failed for: r1v1, types: [com.google.protobuf.Internal$BooleanList] */ public static Internal.BooleanList mutableCopy(Internal.BooleanList booleanList) { int size = booleanList.size(); return booleanList.mutableCopyWithCapacity2(size == 0 ? 10 : size * 2); } public static Internal.ProtobufList emptyProtobufList() { return ProtobufArrayList.emptyList(); } public static Internal.ProtobufList mutableCopy(Internal.ProtobufList protobufList) { int size = protobufList.size(); return protobufList.mutableCopyWithCapacity2(size == 0 ? 10 : size * 2); } public static class DefaultInstanceBasedParser> extends AbstractParser { private final T defaultInstance; public DefaultInstanceBasedParser(T t) { this.defaultInstance = t; } @Override // com.google.protobuf.Parser public T parsePartialFrom(CodedInputStream codedInputStream, ExtensionRegistryLite extensionRegistryLite) throws InvalidProtocolBufferException { return (T) GeneratedMessageLite.parsePartialFrom(this.defaultInstance, codedInputStream, extensionRegistryLite); } @Override // com.google.protobuf.AbstractParser, com.google.protobuf.Parser public T parsePartialFrom(byte[] bArr, int i, int i2, ExtensionRegistryLite extensionRegistryLite) throws InvalidProtocolBufferException { return (T) GeneratedMessageLite.parsePartialFrom(this.defaultInstance, bArr, i, i2, extensionRegistryLite); } } public static > T parsePartialFrom(T t, CodedInputStream codedInputStream, ExtensionRegistryLite extensionRegistryLite) throws InvalidProtocolBufferException { T t2 = (T) t.newMutableInstance(); try { Schema schemaFor = Protobuf.getInstance().schemaFor((Protobuf) t2); schemaFor.mergeFrom(t2, CodedInputStreamReader.forCodedInput(codedInputStream), extensionRegistryLite); schemaFor.makeImmutable(t2); return t2; } catch (InvalidProtocolBufferException e) { e = e; if (e.getThrownFromInputStream()) { e = new InvalidProtocolBufferException((IOException) e); } throw e.setUnfinishedMessage(t2); } catch (UninitializedMessageException e2) { throw e2.asInvalidProtocolBufferException().setUnfinishedMessage(t2); } catch (IOException e3) { if (e3.getCause() instanceof InvalidProtocolBufferException) { throw ((InvalidProtocolBufferException) e3.getCause()); } throw new InvalidProtocolBufferException(e3).setUnfinishedMessage(t2); } catch (RuntimeException e4) { if (e4.getCause() instanceof InvalidProtocolBufferException) { throw ((InvalidProtocolBufferException) e4.getCause()); } throw e4; } } /* JADX INFO: Access modifiers changed from: private */ public static > T parsePartialFrom(T t, byte[] bArr, int i, int i2, ExtensionRegistryLite extensionRegistryLite) throws InvalidProtocolBufferException { T t2 = (T) t.newMutableInstance(); try { Schema schemaFor = Protobuf.getInstance().schemaFor((Protobuf) t2); schemaFor.mergeFrom(t2, bArr, i, i + i2, new ArrayDecoders.Registers(extensionRegistryLite)); schemaFor.makeImmutable(t2); return t2; } catch (InvalidProtocolBufferException e) { e = e; if (e.getThrownFromInputStream()) { e = new InvalidProtocolBufferException((IOException) e); } throw e.setUnfinishedMessage(t2); } catch (UninitializedMessageException e2) { throw e2.asInvalidProtocolBufferException().setUnfinishedMessage(t2); } catch (IOException e3) { if (e3.getCause() instanceof InvalidProtocolBufferException) { throw ((InvalidProtocolBufferException) e3.getCause()); } throw new InvalidProtocolBufferException(e3).setUnfinishedMessage(t2); } catch (IndexOutOfBoundsException unused) { throw InvalidProtocolBufferException.truncatedMessage().setUnfinishedMessage(t2); } } public static > T parsePartialFrom(T t, CodedInputStream codedInputStream) throws InvalidProtocolBufferException { return (T) parsePartialFrom(t, codedInputStream, ExtensionRegistryLite.getEmptyRegistry()); } private static > T checkMessageInitialized(T t) throws InvalidProtocolBufferException { if (t == null || t.isInitialized()) { return t; } throw t.newUninitializedMessageException().asInvalidProtocolBufferException().setUnfinishedMessage(t); } public static > T parseFrom(T t, ByteBuffer byteBuffer, ExtensionRegistryLite extensionRegistryLite) throws InvalidProtocolBufferException { return (T) checkMessageInitialized(parseFrom(t, CodedInputStream.newInstance(byteBuffer), extensionRegistryLite)); } public static > T parseFrom(T t, ByteBuffer byteBuffer) throws InvalidProtocolBufferException { return (T) parseFrom(t, byteBuffer, ExtensionRegistryLite.getEmptyRegistry()); } public static > T parseFrom(T t, ByteString byteString) throws InvalidProtocolBufferException { return (T) checkMessageInitialized(parseFrom(t, byteString, ExtensionRegistryLite.getEmptyRegistry())); } public static > T parseFrom(T t, ByteString byteString, ExtensionRegistryLite extensionRegistryLite) throws InvalidProtocolBufferException { return (T) checkMessageInitialized(parsePartialFrom(t, byteString, extensionRegistryLite)); } private static > T parsePartialFrom(T t, ByteString byteString, ExtensionRegistryLite extensionRegistryLite) throws InvalidProtocolBufferException { CodedInputStream newCodedInput = byteString.newCodedInput(); T t2 = (T) parsePartialFrom(t, newCodedInput, extensionRegistryLite); try { newCodedInput.checkLastTagWas(0); return t2; } catch (InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(t2); } } public static > T parseFrom(T t, byte[] bArr) throws InvalidProtocolBufferException { return (T) checkMessageInitialized(parsePartialFrom(t, bArr, 0, bArr.length, ExtensionRegistryLite.getEmptyRegistry())); } public static > T parseFrom(T t, byte[] bArr, ExtensionRegistryLite extensionRegistryLite) throws InvalidProtocolBufferException { return (T) checkMessageInitialized(parsePartialFrom(t, bArr, 0, bArr.length, extensionRegistryLite)); } public static > T parseFrom(T t, InputStream inputStream) throws InvalidProtocolBufferException { return (T) checkMessageInitialized(parsePartialFrom(t, CodedInputStream.newInstance(inputStream), ExtensionRegistryLite.getEmptyRegistry())); } public static > T parseFrom(T t, InputStream inputStream, ExtensionRegistryLite extensionRegistryLite) throws InvalidProtocolBufferException { return (T) checkMessageInitialized(parsePartialFrom(t, CodedInputStream.newInstance(inputStream), extensionRegistryLite)); } public static > T parseFrom(T t, CodedInputStream codedInputStream) throws InvalidProtocolBufferException { return (T) parseFrom(t, codedInputStream, ExtensionRegistryLite.getEmptyRegistry()); } public static > T parseFrom(T t, CodedInputStream codedInputStream, ExtensionRegistryLite extensionRegistryLite) throws InvalidProtocolBufferException { return (T) checkMessageInitialized(parsePartialFrom(t, codedInputStream, extensionRegistryLite)); } public static > T parseDelimitedFrom(T t, InputStream inputStream) throws InvalidProtocolBufferException { return (T) checkMessageInitialized(parsePartialDelimitedFrom(t, inputStream, ExtensionRegistryLite.getEmptyRegistry())); } public static > T parseDelimitedFrom(T t, InputStream inputStream, ExtensionRegistryLite extensionRegistryLite) throws InvalidProtocolBufferException { return (T) checkMessageInitialized(parsePartialDelimitedFrom(t, inputStream, extensionRegistryLite)); } private static > T parsePartialDelimitedFrom(T t, InputStream inputStream, ExtensionRegistryLite extensionRegistryLite) throws InvalidProtocolBufferException { try { int read = inputStream.read(); if (read == -1) { return null; } CodedInputStream newInstance = CodedInputStream.newInstance(new AbstractMessageLite.Builder.LimitedInputStream(inputStream, CodedInputStream.readRawVarint32(read, inputStream))); T t2 = (T) parsePartialFrom(t, newInstance, extensionRegistryLite); try { newInstance.checkLastTagWas(0); return t2; } catch (InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(t2); } } catch (InvalidProtocolBufferException e2) { if (e2.getThrownFromInputStream()) { throw new InvalidProtocolBufferException((IOException) e2); } throw e2; } catch (IOException e3) { throw new InvalidProtocolBufferException(e3); } } }