diff --git a/README.md b/README.md index bae8095..f11e442 100644 --- a/README.md +++ b/README.md @@ -65,8 +65,9 @@ Well done you did it! The last step is to star this repo :smile | boot images | boot.img, vendor_boot.img | all | | | recovery images | recovery.img, recovery-two-step.img | all | | | vbmeta images | vbmeta.img, vbmeta_system.img etc. | all | | -| dtbo images | dtbo.img | linux & mac | | +| dtbo images | dtbo.img | linux & mac | | | sparse images | system.img, vendor.img, product.img etc. | linux & mac | need **hacking mode**\* | +| OTA payload | payload.bin | linux & mac | | Please note that the boot.img MUST follows AOSP verified boot flow, either [Boot image signature](https://source.android.com/security/verifiedboot/verified-boot#signature_format) in VBoot 1.0 or [AVB HASH footer](https://android.googlesource.com/platform/external/avb/+/master/README.md#The-VBMeta-struct) (a.k.a. AVB) in VBoot 2.0. diff --git a/bbootimg/build.gradle.kts b/bbootimg/build.gradle.kts index 889f9bf..06edb44 100644 --- a/bbootimg/build.gradle.kts +++ b/bbootimg/build.gradle.kts @@ -34,8 +34,8 @@ dependencies { implementation("org.jetbrains.kotlin:kotlin-reflect") implementation("cc.cfig:io:0.2") - implementation("org.slf4j:slf4j-simple:1.7.32") - implementation("org.slf4j:slf4j-api:1.7.32") + implementation("org.slf4j:slf4j-simple:1.7.36") + implementation("org.slf4j:slf4j-api:1.7.36") implementation("com.fasterxml.jackson.core:jackson-annotations:2.13.1") implementation("com.fasterxml.jackson.core:jackson-databind:2.13.1") implementation("com.google.guava:guava:31.0.1-jre") @@ -46,6 +46,7 @@ dependencies { implementation("junit:junit:4.13.2") implementation("org.bouncycastle:bcprov-jdk15on:1.69") implementation("de.vandermeer:asciitable:0.3.2") + implementation("com.google.protobuf:protobuf-java:3.19.4") implementation(project(":helper")) testImplementation("org.jetbrains.kotlin:kotlin-test") diff --git a/bbootimg/src/main/java/chromeos_update_engine/UpdateMetadata.java b/bbootimg/src/main/java/chromeos_update_engine/UpdateMetadata.java new file mode 100644 index 0000000..9299950 --- /dev/null +++ b/bbootimg/src/main/java/chromeos_update_engine/UpdateMetadata.java @@ -0,0 +1,18616 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: update_metadata.proto + +package chromeos_update_engine; + +public final class UpdateMetadata { + private UpdateMetadata() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface ExtentOrBuilder extends + // @@protoc_insertion_point(interface_extends:chromeos_update_engine.Extent) + com.google.protobuf.MessageOrBuilder { + + /** + * optional uint64 start_block = 1; + * @return Whether the startBlock field is set. + */ + boolean hasStartBlock(); + /** + * optional uint64 start_block = 1; + * @return The startBlock. + */ + long getStartBlock(); + + /** + * optional uint64 num_blocks = 2; + * @return Whether the numBlocks field is set. + */ + boolean hasNumBlocks(); + /** + * optional uint64 num_blocks = 2; + * @return The numBlocks. + */ + long getNumBlocks(); + } + /** + * Protobuf type {@code chromeos_update_engine.Extent} + */ + public static final class Extent extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:chromeos_update_engine.Extent) + ExtentOrBuilder { + private static final long serialVersionUID = 0L; + // Use Extent.newBuilder() to construct. + private Extent(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Extent() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new Extent(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private Extent( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + bitField0_ |= 0x00000001; + startBlock_ = input.readUInt64(); + break; + } + case 16: { + bitField0_ |= 0x00000002; + numBlocks_ = input.readUInt64(); + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return chromeos_update_engine.UpdateMetadata.internal_static_chromeos_update_engine_Extent_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return chromeos_update_engine.UpdateMetadata.internal_static_chromeos_update_engine_Extent_fieldAccessorTable + .ensureFieldAccessorsInitialized( + chromeos_update_engine.UpdateMetadata.Extent.class, chromeos_update_engine.UpdateMetadata.Extent.Builder.class); + } + + private int bitField0_; + public static final int START_BLOCK_FIELD_NUMBER = 1; + private long startBlock_; + /** + * optional uint64 start_block = 1; + * @return Whether the startBlock field is set. + */ + @java.lang.Override + public boolean hasStartBlock() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * optional uint64 start_block = 1; + * @return The startBlock. + */ + @java.lang.Override + public long getStartBlock() { + return startBlock_; + } + + public static final int NUM_BLOCKS_FIELD_NUMBER = 2; + private long numBlocks_; + /** + * optional uint64 num_blocks = 2; + * @return Whether the numBlocks field is set. + */ + @java.lang.Override + public boolean hasNumBlocks() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * optional uint64 num_blocks = 2; + * @return The numBlocks. + */ + @java.lang.Override + public long getNumBlocks() { + return numBlocks_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + output.writeUInt64(1, startBlock_); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeUInt64(2, numBlocks_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(1, startBlock_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(2, numBlocks_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof chromeos_update_engine.UpdateMetadata.Extent)) { + return super.equals(obj); + } + chromeos_update_engine.UpdateMetadata.Extent other = (chromeos_update_engine.UpdateMetadata.Extent) obj; + + if (hasStartBlock() != other.hasStartBlock()) return false; + if (hasStartBlock()) { + if (getStartBlock() + != other.getStartBlock()) return false; + } + if (hasNumBlocks() != other.hasNumBlocks()) return false; + if (hasNumBlocks()) { + if (getNumBlocks() + != other.getNumBlocks()) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasStartBlock()) { + hash = (37 * hash) + START_BLOCK_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getStartBlock()); + } + if (hasNumBlocks()) { + hash = (37 * hash) + NUM_BLOCKS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getNumBlocks()); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static chromeos_update_engine.UpdateMetadata.Extent parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static chromeos_update_engine.UpdateMetadata.Extent parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static chromeos_update_engine.UpdateMetadata.Extent parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static chromeos_update_engine.UpdateMetadata.Extent parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static chromeos_update_engine.UpdateMetadata.Extent parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static chromeos_update_engine.UpdateMetadata.Extent parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static chromeos_update_engine.UpdateMetadata.Extent parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static chromeos_update_engine.UpdateMetadata.Extent parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static chromeos_update_engine.UpdateMetadata.Extent parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static chromeos_update_engine.UpdateMetadata.Extent parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static chromeos_update_engine.UpdateMetadata.Extent parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static chromeos_update_engine.UpdateMetadata.Extent parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(chromeos_update_engine.UpdateMetadata.Extent prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code chromeos_update_engine.Extent} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:chromeos_update_engine.Extent) + chromeos_update_engine.UpdateMetadata.ExtentOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return chromeos_update_engine.UpdateMetadata.internal_static_chromeos_update_engine_Extent_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return chromeos_update_engine.UpdateMetadata.internal_static_chromeos_update_engine_Extent_fieldAccessorTable + .ensureFieldAccessorsInitialized( + chromeos_update_engine.UpdateMetadata.Extent.class, chromeos_update_engine.UpdateMetadata.Extent.Builder.class); + } + + // Construct using chromeos_update_engine.UpdateMetadata.Extent.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + startBlock_ = 0L; + bitField0_ = (bitField0_ & ~0x00000001); + numBlocks_ = 0L; + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return chromeos_update_engine.UpdateMetadata.internal_static_chromeos_update_engine_Extent_descriptor; + } + + @java.lang.Override + public chromeos_update_engine.UpdateMetadata.Extent getDefaultInstanceForType() { + return chromeos_update_engine.UpdateMetadata.Extent.getDefaultInstance(); + } + + @java.lang.Override + public chromeos_update_engine.UpdateMetadata.Extent build() { + chromeos_update_engine.UpdateMetadata.Extent result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public chromeos_update_engine.UpdateMetadata.Extent buildPartial() { + chromeos_update_engine.UpdateMetadata.Extent result = new chromeos_update_engine.UpdateMetadata.Extent(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.startBlock_ = startBlock_; + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.numBlocks_ = numBlocks_; + to_bitField0_ |= 0x00000002; + } + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof chromeos_update_engine.UpdateMetadata.Extent) { + return mergeFrom((chromeos_update_engine.UpdateMetadata.Extent)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(chromeos_update_engine.UpdateMetadata.Extent other) { + if (other == chromeos_update_engine.UpdateMetadata.Extent.getDefaultInstance()) return this; + if (other.hasStartBlock()) { + setStartBlock(other.getStartBlock()); + } + if (other.hasNumBlocks()) { + setNumBlocks(other.getNumBlocks()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + chromeos_update_engine.UpdateMetadata.Extent parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (chromeos_update_engine.UpdateMetadata.Extent) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private long startBlock_ ; + /** + * optional uint64 start_block = 1; + * @return Whether the startBlock field is set. + */ + @java.lang.Override + public boolean hasStartBlock() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * optional uint64 start_block = 1; + * @return The startBlock. + */ + @java.lang.Override + public long getStartBlock() { + return startBlock_; + } + /** + * optional uint64 start_block = 1; + * @param value The startBlock to set. + * @return This builder for chaining. + */ + public Builder setStartBlock(long value) { + bitField0_ |= 0x00000001; + startBlock_ = value; + onChanged(); + return this; + } + /** + * optional uint64 start_block = 1; + * @return This builder for chaining. + */ + public Builder clearStartBlock() { + bitField0_ = (bitField0_ & ~0x00000001); + startBlock_ = 0L; + onChanged(); + return this; + } + + private long numBlocks_ ; + /** + * optional uint64 num_blocks = 2; + * @return Whether the numBlocks field is set. + */ + @java.lang.Override + public boolean hasNumBlocks() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * optional uint64 num_blocks = 2; + * @return The numBlocks. + */ + @java.lang.Override + public long getNumBlocks() { + return numBlocks_; + } + /** + * optional uint64 num_blocks = 2; + * @param value The numBlocks to set. + * @return This builder for chaining. + */ + public Builder setNumBlocks(long value) { + bitField0_ |= 0x00000002; + numBlocks_ = value; + onChanged(); + return this; + } + /** + * optional uint64 num_blocks = 2; + * @return This builder for chaining. + */ + public Builder clearNumBlocks() { + bitField0_ = (bitField0_ & ~0x00000002); + numBlocks_ = 0L; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:chromeos_update_engine.Extent) + } + + // @@protoc_insertion_point(class_scope:chromeos_update_engine.Extent) + private static final chromeos_update_engine.UpdateMetadata.Extent DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new chromeos_update_engine.UpdateMetadata.Extent(); + } + + public static chromeos_update_engine.UpdateMetadata.Extent getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @java.lang.Deprecated public static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Extent parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Extent(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public chromeos_update_engine.UpdateMetadata.Extent getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface SignaturesOrBuilder extends + // @@protoc_insertion_point(interface_extends:chromeos_update_engine.Signatures) + com.google.protobuf.MessageOrBuilder { + + /** + * repeated .chromeos_update_engine.Signatures.Signature signatures = 1; + */ + java.util.List + getSignaturesList(); + /** + * repeated .chromeos_update_engine.Signatures.Signature signatures = 1; + */ + chromeos_update_engine.UpdateMetadata.Signatures.Signature getSignatures(int index); + /** + * repeated .chromeos_update_engine.Signatures.Signature signatures = 1; + */ + int getSignaturesCount(); + /** + * repeated .chromeos_update_engine.Signatures.Signature signatures = 1; + */ + java.util.List + getSignaturesOrBuilderList(); + /** + * repeated .chromeos_update_engine.Signatures.Signature signatures = 1; + */ + chromeos_update_engine.UpdateMetadata.Signatures.SignatureOrBuilder getSignaturesOrBuilder( + int index); + } + /** + * Protobuf type {@code chromeos_update_engine.Signatures} + */ + public static final class Signatures extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:chromeos_update_engine.Signatures) + SignaturesOrBuilder { + private static final long serialVersionUID = 0L; + // Use Signatures.newBuilder() to construct. + private Signatures(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Signatures() { + signatures_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new Signatures(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private Signatures( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + signatures_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + signatures_.add( + input.readMessage(chromeos_update_engine.UpdateMetadata.Signatures.Signature.PARSER, extensionRegistry)); + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + signatures_ = java.util.Collections.unmodifiableList(signatures_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return chromeos_update_engine.UpdateMetadata.internal_static_chromeos_update_engine_Signatures_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return chromeos_update_engine.UpdateMetadata.internal_static_chromeos_update_engine_Signatures_fieldAccessorTable + .ensureFieldAccessorsInitialized( + chromeos_update_engine.UpdateMetadata.Signatures.class, chromeos_update_engine.UpdateMetadata.Signatures.Builder.class); + } + + public interface SignatureOrBuilder extends + // @@protoc_insertion_point(interface_extends:chromeos_update_engine.Signatures.Signature) + com.google.protobuf.MessageOrBuilder { + + /** + * optional uint32 version = 1 [deprecated = true]; + * @return Whether the version field is set. + */ + @java.lang.Deprecated boolean hasVersion(); + /** + * optional uint32 version = 1 [deprecated = true]; + * @return The version. + */ + @java.lang.Deprecated int getVersion(); + + /** + * optional bytes data = 2; + * @return Whether the data field is set. + */ + boolean hasData(); + /** + * optional bytes data = 2; + * @return The data. + */ + com.google.protobuf.ByteString getData(); + + /** + *
+       * The DER encoded signature size of EC keys is nondeterministic for
+       * different input of sha256 hash. However, we need the size of the
+       * serialized signatures protobuf string to be fixed before signing;
+       * because this size is part of the content to be signed. Therefore, we
+       * always pad the signature data to the maximum possible signature size of
+       * a given key. And the payload verifier will truncate the signature to
+       * its correct size based on the value of |unpadded_signature_size|.
+       * 
+ * + * optional fixed32 unpadded_signature_size = 3; + * @return Whether the unpaddedSignatureSize field is set. + */ + boolean hasUnpaddedSignatureSize(); + /** + *
+       * The DER encoded signature size of EC keys is nondeterministic for
+       * different input of sha256 hash. However, we need the size of the
+       * serialized signatures protobuf string to be fixed before signing;
+       * because this size is part of the content to be signed. Therefore, we
+       * always pad the signature data to the maximum possible signature size of
+       * a given key. And the payload verifier will truncate the signature to
+       * its correct size based on the value of |unpadded_signature_size|.
+       * 
+ * + * optional fixed32 unpadded_signature_size = 3; + * @return The unpaddedSignatureSize. + */ + int getUnpaddedSignatureSize(); + } + /** + * Protobuf type {@code chromeos_update_engine.Signatures.Signature} + */ + public static final class Signature extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:chromeos_update_engine.Signatures.Signature) + SignatureOrBuilder { + private static final long serialVersionUID = 0L; + // Use Signature.newBuilder() to construct. + private Signature(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Signature() { + data_ = com.google.protobuf.ByteString.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new Signature(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private Signature( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + bitField0_ |= 0x00000001; + version_ = input.readUInt32(); + break; + } + case 18: { + bitField0_ |= 0x00000002; + data_ = input.readBytes(); + break; + } + case 29: { + bitField0_ |= 0x00000004; + unpaddedSignatureSize_ = input.readFixed32(); + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return chromeos_update_engine.UpdateMetadata.internal_static_chromeos_update_engine_Signatures_Signature_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return chromeos_update_engine.UpdateMetadata.internal_static_chromeos_update_engine_Signatures_Signature_fieldAccessorTable + .ensureFieldAccessorsInitialized( + chromeos_update_engine.UpdateMetadata.Signatures.Signature.class, chromeos_update_engine.UpdateMetadata.Signatures.Signature.Builder.class); + } + + private int bitField0_; + public static final int VERSION_FIELD_NUMBER = 1; + private int version_; + /** + * optional uint32 version = 1 [deprecated = true]; + * @return Whether the version field is set. + */ + @java.lang.Override + @java.lang.Deprecated public boolean hasVersion() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * optional uint32 version = 1 [deprecated = true]; + * @return The version. + */ + @java.lang.Override + @java.lang.Deprecated public int getVersion() { + return version_; + } + + public static final int DATA_FIELD_NUMBER = 2; + private com.google.protobuf.ByteString data_; + /** + * optional bytes data = 2; + * @return Whether the data field is set. + */ + @java.lang.Override + public boolean hasData() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * optional bytes data = 2; + * @return The data. + */ + @java.lang.Override + public com.google.protobuf.ByteString getData() { + return data_; + } + + public static final int UNPADDED_SIGNATURE_SIZE_FIELD_NUMBER = 3; + private int unpaddedSignatureSize_; + /** + *
+       * The DER encoded signature size of EC keys is nondeterministic for
+       * different input of sha256 hash. However, we need the size of the
+       * serialized signatures protobuf string to be fixed before signing;
+       * because this size is part of the content to be signed. Therefore, we
+       * always pad the signature data to the maximum possible signature size of
+       * a given key. And the payload verifier will truncate the signature to
+       * its correct size based on the value of |unpadded_signature_size|.
+       * 
+ * + * optional fixed32 unpadded_signature_size = 3; + * @return Whether the unpaddedSignatureSize field is set. + */ + @java.lang.Override + public boolean hasUnpaddedSignatureSize() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + *
+       * The DER encoded signature size of EC keys is nondeterministic for
+       * different input of sha256 hash. However, we need the size of the
+       * serialized signatures protobuf string to be fixed before signing;
+       * because this size is part of the content to be signed. Therefore, we
+       * always pad the signature data to the maximum possible signature size of
+       * a given key. And the payload verifier will truncate the signature to
+       * its correct size based on the value of |unpadded_signature_size|.
+       * 
+ * + * optional fixed32 unpadded_signature_size = 3; + * @return The unpaddedSignatureSize. + */ + @java.lang.Override + public int getUnpaddedSignatureSize() { + return unpaddedSignatureSize_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + output.writeUInt32(1, version_); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeBytes(2, data_); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeFixed32(3, unpaddedSignatureSize_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(1, version_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(2, data_); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeFixed32Size(3, unpaddedSignatureSize_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof chromeos_update_engine.UpdateMetadata.Signatures.Signature)) { + return super.equals(obj); + } + chromeos_update_engine.UpdateMetadata.Signatures.Signature other = (chromeos_update_engine.UpdateMetadata.Signatures.Signature) obj; + + if (hasVersion() != other.hasVersion()) return false; + if (hasVersion()) { + if (getVersion() + != other.getVersion()) return false; + } + if (hasData() != other.hasData()) return false; + if (hasData()) { + if (!getData() + .equals(other.getData())) return false; + } + if (hasUnpaddedSignatureSize() != other.hasUnpaddedSignatureSize()) return false; + if (hasUnpaddedSignatureSize()) { + if (getUnpaddedSignatureSize() + != other.getUnpaddedSignatureSize()) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasVersion()) { + hash = (37 * hash) + VERSION_FIELD_NUMBER; + hash = (53 * hash) + getVersion(); + } + if (hasData()) { + hash = (37 * hash) + DATA_FIELD_NUMBER; + hash = (53 * hash) + getData().hashCode(); + } + if (hasUnpaddedSignatureSize()) { + hash = (37 * hash) + UNPADDED_SIGNATURE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getUnpaddedSignatureSize(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static chromeos_update_engine.UpdateMetadata.Signatures.Signature parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static chromeos_update_engine.UpdateMetadata.Signatures.Signature parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static chromeos_update_engine.UpdateMetadata.Signatures.Signature parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static chromeos_update_engine.UpdateMetadata.Signatures.Signature parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static chromeos_update_engine.UpdateMetadata.Signatures.Signature parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static chromeos_update_engine.UpdateMetadata.Signatures.Signature parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static chromeos_update_engine.UpdateMetadata.Signatures.Signature parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static chromeos_update_engine.UpdateMetadata.Signatures.Signature parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static chromeos_update_engine.UpdateMetadata.Signatures.Signature parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static chromeos_update_engine.UpdateMetadata.Signatures.Signature parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static chromeos_update_engine.UpdateMetadata.Signatures.Signature parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static chromeos_update_engine.UpdateMetadata.Signatures.Signature parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(chromeos_update_engine.UpdateMetadata.Signatures.Signature prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code chromeos_update_engine.Signatures.Signature} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:chromeos_update_engine.Signatures.Signature) + chromeos_update_engine.UpdateMetadata.Signatures.SignatureOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return chromeos_update_engine.UpdateMetadata.internal_static_chromeos_update_engine_Signatures_Signature_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return chromeos_update_engine.UpdateMetadata.internal_static_chromeos_update_engine_Signatures_Signature_fieldAccessorTable + .ensureFieldAccessorsInitialized( + chromeos_update_engine.UpdateMetadata.Signatures.Signature.class, chromeos_update_engine.UpdateMetadata.Signatures.Signature.Builder.class); + } + + // Construct using chromeos_update_engine.UpdateMetadata.Signatures.Signature.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + version_ = 0; + bitField0_ = (bitField0_ & ~0x00000001); + data_ = com.google.protobuf.ByteString.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + unpaddedSignatureSize_ = 0; + bitField0_ = (bitField0_ & ~0x00000004); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return chromeos_update_engine.UpdateMetadata.internal_static_chromeos_update_engine_Signatures_Signature_descriptor; + } + + @java.lang.Override + public chromeos_update_engine.UpdateMetadata.Signatures.Signature getDefaultInstanceForType() { + return chromeos_update_engine.UpdateMetadata.Signatures.Signature.getDefaultInstance(); + } + + @java.lang.Override + public chromeos_update_engine.UpdateMetadata.Signatures.Signature build() { + chromeos_update_engine.UpdateMetadata.Signatures.Signature result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public chromeos_update_engine.UpdateMetadata.Signatures.Signature buildPartial() { + chromeos_update_engine.UpdateMetadata.Signatures.Signature result = new chromeos_update_engine.UpdateMetadata.Signatures.Signature(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.version_ = version_; + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + to_bitField0_ |= 0x00000002; + } + result.data_ = data_; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.unpaddedSignatureSize_ = unpaddedSignatureSize_; + to_bitField0_ |= 0x00000004; + } + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof chromeos_update_engine.UpdateMetadata.Signatures.Signature) { + return mergeFrom((chromeos_update_engine.UpdateMetadata.Signatures.Signature)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(chromeos_update_engine.UpdateMetadata.Signatures.Signature other) { + if (other == chromeos_update_engine.UpdateMetadata.Signatures.Signature.getDefaultInstance()) return this; + if (other.hasVersion()) { + setVersion(other.getVersion()); + } + if (other.hasData()) { + setData(other.getData()); + } + if (other.hasUnpaddedSignatureSize()) { + setUnpaddedSignatureSize(other.getUnpaddedSignatureSize()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + chromeos_update_engine.UpdateMetadata.Signatures.Signature parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (chromeos_update_engine.UpdateMetadata.Signatures.Signature) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private int version_ ; + /** + * optional uint32 version = 1 [deprecated = true]; + * @return Whether the version field is set. + */ + @java.lang.Override + @java.lang.Deprecated public boolean hasVersion() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * optional uint32 version = 1 [deprecated = true]; + * @return The version. + */ + @java.lang.Override + @java.lang.Deprecated public int getVersion() { + return version_; + } + /** + * optional uint32 version = 1 [deprecated = true]; + * @param value The version to set. + * @return This builder for chaining. + */ + @java.lang.Deprecated public Builder setVersion(int value) { + bitField0_ |= 0x00000001; + version_ = value; + onChanged(); + return this; + } + /** + * optional uint32 version = 1 [deprecated = true]; + * @return This builder for chaining. + */ + @java.lang.Deprecated public Builder clearVersion() { + bitField0_ = (bitField0_ & ~0x00000001); + version_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.ByteString data_ = com.google.protobuf.ByteString.EMPTY; + /** + * optional bytes data = 2; + * @return Whether the data field is set. + */ + @java.lang.Override + public boolean hasData() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * optional bytes data = 2; + * @return The data. + */ + @java.lang.Override + public com.google.protobuf.ByteString getData() { + return data_; + } + /** + * optional bytes data = 2; + * @param value The data to set. + * @return This builder for chaining. + */ + public Builder setData(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + data_ = value; + onChanged(); + return this; + } + /** + * optional bytes data = 2; + * @return This builder for chaining. + */ + public Builder clearData() { + bitField0_ = (bitField0_ & ~0x00000002); + data_ = getDefaultInstance().getData(); + onChanged(); + return this; + } + + private int unpaddedSignatureSize_ ; + /** + *
+         * The DER encoded signature size of EC keys is nondeterministic for
+         * different input of sha256 hash. However, we need the size of the
+         * serialized signatures protobuf string to be fixed before signing;
+         * because this size is part of the content to be signed. Therefore, we
+         * always pad the signature data to the maximum possible signature size of
+         * a given key. And the payload verifier will truncate the signature to
+         * its correct size based on the value of |unpadded_signature_size|.
+         * 
+ * + * optional fixed32 unpadded_signature_size = 3; + * @return Whether the unpaddedSignatureSize field is set. + */ + @java.lang.Override + public boolean hasUnpaddedSignatureSize() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + *
+         * The DER encoded signature size of EC keys is nondeterministic for
+         * different input of sha256 hash. However, we need the size of the
+         * serialized signatures protobuf string to be fixed before signing;
+         * because this size is part of the content to be signed. Therefore, we
+         * always pad the signature data to the maximum possible signature size of
+         * a given key. And the payload verifier will truncate the signature to
+         * its correct size based on the value of |unpadded_signature_size|.
+         * 
+ * + * optional fixed32 unpadded_signature_size = 3; + * @return The unpaddedSignatureSize. + */ + @java.lang.Override + public int getUnpaddedSignatureSize() { + return unpaddedSignatureSize_; + } + /** + *
+         * The DER encoded signature size of EC keys is nondeterministic for
+         * different input of sha256 hash. However, we need the size of the
+         * serialized signatures protobuf string to be fixed before signing;
+         * because this size is part of the content to be signed. Therefore, we
+         * always pad the signature data to the maximum possible signature size of
+         * a given key. And the payload verifier will truncate the signature to
+         * its correct size based on the value of |unpadded_signature_size|.
+         * 
+ * + * optional fixed32 unpadded_signature_size = 3; + * @param value The unpaddedSignatureSize to set. + * @return This builder for chaining. + */ + public Builder setUnpaddedSignatureSize(int value) { + bitField0_ |= 0x00000004; + unpaddedSignatureSize_ = value; + onChanged(); + return this; + } + /** + *
+         * The DER encoded signature size of EC keys is nondeterministic for
+         * different input of sha256 hash. However, we need the size of the
+         * serialized signatures protobuf string to be fixed before signing;
+         * because this size is part of the content to be signed. Therefore, we
+         * always pad the signature data to the maximum possible signature size of
+         * a given key. And the payload verifier will truncate the signature to
+         * its correct size based on the value of |unpadded_signature_size|.
+         * 
+ * + * optional fixed32 unpadded_signature_size = 3; + * @return This builder for chaining. + */ + public Builder clearUnpaddedSignatureSize() { + bitField0_ = (bitField0_ & ~0x00000004); + unpaddedSignatureSize_ = 0; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:chromeos_update_engine.Signatures.Signature) + } + + // @@protoc_insertion_point(class_scope:chromeos_update_engine.Signatures.Signature) + private static final chromeos_update_engine.UpdateMetadata.Signatures.Signature DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new chromeos_update_engine.UpdateMetadata.Signatures.Signature(); + } + + public static chromeos_update_engine.UpdateMetadata.Signatures.Signature getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @java.lang.Deprecated public static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Signature parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Signature(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public chromeos_update_engine.UpdateMetadata.Signatures.Signature getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public static final int SIGNATURES_FIELD_NUMBER = 1; + private java.util.List signatures_; + /** + * repeated .chromeos_update_engine.Signatures.Signature signatures = 1; + */ + @java.lang.Override + public java.util.List getSignaturesList() { + return signatures_; + } + /** + * repeated .chromeos_update_engine.Signatures.Signature signatures = 1; + */ + @java.lang.Override + public java.util.List + getSignaturesOrBuilderList() { + return signatures_; + } + /** + * repeated .chromeos_update_engine.Signatures.Signature signatures = 1; + */ + @java.lang.Override + public int getSignaturesCount() { + return signatures_.size(); + } + /** + * repeated .chromeos_update_engine.Signatures.Signature signatures = 1; + */ + @java.lang.Override + public chromeos_update_engine.UpdateMetadata.Signatures.Signature getSignatures(int index) { + return signatures_.get(index); + } + /** + * repeated .chromeos_update_engine.Signatures.Signature signatures = 1; + */ + @java.lang.Override + public chromeos_update_engine.UpdateMetadata.Signatures.SignatureOrBuilder getSignaturesOrBuilder( + int index) { + return signatures_.get(index); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + for (int i = 0; i < signatures_.size(); i++) { + output.writeMessage(1, signatures_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < signatures_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, signatures_.get(i)); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof chromeos_update_engine.UpdateMetadata.Signatures)) { + return super.equals(obj); + } + chromeos_update_engine.UpdateMetadata.Signatures other = (chromeos_update_engine.UpdateMetadata.Signatures) obj; + + if (!getSignaturesList() + .equals(other.getSignaturesList())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getSignaturesCount() > 0) { + hash = (37 * hash) + SIGNATURES_FIELD_NUMBER; + hash = (53 * hash) + getSignaturesList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static chromeos_update_engine.UpdateMetadata.Signatures parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static chromeos_update_engine.UpdateMetadata.Signatures parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static chromeos_update_engine.UpdateMetadata.Signatures parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static chromeos_update_engine.UpdateMetadata.Signatures parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static chromeos_update_engine.UpdateMetadata.Signatures parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static chromeos_update_engine.UpdateMetadata.Signatures parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static chromeos_update_engine.UpdateMetadata.Signatures parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static chromeos_update_engine.UpdateMetadata.Signatures parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static chromeos_update_engine.UpdateMetadata.Signatures parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static chromeos_update_engine.UpdateMetadata.Signatures parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static chromeos_update_engine.UpdateMetadata.Signatures parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static chromeos_update_engine.UpdateMetadata.Signatures parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(chromeos_update_engine.UpdateMetadata.Signatures prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code chromeos_update_engine.Signatures} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:chromeos_update_engine.Signatures) + chromeos_update_engine.UpdateMetadata.SignaturesOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return chromeos_update_engine.UpdateMetadata.internal_static_chromeos_update_engine_Signatures_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return chromeos_update_engine.UpdateMetadata.internal_static_chromeos_update_engine_Signatures_fieldAccessorTable + .ensureFieldAccessorsInitialized( + chromeos_update_engine.UpdateMetadata.Signatures.class, chromeos_update_engine.UpdateMetadata.Signatures.Builder.class); + } + + // Construct using chromeos_update_engine.UpdateMetadata.Signatures.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getSignaturesFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (signaturesBuilder_ == null) { + signatures_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + signaturesBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return chromeos_update_engine.UpdateMetadata.internal_static_chromeos_update_engine_Signatures_descriptor; + } + + @java.lang.Override + public chromeos_update_engine.UpdateMetadata.Signatures getDefaultInstanceForType() { + return chromeos_update_engine.UpdateMetadata.Signatures.getDefaultInstance(); + } + + @java.lang.Override + public chromeos_update_engine.UpdateMetadata.Signatures build() { + chromeos_update_engine.UpdateMetadata.Signatures result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public chromeos_update_engine.UpdateMetadata.Signatures buildPartial() { + chromeos_update_engine.UpdateMetadata.Signatures result = new chromeos_update_engine.UpdateMetadata.Signatures(this); + int from_bitField0_ = bitField0_; + if (signaturesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + signatures_ = java.util.Collections.unmodifiableList(signatures_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.signatures_ = signatures_; + } else { + result.signatures_ = signaturesBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof chromeos_update_engine.UpdateMetadata.Signatures) { + return mergeFrom((chromeos_update_engine.UpdateMetadata.Signatures)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(chromeos_update_engine.UpdateMetadata.Signatures other) { + if (other == chromeos_update_engine.UpdateMetadata.Signatures.getDefaultInstance()) return this; + if (signaturesBuilder_ == null) { + if (!other.signatures_.isEmpty()) { + if (signatures_.isEmpty()) { + signatures_ = other.signatures_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureSignaturesIsMutable(); + signatures_.addAll(other.signatures_); + } + onChanged(); + } + } else { + if (!other.signatures_.isEmpty()) { + if (signaturesBuilder_.isEmpty()) { + signaturesBuilder_.dispose(); + signaturesBuilder_ = null; + signatures_ = other.signatures_; + bitField0_ = (bitField0_ & ~0x00000001); + signaturesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getSignaturesFieldBuilder() : null; + } else { + signaturesBuilder_.addAllMessages(other.signatures_); + } + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + chromeos_update_engine.UpdateMetadata.Signatures parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (chromeos_update_engine.UpdateMetadata.Signatures) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.util.List signatures_ = + java.util.Collections.emptyList(); + private void ensureSignaturesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + signatures_ = new java.util.ArrayList(signatures_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + chromeos_update_engine.UpdateMetadata.Signatures.Signature, chromeos_update_engine.UpdateMetadata.Signatures.Signature.Builder, chromeos_update_engine.UpdateMetadata.Signatures.SignatureOrBuilder> signaturesBuilder_; + + /** + * repeated .chromeos_update_engine.Signatures.Signature signatures = 1; + */ + public java.util.List getSignaturesList() { + if (signaturesBuilder_ == null) { + return java.util.Collections.unmodifiableList(signatures_); + } else { + return signaturesBuilder_.getMessageList(); + } + } + /** + * repeated .chromeos_update_engine.Signatures.Signature signatures = 1; + */ + public int getSignaturesCount() { + if (signaturesBuilder_ == null) { + return signatures_.size(); + } else { + return signaturesBuilder_.getCount(); + } + } + /** + * repeated .chromeos_update_engine.Signatures.Signature signatures = 1; + */ + public chromeos_update_engine.UpdateMetadata.Signatures.Signature getSignatures(int index) { + if (signaturesBuilder_ == null) { + return signatures_.get(index); + } else { + return signaturesBuilder_.getMessage(index); + } + } + /** + * repeated .chromeos_update_engine.Signatures.Signature signatures = 1; + */ + public Builder setSignatures( + int index, chromeos_update_engine.UpdateMetadata.Signatures.Signature value) { + if (signaturesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSignaturesIsMutable(); + signatures_.set(index, value); + onChanged(); + } else { + signaturesBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .chromeos_update_engine.Signatures.Signature signatures = 1; + */ + public Builder setSignatures( + int index, chromeos_update_engine.UpdateMetadata.Signatures.Signature.Builder builderForValue) { + if (signaturesBuilder_ == null) { + ensureSignaturesIsMutable(); + signatures_.set(index, builderForValue.build()); + onChanged(); + } else { + signaturesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .chromeos_update_engine.Signatures.Signature signatures = 1; + */ + public Builder addSignatures(chromeos_update_engine.UpdateMetadata.Signatures.Signature value) { + if (signaturesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSignaturesIsMutable(); + signatures_.add(value); + onChanged(); + } else { + signaturesBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .chromeos_update_engine.Signatures.Signature signatures = 1; + */ + public Builder addSignatures( + int index, chromeos_update_engine.UpdateMetadata.Signatures.Signature value) { + if (signaturesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSignaturesIsMutable(); + signatures_.add(index, value); + onChanged(); + } else { + signaturesBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .chromeos_update_engine.Signatures.Signature signatures = 1; + */ + public Builder addSignatures( + chromeos_update_engine.UpdateMetadata.Signatures.Signature.Builder builderForValue) { + if (signaturesBuilder_ == null) { + ensureSignaturesIsMutable(); + signatures_.add(builderForValue.build()); + onChanged(); + } else { + signaturesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .chromeos_update_engine.Signatures.Signature signatures = 1; + */ + public Builder addSignatures( + int index, chromeos_update_engine.UpdateMetadata.Signatures.Signature.Builder builderForValue) { + if (signaturesBuilder_ == null) { + ensureSignaturesIsMutable(); + signatures_.add(index, builderForValue.build()); + onChanged(); + } else { + signaturesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .chromeos_update_engine.Signatures.Signature signatures = 1; + */ + public Builder addAllSignatures( + java.lang.Iterable values) { + if (signaturesBuilder_ == null) { + ensureSignaturesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, signatures_); + onChanged(); + } else { + signaturesBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .chromeos_update_engine.Signatures.Signature signatures = 1; + */ + public Builder clearSignatures() { + if (signaturesBuilder_ == null) { + signatures_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + signaturesBuilder_.clear(); + } + return this; + } + /** + * repeated .chromeos_update_engine.Signatures.Signature signatures = 1; + */ + public Builder removeSignatures(int index) { + if (signaturesBuilder_ == null) { + ensureSignaturesIsMutable(); + signatures_.remove(index); + onChanged(); + } else { + signaturesBuilder_.remove(index); + } + return this; + } + /** + * repeated .chromeos_update_engine.Signatures.Signature signatures = 1; + */ + public chromeos_update_engine.UpdateMetadata.Signatures.Signature.Builder getSignaturesBuilder( + int index) { + return getSignaturesFieldBuilder().getBuilder(index); + } + /** + * repeated .chromeos_update_engine.Signatures.Signature signatures = 1; + */ + public chromeos_update_engine.UpdateMetadata.Signatures.SignatureOrBuilder getSignaturesOrBuilder( + int index) { + if (signaturesBuilder_ == null) { + return signatures_.get(index); } else { + return signaturesBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .chromeos_update_engine.Signatures.Signature signatures = 1; + */ + public java.util.List + getSignaturesOrBuilderList() { + if (signaturesBuilder_ != null) { + return signaturesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(signatures_); + } + } + /** + * repeated .chromeos_update_engine.Signatures.Signature signatures = 1; + */ + public chromeos_update_engine.UpdateMetadata.Signatures.Signature.Builder addSignaturesBuilder() { + return getSignaturesFieldBuilder().addBuilder( + chromeos_update_engine.UpdateMetadata.Signatures.Signature.getDefaultInstance()); + } + /** + * repeated .chromeos_update_engine.Signatures.Signature signatures = 1; + */ + public chromeos_update_engine.UpdateMetadata.Signatures.Signature.Builder addSignaturesBuilder( + int index) { + return getSignaturesFieldBuilder().addBuilder( + index, chromeos_update_engine.UpdateMetadata.Signatures.Signature.getDefaultInstance()); + } + /** + * repeated .chromeos_update_engine.Signatures.Signature signatures = 1; + */ + public java.util.List + getSignaturesBuilderList() { + return getSignaturesFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + chromeos_update_engine.UpdateMetadata.Signatures.Signature, chromeos_update_engine.UpdateMetadata.Signatures.Signature.Builder, chromeos_update_engine.UpdateMetadata.Signatures.SignatureOrBuilder> + getSignaturesFieldBuilder() { + if (signaturesBuilder_ == null) { + signaturesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + chromeos_update_engine.UpdateMetadata.Signatures.Signature, chromeos_update_engine.UpdateMetadata.Signatures.Signature.Builder, chromeos_update_engine.UpdateMetadata.Signatures.SignatureOrBuilder>( + signatures_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + signatures_ = null; + } + return signaturesBuilder_; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:chromeos_update_engine.Signatures) + } + + // @@protoc_insertion_point(class_scope:chromeos_update_engine.Signatures) + private static final chromeos_update_engine.UpdateMetadata.Signatures DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new chromeos_update_engine.UpdateMetadata.Signatures(); + } + + public static chromeos_update_engine.UpdateMetadata.Signatures getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @java.lang.Deprecated public static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Signatures parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Signatures(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public chromeos_update_engine.UpdateMetadata.Signatures getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface PartitionInfoOrBuilder extends + // @@protoc_insertion_point(interface_extends:chromeos_update_engine.PartitionInfo) + com.google.protobuf.MessageOrBuilder { + + /** + * optional uint64 size = 1; + * @return Whether the size field is set. + */ + boolean hasSize(); + /** + * optional uint64 size = 1; + * @return The size. + */ + long getSize(); + + /** + * optional bytes hash = 2; + * @return Whether the hash field is set. + */ + boolean hasHash(); + /** + * optional bytes hash = 2; + * @return The hash. + */ + com.google.protobuf.ByteString getHash(); + } + /** + * Protobuf type {@code chromeos_update_engine.PartitionInfo} + */ + public static final class PartitionInfo extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:chromeos_update_engine.PartitionInfo) + PartitionInfoOrBuilder { + private static final long serialVersionUID = 0L; + // Use PartitionInfo.newBuilder() to construct. + private PartitionInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private PartitionInfo() { + hash_ = com.google.protobuf.ByteString.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new PartitionInfo(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private PartitionInfo( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + bitField0_ |= 0x00000001; + size_ = input.readUInt64(); + break; + } + case 18: { + bitField0_ |= 0x00000002; + hash_ = input.readBytes(); + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return chromeos_update_engine.UpdateMetadata.internal_static_chromeos_update_engine_PartitionInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return chromeos_update_engine.UpdateMetadata.internal_static_chromeos_update_engine_PartitionInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + chromeos_update_engine.UpdateMetadata.PartitionInfo.class, chromeos_update_engine.UpdateMetadata.PartitionInfo.Builder.class); + } + + private int bitField0_; + public static final int SIZE_FIELD_NUMBER = 1; + private long size_; + /** + * optional uint64 size = 1; + * @return Whether the size field is set. + */ + @java.lang.Override + public boolean hasSize() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * optional uint64 size = 1; + * @return The size. + */ + @java.lang.Override + public long getSize() { + return size_; + } + + public static final int HASH_FIELD_NUMBER = 2; + private com.google.protobuf.ByteString hash_; + /** + * optional bytes hash = 2; + * @return Whether the hash field is set. + */ + @java.lang.Override + public boolean hasHash() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * optional bytes hash = 2; + * @return The hash. + */ + @java.lang.Override + public com.google.protobuf.ByteString getHash() { + return hash_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + output.writeUInt64(1, size_); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeBytes(2, hash_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(1, size_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(2, hash_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof chromeos_update_engine.UpdateMetadata.PartitionInfo)) { + return super.equals(obj); + } + chromeos_update_engine.UpdateMetadata.PartitionInfo other = (chromeos_update_engine.UpdateMetadata.PartitionInfo) obj; + + if (hasSize() != other.hasSize()) return false; + if (hasSize()) { + if (getSize() + != other.getSize()) return false; + } + if (hasHash() != other.hasHash()) return false; + if (hasHash()) { + if (!getHash() + .equals(other.getHash())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasSize()) { + hash = (37 * hash) + SIZE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getSize()); + } + if (hasHash()) { + hash = (37 * hash) + HASH_FIELD_NUMBER; + hash = (53 * hash) + getHash().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static chromeos_update_engine.UpdateMetadata.PartitionInfo parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static chromeos_update_engine.UpdateMetadata.PartitionInfo parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static chromeos_update_engine.UpdateMetadata.PartitionInfo parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static chromeos_update_engine.UpdateMetadata.PartitionInfo parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static chromeos_update_engine.UpdateMetadata.PartitionInfo parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static chromeos_update_engine.UpdateMetadata.PartitionInfo parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static chromeos_update_engine.UpdateMetadata.PartitionInfo parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static chromeos_update_engine.UpdateMetadata.PartitionInfo parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static chromeos_update_engine.UpdateMetadata.PartitionInfo parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static chromeos_update_engine.UpdateMetadata.PartitionInfo parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static chromeos_update_engine.UpdateMetadata.PartitionInfo parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static chromeos_update_engine.UpdateMetadata.PartitionInfo parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(chromeos_update_engine.UpdateMetadata.PartitionInfo prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code chromeos_update_engine.PartitionInfo} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:chromeos_update_engine.PartitionInfo) + chromeos_update_engine.UpdateMetadata.PartitionInfoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return chromeos_update_engine.UpdateMetadata.internal_static_chromeos_update_engine_PartitionInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return chromeos_update_engine.UpdateMetadata.internal_static_chromeos_update_engine_PartitionInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + chromeos_update_engine.UpdateMetadata.PartitionInfo.class, chromeos_update_engine.UpdateMetadata.PartitionInfo.Builder.class); + } + + // Construct using chromeos_update_engine.UpdateMetadata.PartitionInfo.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + size_ = 0L; + bitField0_ = (bitField0_ & ~0x00000001); + hash_ = com.google.protobuf.ByteString.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return chromeos_update_engine.UpdateMetadata.internal_static_chromeos_update_engine_PartitionInfo_descriptor; + } + + @java.lang.Override + public chromeos_update_engine.UpdateMetadata.PartitionInfo getDefaultInstanceForType() { + return chromeos_update_engine.UpdateMetadata.PartitionInfo.getDefaultInstance(); + } + + @java.lang.Override + public chromeos_update_engine.UpdateMetadata.PartitionInfo build() { + chromeos_update_engine.UpdateMetadata.PartitionInfo result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public chromeos_update_engine.UpdateMetadata.PartitionInfo buildPartial() { + chromeos_update_engine.UpdateMetadata.PartitionInfo result = new chromeos_update_engine.UpdateMetadata.PartitionInfo(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.size_ = size_; + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + to_bitField0_ |= 0x00000002; + } + result.hash_ = hash_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof chromeos_update_engine.UpdateMetadata.PartitionInfo) { + return mergeFrom((chromeos_update_engine.UpdateMetadata.PartitionInfo)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(chromeos_update_engine.UpdateMetadata.PartitionInfo other) { + if (other == chromeos_update_engine.UpdateMetadata.PartitionInfo.getDefaultInstance()) return this; + if (other.hasSize()) { + setSize(other.getSize()); + } + if (other.hasHash()) { + setHash(other.getHash()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + chromeos_update_engine.UpdateMetadata.PartitionInfo parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (chromeos_update_engine.UpdateMetadata.PartitionInfo) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private long size_ ; + /** + * optional uint64 size = 1; + * @return Whether the size field is set. + */ + @java.lang.Override + public boolean hasSize() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * optional uint64 size = 1; + * @return The size. + */ + @java.lang.Override + public long getSize() { + return size_; + } + /** + * optional uint64 size = 1; + * @param value The size to set. + * @return This builder for chaining. + */ + public Builder setSize(long value) { + bitField0_ |= 0x00000001; + size_ = value; + onChanged(); + return this; + } + /** + * optional uint64 size = 1; + * @return This builder for chaining. + */ + public Builder clearSize() { + bitField0_ = (bitField0_ & ~0x00000001); + size_ = 0L; + onChanged(); + return this; + } + + private com.google.protobuf.ByteString hash_ = com.google.protobuf.ByteString.EMPTY; + /** + * optional bytes hash = 2; + * @return Whether the hash field is set. + */ + @java.lang.Override + public boolean hasHash() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * optional bytes hash = 2; + * @return The hash. + */ + @java.lang.Override + public com.google.protobuf.ByteString getHash() { + return hash_; + } + /** + * optional bytes hash = 2; + * @param value The hash to set. + * @return This builder for chaining. + */ + public Builder setHash(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + hash_ = value; + onChanged(); + return this; + } + /** + * optional bytes hash = 2; + * @return This builder for chaining. + */ + public Builder clearHash() { + bitField0_ = (bitField0_ & ~0x00000002); + hash_ = getDefaultInstance().getHash(); + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:chromeos_update_engine.PartitionInfo) + } + + // @@protoc_insertion_point(class_scope:chromeos_update_engine.PartitionInfo) + private static final chromeos_update_engine.UpdateMetadata.PartitionInfo DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new chromeos_update_engine.UpdateMetadata.PartitionInfo(); + } + + public static chromeos_update_engine.UpdateMetadata.PartitionInfo getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @java.lang.Deprecated public static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PartitionInfo parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new PartitionInfo(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public chromeos_update_engine.UpdateMetadata.PartitionInfo getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface ImageInfoOrBuilder extends + // @@protoc_insertion_point(interface_extends:chromeos_update_engine.ImageInfo) + com.google.protobuf.MessageOrBuilder { + + /** + * optional string board = 1; + * @return Whether the board field is set. + */ + boolean hasBoard(); + /** + * optional string board = 1; + * @return The board. + */ + java.lang.String getBoard(); + /** + * optional string board = 1; + * @return The bytes for board. + */ + com.google.protobuf.ByteString + getBoardBytes(); + + /** + * optional string key = 2; + * @return Whether the key field is set. + */ + boolean hasKey(); + /** + * optional string key = 2; + * @return The key. + */ + java.lang.String getKey(); + /** + * optional string key = 2; + * @return The bytes for key. + */ + com.google.protobuf.ByteString + getKeyBytes(); + + /** + * optional string channel = 3; + * @return Whether the channel field is set. + */ + boolean hasChannel(); + /** + * optional string channel = 3; + * @return The channel. + */ + java.lang.String getChannel(); + /** + * optional string channel = 3; + * @return The bytes for channel. + */ + com.google.protobuf.ByteString + getChannelBytes(); + + /** + * optional string version = 4; + * @return Whether the version field is set. + */ + boolean hasVersion(); + /** + * optional string version = 4; + * @return The version. + */ + java.lang.String getVersion(); + /** + * optional string version = 4; + * @return The bytes for version. + */ + com.google.protobuf.ByteString + getVersionBytes(); + + /** + *
+     * If these values aren't present, they should be assumed to match
+     * the equivalent value above. They are normally only different for
+     * special image types such as nplusone images.
+     * 
+ * + * optional string build_channel = 5; + * @return Whether the buildChannel field is set. + */ + boolean hasBuildChannel(); + /** + *
+     * If these values aren't present, they should be assumed to match
+     * the equivalent value above. They are normally only different for
+     * special image types such as nplusone images.
+     * 
+ * + * optional string build_channel = 5; + * @return The buildChannel. + */ + java.lang.String getBuildChannel(); + /** + *
+     * If these values aren't present, they should be assumed to match
+     * the equivalent value above. They are normally only different for
+     * special image types such as nplusone images.
+     * 
+ * + * optional string build_channel = 5; + * @return The bytes for buildChannel. + */ + com.google.protobuf.ByteString + getBuildChannelBytes(); + + /** + * optional string build_version = 6; + * @return Whether the buildVersion field is set. + */ + boolean hasBuildVersion(); + /** + * optional string build_version = 6; + * @return The buildVersion. + */ + java.lang.String getBuildVersion(); + /** + * optional string build_version = 6; + * @return The bytes for buildVersion. + */ + com.google.protobuf.ByteString + getBuildVersionBytes(); + } + /** + *
+   * Describe an image we are based on in a human friendly way.
+   * Examples:
+   *   dev-channel, x86-alex, 1.2.3, mp-v3
+   *   nplusone-channel, x86-alex, 1.2.4, mp-v3, dev-channel, 1.2.3
+   * All fields will be set, if this message is present.
+   * 
+ * + * Protobuf type {@code chromeos_update_engine.ImageInfo} + */ + public static final class ImageInfo extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:chromeos_update_engine.ImageInfo) + ImageInfoOrBuilder { + private static final long serialVersionUID = 0L; + // Use ImageInfo.newBuilder() to construct. + private ImageInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ImageInfo() { + board_ = ""; + key_ = ""; + channel_ = ""; + version_ = ""; + buildChannel_ = ""; + buildVersion_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new ImageInfo(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ImageInfo( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + com.google.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00000001; + board_ = bs; + break; + } + case 18: { + com.google.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00000002; + key_ = bs; + break; + } + case 26: { + com.google.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00000004; + channel_ = bs; + break; + } + case 34: { + com.google.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00000008; + version_ = bs; + break; + } + case 42: { + com.google.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00000010; + buildChannel_ = bs; + break; + } + case 50: { + com.google.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00000020; + buildVersion_ = bs; + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return chromeos_update_engine.UpdateMetadata.internal_static_chromeos_update_engine_ImageInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return chromeos_update_engine.UpdateMetadata.internal_static_chromeos_update_engine_ImageInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + chromeos_update_engine.UpdateMetadata.ImageInfo.class, chromeos_update_engine.UpdateMetadata.ImageInfo.Builder.class); + } + + private int bitField0_; + public static final int BOARD_FIELD_NUMBER = 1; + private volatile java.lang.Object board_; + /** + * optional string board = 1; + * @return Whether the board field is set. + */ + @java.lang.Override + public boolean hasBoard() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * optional string board = 1; + * @return The board. + */ + @java.lang.Override + public java.lang.String getBoard() { + java.lang.Object ref = board_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + board_ = s; + } + return s; + } + } + /** + * optional string board = 1; + * @return The bytes for board. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getBoardBytes() { + java.lang.Object ref = board_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + board_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int KEY_FIELD_NUMBER = 2; + private volatile java.lang.Object key_; + /** + * optional string key = 2; + * @return Whether the key field is set. + */ + @java.lang.Override + public boolean hasKey() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * optional string key = 2; + * @return The key. + */ + @java.lang.Override + public java.lang.String getKey() { + java.lang.Object ref = key_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + key_ = s; + } + return s; + } + } + /** + * optional string key = 2; + * @return The bytes for key. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getKeyBytes() { + java.lang.Object ref = key_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + key_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CHANNEL_FIELD_NUMBER = 3; + private volatile java.lang.Object channel_; + /** + * optional string channel = 3; + * @return Whether the channel field is set. + */ + @java.lang.Override + public boolean hasChannel() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * optional string channel = 3; + * @return The channel. + */ + @java.lang.Override + public java.lang.String getChannel() { + java.lang.Object ref = channel_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + channel_ = s; + } + return s; + } + } + /** + * optional string channel = 3; + * @return The bytes for channel. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getChannelBytes() { + java.lang.Object ref = channel_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + channel_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VERSION_FIELD_NUMBER = 4; + private volatile java.lang.Object version_; + /** + * optional string version = 4; + * @return Whether the version field is set. + */ + @java.lang.Override + public boolean hasVersion() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + * optional string version = 4; + * @return The version. + */ + @java.lang.Override + public java.lang.String getVersion() { + java.lang.Object ref = version_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + version_ = s; + } + return s; + } + } + /** + * optional string version = 4; + * @return The bytes for version. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getVersionBytes() { + java.lang.Object ref = version_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + version_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int BUILD_CHANNEL_FIELD_NUMBER = 5; + private volatile java.lang.Object buildChannel_; + /** + *
+     * If these values aren't present, they should be assumed to match
+     * the equivalent value above. They are normally only different for
+     * special image types such as nplusone images.
+     * 
+ * + * optional string build_channel = 5; + * @return Whether the buildChannel field is set. + */ + @java.lang.Override + public boolean hasBuildChannel() { + return ((bitField0_ & 0x00000010) != 0); + } + /** + *
+     * If these values aren't present, they should be assumed to match
+     * the equivalent value above. They are normally only different for
+     * special image types such as nplusone images.
+     * 
+ * + * optional string build_channel = 5; + * @return The buildChannel. + */ + @java.lang.Override + public java.lang.String getBuildChannel() { + java.lang.Object ref = buildChannel_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + buildChannel_ = s; + } + return s; + } + } + /** + *
+     * If these values aren't present, they should be assumed to match
+     * the equivalent value above. They are normally only different for
+     * special image types such as nplusone images.
+     * 
+ * + * optional string build_channel = 5; + * @return The bytes for buildChannel. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getBuildChannelBytes() { + java.lang.Object ref = buildChannel_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + buildChannel_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int BUILD_VERSION_FIELD_NUMBER = 6; + private volatile java.lang.Object buildVersion_; + /** + * optional string build_version = 6; + * @return Whether the buildVersion field is set. + */ + @java.lang.Override + public boolean hasBuildVersion() { + return ((bitField0_ & 0x00000020) != 0); + } + /** + * optional string build_version = 6; + * @return The buildVersion. + */ + @java.lang.Override + public java.lang.String getBuildVersion() { + java.lang.Object ref = buildVersion_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + buildVersion_ = s; + } + return s; + } + } + /** + * optional string build_version = 6; + * @return The bytes for buildVersion. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getBuildVersionBytes() { + java.lang.Object ref = buildVersion_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + buildVersion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, board_); + } + if (((bitField0_ & 0x00000002) != 0)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, key_); + } + if (((bitField0_ & 0x00000004) != 0)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, channel_); + } + if (((bitField0_ & 0x00000008) != 0)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, version_); + } + if (((bitField0_ & 0x00000010) != 0)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, buildChannel_); + } + if (((bitField0_ & 0x00000020) != 0)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, buildVersion_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, board_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, key_); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, channel_); + } + if (((bitField0_ & 0x00000008) != 0)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, version_); + } + if (((bitField0_ & 0x00000010) != 0)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, buildChannel_); + } + if (((bitField0_ & 0x00000020) != 0)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, buildVersion_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof chromeos_update_engine.UpdateMetadata.ImageInfo)) { + return super.equals(obj); + } + chromeos_update_engine.UpdateMetadata.ImageInfo other = (chromeos_update_engine.UpdateMetadata.ImageInfo) obj; + + if (hasBoard() != other.hasBoard()) return false; + if (hasBoard()) { + if (!getBoard() + .equals(other.getBoard())) return false; + } + if (hasKey() != other.hasKey()) return false; + if (hasKey()) { + if (!getKey() + .equals(other.getKey())) return false; + } + if (hasChannel() != other.hasChannel()) return false; + if (hasChannel()) { + if (!getChannel() + .equals(other.getChannel())) return false; + } + if (hasVersion() != other.hasVersion()) return false; + if (hasVersion()) { + if (!getVersion() + .equals(other.getVersion())) return false; + } + if (hasBuildChannel() != other.hasBuildChannel()) return false; + if (hasBuildChannel()) { + if (!getBuildChannel() + .equals(other.getBuildChannel())) return false; + } + if (hasBuildVersion() != other.hasBuildVersion()) return false; + if (hasBuildVersion()) { + if (!getBuildVersion() + .equals(other.getBuildVersion())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasBoard()) { + hash = (37 * hash) + BOARD_FIELD_NUMBER; + hash = (53 * hash) + getBoard().hashCode(); + } + if (hasKey()) { + hash = (37 * hash) + KEY_FIELD_NUMBER; + hash = (53 * hash) + getKey().hashCode(); + } + if (hasChannel()) { + hash = (37 * hash) + CHANNEL_FIELD_NUMBER; + hash = (53 * hash) + getChannel().hashCode(); + } + if (hasVersion()) { + hash = (37 * hash) + VERSION_FIELD_NUMBER; + hash = (53 * hash) + getVersion().hashCode(); + } + if (hasBuildChannel()) { + hash = (37 * hash) + BUILD_CHANNEL_FIELD_NUMBER; + hash = (53 * hash) + getBuildChannel().hashCode(); + } + if (hasBuildVersion()) { + hash = (37 * hash) + BUILD_VERSION_FIELD_NUMBER; + hash = (53 * hash) + getBuildVersion().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static chromeos_update_engine.UpdateMetadata.ImageInfo parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static chromeos_update_engine.UpdateMetadata.ImageInfo parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static chromeos_update_engine.UpdateMetadata.ImageInfo parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static chromeos_update_engine.UpdateMetadata.ImageInfo parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static chromeos_update_engine.UpdateMetadata.ImageInfo parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static chromeos_update_engine.UpdateMetadata.ImageInfo parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static chromeos_update_engine.UpdateMetadata.ImageInfo parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static chromeos_update_engine.UpdateMetadata.ImageInfo parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static chromeos_update_engine.UpdateMetadata.ImageInfo parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static chromeos_update_engine.UpdateMetadata.ImageInfo parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static chromeos_update_engine.UpdateMetadata.ImageInfo parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static chromeos_update_engine.UpdateMetadata.ImageInfo parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(chromeos_update_engine.UpdateMetadata.ImageInfo prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+     * Describe an image we are based on in a human friendly way.
+     * Examples:
+     *   dev-channel, x86-alex, 1.2.3, mp-v3
+     *   nplusone-channel, x86-alex, 1.2.4, mp-v3, dev-channel, 1.2.3
+     * All fields will be set, if this message is present.
+     * 
+ * + * Protobuf type {@code chromeos_update_engine.ImageInfo} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:chromeos_update_engine.ImageInfo) + chromeos_update_engine.UpdateMetadata.ImageInfoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return chromeos_update_engine.UpdateMetadata.internal_static_chromeos_update_engine_ImageInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return chromeos_update_engine.UpdateMetadata.internal_static_chromeos_update_engine_ImageInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + chromeos_update_engine.UpdateMetadata.ImageInfo.class, chromeos_update_engine.UpdateMetadata.ImageInfo.Builder.class); + } + + // Construct using chromeos_update_engine.UpdateMetadata.ImageInfo.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + board_ = ""; + bitField0_ = (bitField0_ & ~0x00000001); + key_ = ""; + bitField0_ = (bitField0_ & ~0x00000002); + channel_ = ""; + bitField0_ = (bitField0_ & ~0x00000004); + version_ = ""; + bitField0_ = (bitField0_ & ~0x00000008); + buildChannel_ = ""; + bitField0_ = (bitField0_ & ~0x00000010); + buildVersion_ = ""; + bitField0_ = (bitField0_ & ~0x00000020); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return chromeos_update_engine.UpdateMetadata.internal_static_chromeos_update_engine_ImageInfo_descriptor; + } + + @java.lang.Override + public chromeos_update_engine.UpdateMetadata.ImageInfo getDefaultInstanceForType() { + return chromeos_update_engine.UpdateMetadata.ImageInfo.getDefaultInstance(); + } + + @java.lang.Override + public chromeos_update_engine.UpdateMetadata.ImageInfo build() { + chromeos_update_engine.UpdateMetadata.ImageInfo result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public chromeos_update_engine.UpdateMetadata.ImageInfo buildPartial() { + chromeos_update_engine.UpdateMetadata.ImageInfo result = new chromeos_update_engine.UpdateMetadata.ImageInfo(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + to_bitField0_ |= 0x00000001; + } + result.board_ = board_; + if (((from_bitField0_ & 0x00000002) != 0)) { + to_bitField0_ |= 0x00000002; + } + result.key_ = key_; + if (((from_bitField0_ & 0x00000004) != 0)) { + to_bitField0_ |= 0x00000004; + } + result.channel_ = channel_; + if (((from_bitField0_ & 0x00000008) != 0)) { + to_bitField0_ |= 0x00000008; + } + result.version_ = version_; + if (((from_bitField0_ & 0x00000010) != 0)) { + to_bitField0_ |= 0x00000010; + } + result.buildChannel_ = buildChannel_; + if (((from_bitField0_ & 0x00000020) != 0)) { + to_bitField0_ |= 0x00000020; + } + result.buildVersion_ = buildVersion_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof chromeos_update_engine.UpdateMetadata.ImageInfo) { + return mergeFrom((chromeos_update_engine.UpdateMetadata.ImageInfo)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(chromeos_update_engine.UpdateMetadata.ImageInfo other) { + if (other == chromeos_update_engine.UpdateMetadata.ImageInfo.getDefaultInstance()) return this; + if (other.hasBoard()) { + bitField0_ |= 0x00000001; + board_ = other.board_; + onChanged(); + } + if (other.hasKey()) { + bitField0_ |= 0x00000002; + key_ = other.key_; + onChanged(); + } + if (other.hasChannel()) { + bitField0_ |= 0x00000004; + channel_ = other.channel_; + onChanged(); + } + if (other.hasVersion()) { + bitField0_ |= 0x00000008; + version_ = other.version_; + onChanged(); + } + if (other.hasBuildChannel()) { + bitField0_ |= 0x00000010; + buildChannel_ = other.buildChannel_; + onChanged(); + } + if (other.hasBuildVersion()) { + bitField0_ |= 0x00000020; + buildVersion_ = other.buildVersion_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + chromeos_update_engine.UpdateMetadata.ImageInfo parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (chromeos_update_engine.UpdateMetadata.ImageInfo) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.lang.Object board_ = ""; + /** + * optional string board = 1; + * @return Whether the board field is set. + */ + public boolean hasBoard() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * optional string board = 1; + * @return The board. + */ + public java.lang.String getBoard() { + java.lang.Object ref = board_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + board_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * optional string board = 1; + * @return The bytes for board. + */ + public com.google.protobuf.ByteString + getBoardBytes() { + java.lang.Object ref = board_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + board_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * optional string board = 1; + * @param value The board to set. + * @return This builder for chaining. + */ + public Builder setBoard( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + board_ = value; + onChanged(); + return this; + } + /** + * optional string board = 1; + * @return This builder for chaining. + */ + public Builder clearBoard() { + bitField0_ = (bitField0_ & ~0x00000001); + board_ = getDefaultInstance().getBoard(); + onChanged(); + return this; + } + /** + * optional string board = 1; + * @param value The bytes for board to set. + * @return This builder for chaining. + */ + public Builder setBoardBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + board_ = value; + onChanged(); + return this; + } + + private java.lang.Object key_ = ""; + /** + * optional string key = 2; + * @return Whether the key field is set. + */ + public boolean hasKey() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * optional string key = 2; + * @return The key. + */ + public java.lang.String getKey() { + java.lang.Object ref = key_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + key_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * optional string key = 2; + * @return The bytes for key. + */ + public com.google.protobuf.ByteString + getKeyBytes() { + java.lang.Object ref = key_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + key_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * optional string key = 2; + * @param value The key to set. + * @return This builder for chaining. + */ + public Builder setKey( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + key_ = value; + onChanged(); + return this; + } + /** + * optional string key = 2; + * @return This builder for chaining. + */ + public Builder clearKey() { + bitField0_ = (bitField0_ & ~0x00000002); + key_ = getDefaultInstance().getKey(); + onChanged(); + return this; + } + /** + * optional string key = 2; + * @param value The bytes for key to set. + * @return This builder for chaining. + */ + public Builder setKeyBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + key_ = value; + onChanged(); + return this; + } + + private java.lang.Object channel_ = ""; + /** + * optional string channel = 3; + * @return Whether the channel field is set. + */ + public boolean hasChannel() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * optional string channel = 3; + * @return The channel. + */ + public java.lang.String getChannel() { + java.lang.Object ref = channel_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + channel_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * optional string channel = 3; + * @return The bytes for channel. + */ + public com.google.protobuf.ByteString + getChannelBytes() { + java.lang.Object ref = channel_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + channel_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * optional string channel = 3; + * @param value The channel to set. + * @return This builder for chaining. + */ + public Builder setChannel( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000004; + channel_ = value; + onChanged(); + return this; + } + /** + * optional string channel = 3; + * @return This builder for chaining. + */ + public Builder clearChannel() { + bitField0_ = (bitField0_ & ~0x00000004); + channel_ = getDefaultInstance().getChannel(); + onChanged(); + return this; + } + /** + * optional string channel = 3; + * @param value The bytes for channel to set. + * @return This builder for chaining. + */ + public Builder setChannelBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000004; + channel_ = value; + onChanged(); + return this; + } + + private java.lang.Object version_ = ""; + /** + * optional string version = 4; + * @return Whether the version field is set. + */ + public boolean hasVersion() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + * optional string version = 4; + * @return The version. + */ + public java.lang.String getVersion() { + java.lang.Object ref = version_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + version_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * optional string version = 4; + * @return The bytes for version. + */ + public com.google.protobuf.ByteString + getVersionBytes() { + java.lang.Object ref = version_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + version_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * optional string version = 4; + * @param value The version to set. + * @return This builder for chaining. + */ + public Builder setVersion( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000008; + version_ = value; + onChanged(); + return this; + } + /** + * optional string version = 4; + * @return This builder for chaining. + */ + public Builder clearVersion() { + bitField0_ = (bitField0_ & ~0x00000008); + version_ = getDefaultInstance().getVersion(); + onChanged(); + return this; + } + /** + * optional string version = 4; + * @param value The bytes for version to set. + * @return This builder for chaining. + */ + public Builder setVersionBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000008; + version_ = value; + onChanged(); + return this; + } + + private java.lang.Object buildChannel_ = ""; + /** + *
+       * If these values aren't present, they should be assumed to match
+       * the equivalent value above. They are normally only different for
+       * special image types such as nplusone images.
+       * 
+ * + * optional string build_channel = 5; + * @return Whether the buildChannel field is set. + */ + public boolean hasBuildChannel() { + return ((bitField0_ & 0x00000010) != 0); + } + /** + *
+       * If these values aren't present, they should be assumed to match
+       * the equivalent value above. They are normally only different for
+       * special image types such as nplusone images.
+       * 
+ * + * optional string build_channel = 5; + * @return The buildChannel. + */ + public java.lang.String getBuildChannel() { + java.lang.Object ref = buildChannel_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + buildChannel_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+       * If these values aren't present, they should be assumed to match
+       * the equivalent value above. They are normally only different for
+       * special image types such as nplusone images.
+       * 
+ * + * optional string build_channel = 5; + * @return The bytes for buildChannel. + */ + public com.google.protobuf.ByteString + getBuildChannelBytes() { + java.lang.Object ref = buildChannel_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + buildChannel_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       * If these values aren't present, they should be assumed to match
+       * the equivalent value above. They are normally only different for
+       * special image types such as nplusone images.
+       * 
+ * + * optional string build_channel = 5; + * @param value The buildChannel to set. + * @return This builder for chaining. + */ + public Builder setBuildChannel( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000010; + buildChannel_ = value; + onChanged(); + return this; + } + /** + *
+       * If these values aren't present, they should be assumed to match
+       * the equivalent value above. They are normally only different for
+       * special image types such as nplusone images.
+       * 
+ * + * optional string build_channel = 5; + * @return This builder for chaining. + */ + public Builder clearBuildChannel() { + bitField0_ = (bitField0_ & ~0x00000010); + buildChannel_ = getDefaultInstance().getBuildChannel(); + onChanged(); + return this; + } + /** + *
+       * If these values aren't present, they should be assumed to match
+       * the equivalent value above. They are normally only different for
+       * special image types such as nplusone images.
+       * 
+ * + * optional string build_channel = 5; + * @param value The bytes for buildChannel to set. + * @return This builder for chaining. + */ + public Builder setBuildChannelBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000010; + buildChannel_ = value; + onChanged(); + return this; + } + + private java.lang.Object buildVersion_ = ""; + /** + * optional string build_version = 6; + * @return Whether the buildVersion field is set. + */ + public boolean hasBuildVersion() { + return ((bitField0_ & 0x00000020) != 0); + } + /** + * optional string build_version = 6; + * @return The buildVersion. + */ + public java.lang.String getBuildVersion() { + java.lang.Object ref = buildVersion_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + buildVersion_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * optional string build_version = 6; + * @return The bytes for buildVersion. + */ + public com.google.protobuf.ByteString + getBuildVersionBytes() { + java.lang.Object ref = buildVersion_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + buildVersion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * optional string build_version = 6; + * @param value The buildVersion to set. + * @return This builder for chaining. + */ + public Builder setBuildVersion( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000020; + buildVersion_ = value; + onChanged(); + return this; + } + /** + * optional string build_version = 6; + * @return This builder for chaining. + */ + public Builder clearBuildVersion() { + bitField0_ = (bitField0_ & ~0x00000020); + buildVersion_ = getDefaultInstance().getBuildVersion(); + onChanged(); + return this; + } + /** + * optional string build_version = 6; + * @param value The bytes for buildVersion to set. + * @return This builder for chaining. + */ + public Builder setBuildVersionBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000020; + buildVersion_ = value; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:chromeos_update_engine.ImageInfo) + } + + // @@protoc_insertion_point(class_scope:chromeos_update_engine.ImageInfo) + private static final chromeos_update_engine.UpdateMetadata.ImageInfo DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new chromeos_update_engine.UpdateMetadata.ImageInfo(); + } + + public static chromeos_update_engine.UpdateMetadata.ImageInfo getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @java.lang.Deprecated public static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ImageInfo parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ImageInfo(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public chromeos_update_engine.UpdateMetadata.ImageInfo getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface InstallOperationOrBuilder extends + // @@protoc_insertion_point(interface_extends:chromeos_update_engine.InstallOperation) + com.google.protobuf.MessageOrBuilder { + + /** + * required .chromeos_update_engine.InstallOperation.Type type = 1; + * @return Whether the type field is set. + */ + boolean hasType(); + /** + * required .chromeos_update_engine.InstallOperation.Type type = 1; + * @return The type. + */ + chromeos_update_engine.UpdateMetadata.InstallOperation.Type getType(); + + /** + *
+     * Only minor version 6 or newer support 64 bits |data_offset| and
+     * |data_length|, older client will read them as uint32.
+     * The offset into the delta file (after the protobuf)
+     * where the data (if any) is stored
+     * 
+ * + * optional uint64 data_offset = 2; + * @return Whether the dataOffset field is set. + */ + boolean hasDataOffset(); + /** + *
+     * Only minor version 6 or newer support 64 bits |data_offset| and
+     * |data_length|, older client will read them as uint32.
+     * The offset into the delta file (after the protobuf)
+     * where the data (if any) is stored
+     * 
+ * + * optional uint64 data_offset = 2; + * @return The dataOffset. + */ + long getDataOffset(); + + /** + *
+     * The length of the data in the delta file
+     * 
+ * + * optional uint64 data_length = 3; + * @return Whether the dataLength field is set. + */ + boolean hasDataLength(); + /** + *
+     * The length of the data in the delta file
+     * 
+ * + * optional uint64 data_length = 3; + * @return The dataLength. + */ + long getDataLength(); + + /** + *
+     * Ordered list of extents that are read from (if any) and written to.
+     * 
+ * + * repeated .chromeos_update_engine.Extent src_extents = 4; + */ + java.util.List + getSrcExtentsList(); + /** + *
+     * Ordered list of extents that are read from (if any) and written to.
+     * 
+ * + * repeated .chromeos_update_engine.Extent src_extents = 4; + */ + chromeos_update_engine.UpdateMetadata.Extent getSrcExtents(int index); + /** + *
+     * Ordered list of extents that are read from (if any) and written to.
+     * 
+ * + * repeated .chromeos_update_engine.Extent src_extents = 4; + */ + int getSrcExtentsCount(); + /** + *
+     * Ordered list of extents that are read from (if any) and written to.
+     * 
+ * + * repeated .chromeos_update_engine.Extent src_extents = 4; + */ + java.util.List + getSrcExtentsOrBuilderList(); + /** + *
+     * Ordered list of extents that are read from (if any) and written to.
+     * 
+ * + * repeated .chromeos_update_engine.Extent src_extents = 4; + */ + chromeos_update_engine.UpdateMetadata.ExtentOrBuilder getSrcExtentsOrBuilder( + int index); + + /** + *
+     * Byte length of src, equal to the number of blocks in src_extents *
+     * block_size. It is used for BSDIFF and SOURCE_BSDIFF, because we need to
+     * pass that external program the number of bytes to read from the blocks we
+     * pass it.  This is not used in any other operation.
+     * 
+ * + * optional uint64 src_length = 5; + * @return Whether the srcLength field is set. + */ + boolean hasSrcLength(); + /** + *
+     * Byte length of src, equal to the number of blocks in src_extents *
+     * block_size. It is used for BSDIFF and SOURCE_BSDIFF, because we need to
+     * pass that external program the number of bytes to read from the blocks we
+     * pass it.  This is not used in any other operation.
+     * 
+ * + * optional uint64 src_length = 5; + * @return The srcLength. + */ + long getSrcLength(); + + /** + * repeated .chromeos_update_engine.Extent dst_extents = 6; + */ + java.util.List + getDstExtentsList(); + /** + * repeated .chromeos_update_engine.Extent dst_extents = 6; + */ + chromeos_update_engine.UpdateMetadata.Extent getDstExtents(int index); + /** + * repeated .chromeos_update_engine.Extent dst_extents = 6; + */ + int getDstExtentsCount(); + /** + * repeated .chromeos_update_engine.Extent dst_extents = 6; + */ + java.util.List + getDstExtentsOrBuilderList(); + /** + * repeated .chromeos_update_engine.Extent dst_extents = 6; + */ + chromeos_update_engine.UpdateMetadata.ExtentOrBuilder getDstExtentsOrBuilder( + int index); + + /** + *
+     * Byte length of dst, equal to the number of blocks in dst_extents *
+     * block_size. Used for BSDIFF and SOURCE_BSDIFF, but not in any other
+     * operation.
+     * 
+ * + * optional uint64 dst_length = 7; + * @return Whether the dstLength field is set. + */ + boolean hasDstLength(); + /** + *
+     * Byte length of dst, equal to the number of blocks in dst_extents *
+     * block_size. Used for BSDIFF and SOURCE_BSDIFF, but not in any other
+     * operation.
+     * 
+ * + * optional uint64 dst_length = 7; + * @return The dstLength. + */ + long getDstLength(); + + /** + *
+     * Optional SHA 256 hash of the blob associated with this operation.
+     * This is used as a primary validation for http-based downloads and
+     * as a defense-in-depth validation for https-based downloads. If
+     * the operation doesn't refer to any blob, this field will have
+     * zero bytes.
+     * 
+ * + * optional bytes data_sha256_hash = 8; + * @return Whether the dataSha256Hash field is set. + */ + boolean hasDataSha256Hash(); + /** + *
+     * Optional SHA 256 hash of the blob associated with this operation.
+     * This is used as a primary validation for http-based downloads and
+     * as a defense-in-depth validation for https-based downloads. If
+     * the operation doesn't refer to any blob, this field will have
+     * zero bytes.
+     * 
+ * + * optional bytes data_sha256_hash = 8; + * @return The dataSha256Hash. + */ + com.google.protobuf.ByteString getDataSha256Hash(); + + /** + *
+     * Indicates the SHA 256 hash of the source data referenced in src_extents at
+     * the time of applying the operation. If present, the update_engine daemon
+     * MUST read and verify the source data before applying the operation.
+     * 
+ * + * optional bytes src_sha256_hash = 9; + * @return Whether the srcSha256Hash field is set. + */ + boolean hasSrcSha256Hash(); + /** + *
+     * Indicates the SHA 256 hash of the source data referenced in src_extents at
+     * the time of applying the operation. If present, the update_engine daemon
+     * MUST read and verify the source data before applying the operation.
+     * 
+ * + * optional bytes src_sha256_hash = 9; + * @return The srcSha256Hash. + */ + com.google.protobuf.ByteString getSrcSha256Hash(); + } + /** + * Protobuf type {@code chromeos_update_engine.InstallOperation} + */ + public static final class InstallOperation extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:chromeos_update_engine.InstallOperation) + InstallOperationOrBuilder { + private static final long serialVersionUID = 0L; + // Use InstallOperation.newBuilder() to construct. + private InstallOperation(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private InstallOperation() { + type_ = 0; + srcExtents_ = java.util.Collections.emptyList(); + dstExtents_ = java.util.Collections.emptyList(); + dataSha256Hash_ = com.google.protobuf.ByteString.EMPTY; + srcSha256Hash_ = com.google.protobuf.ByteString.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new InstallOperation(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private InstallOperation( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + int rawValue = input.readEnum(); + @SuppressWarnings("deprecation") + chromeos_update_engine.UpdateMetadata.InstallOperation.Type value = chromeos_update_engine.UpdateMetadata.InstallOperation.Type.valueOf(rawValue); + if (value == null) { + unknownFields.mergeVarintField(1, rawValue); + } else { + bitField0_ |= 0x00000001; + type_ = rawValue; + } + break; + } + case 16: { + bitField0_ |= 0x00000002; + dataOffset_ = input.readUInt64(); + break; + } + case 24: { + bitField0_ |= 0x00000004; + dataLength_ = input.readUInt64(); + break; + } + case 34: { + if (!((mutable_bitField0_ & 0x00000008) != 0)) { + srcExtents_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000008; + } + srcExtents_.add( + input.readMessage(chromeos_update_engine.UpdateMetadata.Extent.PARSER, extensionRegistry)); + break; + } + case 40: { + bitField0_ |= 0x00000008; + srcLength_ = input.readUInt64(); + break; + } + case 50: { + if (!((mutable_bitField0_ & 0x00000020) != 0)) { + dstExtents_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000020; + } + dstExtents_.add( + input.readMessage(chromeos_update_engine.UpdateMetadata.Extent.PARSER, extensionRegistry)); + break; + } + case 56: { + bitField0_ |= 0x00000010; + dstLength_ = input.readUInt64(); + break; + } + case 66: { + bitField0_ |= 0x00000020; + dataSha256Hash_ = input.readBytes(); + break; + } + case 74: { + bitField0_ |= 0x00000040; + srcSha256Hash_ = input.readBytes(); + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000008) != 0)) { + srcExtents_ = java.util.Collections.unmodifiableList(srcExtents_); + } + if (((mutable_bitField0_ & 0x00000020) != 0)) { + dstExtents_ = java.util.Collections.unmodifiableList(dstExtents_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return chromeos_update_engine.UpdateMetadata.internal_static_chromeos_update_engine_InstallOperation_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return chromeos_update_engine.UpdateMetadata.internal_static_chromeos_update_engine_InstallOperation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + chromeos_update_engine.UpdateMetadata.InstallOperation.class, chromeos_update_engine.UpdateMetadata.InstallOperation.Builder.class); + } + + /** + * Protobuf enum {@code chromeos_update_engine.InstallOperation.Type} + */ + public enum Type + implements com.google.protobuf.ProtocolMessageEnum { + /** + *
+       * Replace destination extents w/ attached data
+       * 
+ * + * REPLACE = 0; + */ + REPLACE(0), + /** + *
+       * Replace destination extents w/ attached bzipped data
+       * 
+ * + * REPLACE_BZ = 1; + */ + REPLACE_BZ(1), + /** + *
+       * Move source extents to destination extents
+       * 
+ * + * MOVE = 2 [deprecated = true]; + */ + @java.lang.Deprecated + MOVE(2), + /** + *
+       * The data is a bsdiff binary diff
+       * 
+ * + * BSDIFF = 3 [deprecated = true]; + */ + @java.lang.Deprecated + BSDIFF(3), + /** + *
+       * On minor version 2 or newer, these operations are supported:
+       * 
+ * + * SOURCE_COPY = 4; + */ + SOURCE_COPY(4), + /** + *
+       * Like BSDIFF, but read from source partition
+       * 
+ * + * SOURCE_BSDIFF = 5; + */ + SOURCE_BSDIFF(5), + /** + *
+       * On minor version 3 or newer and on major version 2 or newer, these
+       * operations are supported:
+       * 
+ * + * REPLACE_XZ = 8; + */ + REPLACE_XZ(8), + /** + *
+       * On minor version 4 or newer, these operations are supported:
+       * 
+ * + * ZERO = 6; + */ + ZERO(6), + /** + *
+       * Discard the destination blocks, reading as undefined.
+       * 
+ * + * DISCARD = 7; + */ + DISCARD(7), + /** + *
+       * Like SOURCE_BSDIFF, but compressed with brotli.
+       * 
+ * + * BROTLI_BSDIFF = 10; + */ + BROTLI_BSDIFF(10), + /** + *
+       * On minor version 5 or newer, these operations are supported:
+       * 
+ * + * PUFFDIFF = 9; + */ + PUFFDIFF(9), + ; + + /** + *
+       * Replace destination extents w/ attached data
+       * 
+ * + * REPLACE = 0; + */ + public static final int REPLACE_VALUE = 0; + /** + *
+       * Replace destination extents w/ attached bzipped data
+       * 
+ * + * REPLACE_BZ = 1; + */ + public static final int REPLACE_BZ_VALUE = 1; + /** + *
+       * Move source extents to destination extents
+       * 
+ * + * MOVE = 2 [deprecated = true]; + */ + @java.lang.Deprecated public static final int MOVE_VALUE = 2; + /** + *
+       * The data is a bsdiff binary diff
+       * 
+ * + * BSDIFF = 3 [deprecated = true]; + */ + @java.lang.Deprecated public static final int BSDIFF_VALUE = 3; + /** + *
+       * On minor version 2 or newer, these operations are supported:
+       * 
+ * + * SOURCE_COPY = 4; + */ + public static final int SOURCE_COPY_VALUE = 4; + /** + *
+       * Like BSDIFF, but read from source partition
+       * 
+ * + * SOURCE_BSDIFF = 5; + */ + public static final int SOURCE_BSDIFF_VALUE = 5; + /** + *
+       * On minor version 3 or newer and on major version 2 or newer, these
+       * operations are supported:
+       * 
+ * + * REPLACE_XZ = 8; + */ + public static final int REPLACE_XZ_VALUE = 8; + /** + *
+       * On minor version 4 or newer, these operations are supported:
+       * 
+ * + * ZERO = 6; + */ + public static final int ZERO_VALUE = 6; + /** + *
+       * Discard the destination blocks, reading as undefined.
+       * 
+ * + * DISCARD = 7; + */ + public static final int DISCARD_VALUE = 7; + /** + *
+       * Like SOURCE_BSDIFF, but compressed with brotli.
+       * 
+ * + * BROTLI_BSDIFF = 10; + */ + public static final int BROTLI_BSDIFF_VALUE = 10; + /** + *
+       * On minor version 5 or newer, these operations are supported:
+       * 
+ * + * PUFFDIFF = 9; + */ + public static final int PUFFDIFF_VALUE = 9; + + + public final int getNumber() { + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static Type valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static Type forNumber(int value) { + switch (value) { + case 0: return REPLACE; + case 1: return REPLACE_BZ; + case 2: return MOVE; + case 3: return BSDIFF; + case 4: return SOURCE_COPY; + case 5: return SOURCE_BSDIFF; + case 8: return REPLACE_XZ; + case 6: return ZERO; + case 7: return DISCARD; + case 10: return BROTLI_BSDIFF; + case 9: return PUFFDIFF; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + Type> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public Type findValueByNumber(int number) { + return Type.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor + getValueDescriptor() { + return getDescriptor().getValues().get(ordinal()); + } + public final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptorForType() { + return getDescriptor(); + } + public static final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptor() { + return chromeos_update_engine.UpdateMetadata.InstallOperation.getDescriptor().getEnumTypes().get(0); + } + + private static final Type[] VALUES = values(); + + public static Type valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException( + "EnumValueDescriptor is not for this type."); + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private Type(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:chromeos_update_engine.InstallOperation.Type) + } + + private int bitField0_; + public static final int TYPE_FIELD_NUMBER = 1; + private int type_; + /** + * required .chromeos_update_engine.InstallOperation.Type type = 1; + * @return Whether the type field is set. + */ + @java.lang.Override public boolean hasType() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * required .chromeos_update_engine.InstallOperation.Type type = 1; + * @return The type. + */ + @java.lang.Override public chromeos_update_engine.UpdateMetadata.InstallOperation.Type getType() { + @SuppressWarnings("deprecation") + chromeos_update_engine.UpdateMetadata.InstallOperation.Type result = chromeos_update_engine.UpdateMetadata.InstallOperation.Type.valueOf(type_); + return result == null ? chromeos_update_engine.UpdateMetadata.InstallOperation.Type.REPLACE : result; + } + + public static final int DATA_OFFSET_FIELD_NUMBER = 2; + private long dataOffset_; + /** + *
+     * Only minor version 6 or newer support 64 bits |data_offset| and
+     * |data_length|, older client will read them as uint32.
+     * The offset into the delta file (after the protobuf)
+     * where the data (if any) is stored
+     * 
+ * + * optional uint64 data_offset = 2; + * @return Whether the dataOffset field is set. + */ + @java.lang.Override + public boolean hasDataOffset() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + *
+     * Only minor version 6 or newer support 64 bits |data_offset| and
+     * |data_length|, older client will read them as uint32.
+     * The offset into the delta file (after the protobuf)
+     * where the data (if any) is stored
+     * 
+ * + * optional uint64 data_offset = 2; + * @return The dataOffset. + */ + @java.lang.Override + public long getDataOffset() { + return dataOffset_; + } + + public static final int DATA_LENGTH_FIELD_NUMBER = 3; + private long dataLength_; + /** + *
+     * The length of the data in the delta file
+     * 
+ * + * optional uint64 data_length = 3; + * @return Whether the dataLength field is set. + */ + @java.lang.Override + public boolean hasDataLength() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + *
+     * The length of the data in the delta file
+     * 
+ * + * optional uint64 data_length = 3; + * @return The dataLength. + */ + @java.lang.Override + public long getDataLength() { + return dataLength_; + } + + public static final int SRC_EXTENTS_FIELD_NUMBER = 4; + private java.util.List srcExtents_; + /** + *
+     * Ordered list of extents that are read from (if any) and written to.
+     * 
+ * + * repeated .chromeos_update_engine.Extent src_extents = 4; + */ + @java.lang.Override + public java.util.List getSrcExtentsList() { + return srcExtents_; + } + /** + *
+     * Ordered list of extents that are read from (if any) and written to.
+     * 
+ * + * repeated .chromeos_update_engine.Extent src_extents = 4; + */ + @java.lang.Override + public java.util.List + getSrcExtentsOrBuilderList() { + return srcExtents_; + } + /** + *
+     * Ordered list of extents that are read from (if any) and written to.
+     * 
+ * + * repeated .chromeos_update_engine.Extent src_extents = 4; + */ + @java.lang.Override + public int getSrcExtentsCount() { + return srcExtents_.size(); + } + /** + *
+     * Ordered list of extents that are read from (if any) and written to.
+     * 
+ * + * repeated .chromeos_update_engine.Extent src_extents = 4; + */ + @java.lang.Override + public chromeos_update_engine.UpdateMetadata.Extent getSrcExtents(int index) { + return srcExtents_.get(index); + } + /** + *
+     * Ordered list of extents that are read from (if any) and written to.
+     * 
+ * + * repeated .chromeos_update_engine.Extent src_extents = 4; + */ + @java.lang.Override + public chromeos_update_engine.UpdateMetadata.ExtentOrBuilder getSrcExtentsOrBuilder( + int index) { + return srcExtents_.get(index); + } + + public static final int SRC_LENGTH_FIELD_NUMBER = 5; + private long srcLength_; + /** + *
+     * Byte length of src, equal to the number of blocks in src_extents *
+     * block_size. It is used for BSDIFF and SOURCE_BSDIFF, because we need to
+     * pass that external program the number of bytes to read from the blocks we
+     * pass it.  This is not used in any other operation.
+     * 
+ * + * optional uint64 src_length = 5; + * @return Whether the srcLength field is set. + */ + @java.lang.Override + public boolean hasSrcLength() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + *
+     * Byte length of src, equal to the number of blocks in src_extents *
+     * block_size. It is used for BSDIFF and SOURCE_BSDIFF, because we need to
+     * pass that external program the number of bytes to read from the blocks we
+     * pass it.  This is not used in any other operation.
+     * 
+ * + * optional uint64 src_length = 5; + * @return The srcLength. + */ + @java.lang.Override + public long getSrcLength() { + return srcLength_; + } + + public static final int DST_EXTENTS_FIELD_NUMBER = 6; + private java.util.List dstExtents_; + /** + * repeated .chromeos_update_engine.Extent dst_extents = 6; + */ + @java.lang.Override + public java.util.List getDstExtentsList() { + return dstExtents_; + } + /** + * repeated .chromeos_update_engine.Extent dst_extents = 6; + */ + @java.lang.Override + public java.util.List + getDstExtentsOrBuilderList() { + return dstExtents_; + } + /** + * repeated .chromeos_update_engine.Extent dst_extents = 6; + */ + @java.lang.Override + public int getDstExtentsCount() { + return dstExtents_.size(); + } + /** + * repeated .chromeos_update_engine.Extent dst_extents = 6; + */ + @java.lang.Override + public chromeos_update_engine.UpdateMetadata.Extent getDstExtents(int index) { + return dstExtents_.get(index); + } + /** + * repeated .chromeos_update_engine.Extent dst_extents = 6; + */ + @java.lang.Override + public chromeos_update_engine.UpdateMetadata.ExtentOrBuilder getDstExtentsOrBuilder( + int index) { + return dstExtents_.get(index); + } + + public static final int DST_LENGTH_FIELD_NUMBER = 7; + private long dstLength_; + /** + *
+     * Byte length of dst, equal to the number of blocks in dst_extents *
+     * block_size. Used for BSDIFF and SOURCE_BSDIFF, but not in any other
+     * operation.
+     * 
+ * + * optional uint64 dst_length = 7; + * @return Whether the dstLength field is set. + */ + @java.lang.Override + public boolean hasDstLength() { + return ((bitField0_ & 0x00000010) != 0); + } + /** + *
+     * Byte length of dst, equal to the number of blocks in dst_extents *
+     * block_size. Used for BSDIFF and SOURCE_BSDIFF, but not in any other
+     * operation.
+     * 
+ * + * optional uint64 dst_length = 7; + * @return The dstLength. + */ + @java.lang.Override + public long getDstLength() { + return dstLength_; + } + + public static final int DATA_SHA256_HASH_FIELD_NUMBER = 8; + private com.google.protobuf.ByteString dataSha256Hash_; + /** + *
+     * Optional SHA 256 hash of the blob associated with this operation.
+     * This is used as a primary validation for http-based downloads and
+     * as a defense-in-depth validation for https-based downloads. If
+     * the operation doesn't refer to any blob, this field will have
+     * zero bytes.
+     * 
+ * + * optional bytes data_sha256_hash = 8; + * @return Whether the dataSha256Hash field is set. + */ + @java.lang.Override + public boolean hasDataSha256Hash() { + return ((bitField0_ & 0x00000020) != 0); + } + /** + *
+     * Optional SHA 256 hash of the blob associated with this operation.
+     * This is used as a primary validation for http-based downloads and
+     * as a defense-in-depth validation for https-based downloads. If
+     * the operation doesn't refer to any blob, this field will have
+     * zero bytes.
+     * 
+ * + * optional bytes data_sha256_hash = 8; + * @return The dataSha256Hash. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDataSha256Hash() { + return dataSha256Hash_; + } + + public static final int SRC_SHA256_HASH_FIELD_NUMBER = 9; + private com.google.protobuf.ByteString srcSha256Hash_; + /** + *
+     * Indicates the SHA 256 hash of the source data referenced in src_extents at
+     * the time of applying the operation. If present, the update_engine daemon
+     * MUST read and verify the source data before applying the operation.
+     * 
+ * + * optional bytes src_sha256_hash = 9; + * @return Whether the srcSha256Hash field is set. + */ + @java.lang.Override + public boolean hasSrcSha256Hash() { + return ((bitField0_ & 0x00000040) != 0); + } + /** + *
+     * Indicates the SHA 256 hash of the source data referenced in src_extents at
+     * the time of applying the operation. If present, the update_engine daemon
+     * MUST read and verify the source data before applying the operation.
+     * 
+ * + * optional bytes src_sha256_hash = 9; + * @return The srcSha256Hash. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSrcSha256Hash() { + return srcSha256Hash_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + if (!hasType()) { + memoizedIsInitialized = 0; + return false; + } + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + output.writeEnum(1, type_); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeUInt64(2, dataOffset_); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeUInt64(3, dataLength_); + } + for (int i = 0; i < srcExtents_.size(); i++) { + output.writeMessage(4, srcExtents_.get(i)); + } + if (((bitField0_ & 0x00000008) != 0)) { + output.writeUInt64(5, srcLength_); + } + for (int i = 0; i < dstExtents_.size(); i++) { + output.writeMessage(6, dstExtents_.get(i)); + } + if (((bitField0_ & 0x00000010) != 0)) { + output.writeUInt64(7, dstLength_); + } + if (((bitField0_ & 0x00000020) != 0)) { + output.writeBytes(8, dataSha256Hash_); + } + if (((bitField0_ & 0x00000040) != 0)) { + output.writeBytes(9, srcSha256Hash_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(1, type_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(2, dataOffset_); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(3, dataLength_); + } + for (int i = 0; i < srcExtents_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, srcExtents_.get(i)); + } + if (((bitField0_ & 0x00000008) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(5, srcLength_); + } + for (int i = 0; i < dstExtents_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(6, dstExtents_.get(i)); + } + if (((bitField0_ & 0x00000010) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(7, dstLength_); + } + if (((bitField0_ & 0x00000020) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(8, dataSha256Hash_); + } + if (((bitField0_ & 0x00000040) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(9, srcSha256Hash_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof chromeos_update_engine.UpdateMetadata.InstallOperation)) { + return super.equals(obj); + } + chromeos_update_engine.UpdateMetadata.InstallOperation other = (chromeos_update_engine.UpdateMetadata.InstallOperation) obj; + + if (hasType() != other.hasType()) return false; + if (hasType()) { + if (type_ != other.type_) return false; + } + if (hasDataOffset() != other.hasDataOffset()) return false; + if (hasDataOffset()) { + if (getDataOffset() + != other.getDataOffset()) return false; + } + if (hasDataLength() != other.hasDataLength()) return false; + if (hasDataLength()) { + if (getDataLength() + != other.getDataLength()) return false; + } + if (!getSrcExtentsList() + .equals(other.getSrcExtentsList())) return false; + if (hasSrcLength() != other.hasSrcLength()) return false; + if (hasSrcLength()) { + if (getSrcLength() + != other.getSrcLength()) return false; + } + if (!getDstExtentsList() + .equals(other.getDstExtentsList())) return false; + if (hasDstLength() != other.hasDstLength()) return false; + if (hasDstLength()) { + if (getDstLength() + != other.getDstLength()) return false; + } + if (hasDataSha256Hash() != other.hasDataSha256Hash()) return false; + if (hasDataSha256Hash()) { + if (!getDataSha256Hash() + .equals(other.getDataSha256Hash())) return false; + } + if (hasSrcSha256Hash() != other.hasSrcSha256Hash()) return false; + if (hasSrcSha256Hash()) { + if (!getSrcSha256Hash() + .equals(other.getSrcSha256Hash())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasType()) { + hash = (37 * hash) + TYPE_FIELD_NUMBER; + hash = (53 * hash) + type_; + } + if (hasDataOffset()) { + hash = (37 * hash) + DATA_OFFSET_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getDataOffset()); + } + if (hasDataLength()) { + hash = (37 * hash) + DATA_LENGTH_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getDataLength()); + } + if (getSrcExtentsCount() > 0) { + hash = (37 * hash) + SRC_EXTENTS_FIELD_NUMBER; + hash = (53 * hash) + getSrcExtentsList().hashCode(); + } + if (hasSrcLength()) { + hash = (37 * hash) + SRC_LENGTH_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getSrcLength()); + } + if (getDstExtentsCount() > 0) { + hash = (37 * hash) + DST_EXTENTS_FIELD_NUMBER; + hash = (53 * hash) + getDstExtentsList().hashCode(); + } + if (hasDstLength()) { + hash = (37 * hash) + DST_LENGTH_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getDstLength()); + } + if (hasDataSha256Hash()) { + hash = (37 * hash) + DATA_SHA256_HASH_FIELD_NUMBER; + hash = (53 * hash) + getDataSha256Hash().hashCode(); + } + if (hasSrcSha256Hash()) { + hash = (37 * hash) + SRC_SHA256_HASH_FIELD_NUMBER; + hash = (53 * hash) + getSrcSha256Hash().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static chromeos_update_engine.UpdateMetadata.InstallOperation parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static chromeos_update_engine.UpdateMetadata.InstallOperation parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static chromeos_update_engine.UpdateMetadata.InstallOperation parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static chromeos_update_engine.UpdateMetadata.InstallOperation parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static chromeos_update_engine.UpdateMetadata.InstallOperation parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static chromeos_update_engine.UpdateMetadata.InstallOperation parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static chromeos_update_engine.UpdateMetadata.InstallOperation parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static chromeos_update_engine.UpdateMetadata.InstallOperation parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static chromeos_update_engine.UpdateMetadata.InstallOperation parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static chromeos_update_engine.UpdateMetadata.InstallOperation parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static chromeos_update_engine.UpdateMetadata.InstallOperation parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static chromeos_update_engine.UpdateMetadata.InstallOperation parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(chromeos_update_engine.UpdateMetadata.InstallOperation prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code chromeos_update_engine.InstallOperation} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:chromeos_update_engine.InstallOperation) + chromeos_update_engine.UpdateMetadata.InstallOperationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return chromeos_update_engine.UpdateMetadata.internal_static_chromeos_update_engine_InstallOperation_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return chromeos_update_engine.UpdateMetadata.internal_static_chromeos_update_engine_InstallOperation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + chromeos_update_engine.UpdateMetadata.InstallOperation.class, chromeos_update_engine.UpdateMetadata.InstallOperation.Builder.class); + } + + // Construct using chromeos_update_engine.UpdateMetadata.InstallOperation.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getSrcExtentsFieldBuilder(); + getDstExtentsFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + type_ = 0; + bitField0_ = (bitField0_ & ~0x00000001); + dataOffset_ = 0L; + bitField0_ = (bitField0_ & ~0x00000002); + dataLength_ = 0L; + bitField0_ = (bitField0_ & ~0x00000004); + if (srcExtentsBuilder_ == null) { + srcExtents_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008); + } else { + srcExtentsBuilder_.clear(); + } + srcLength_ = 0L; + bitField0_ = (bitField0_ & ~0x00000010); + if (dstExtentsBuilder_ == null) { + dstExtents_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000020); + } else { + dstExtentsBuilder_.clear(); + } + dstLength_ = 0L; + bitField0_ = (bitField0_ & ~0x00000040); + dataSha256Hash_ = com.google.protobuf.ByteString.EMPTY; + bitField0_ = (bitField0_ & ~0x00000080); + srcSha256Hash_ = com.google.protobuf.ByteString.EMPTY; + bitField0_ = (bitField0_ & ~0x00000100); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return chromeos_update_engine.UpdateMetadata.internal_static_chromeos_update_engine_InstallOperation_descriptor; + } + + @java.lang.Override + public chromeos_update_engine.UpdateMetadata.InstallOperation getDefaultInstanceForType() { + return chromeos_update_engine.UpdateMetadata.InstallOperation.getDefaultInstance(); + } + + @java.lang.Override + public chromeos_update_engine.UpdateMetadata.InstallOperation build() { + chromeos_update_engine.UpdateMetadata.InstallOperation result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public chromeos_update_engine.UpdateMetadata.InstallOperation buildPartial() { + chromeos_update_engine.UpdateMetadata.InstallOperation result = new chromeos_update_engine.UpdateMetadata.InstallOperation(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + to_bitField0_ |= 0x00000001; + } + result.type_ = type_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.dataOffset_ = dataOffset_; + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.dataLength_ = dataLength_; + to_bitField0_ |= 0x00000004; + } + if (srcExtentsBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0)) { + srcExtents_ = java.util.Collections.unmodifiableList(srcExtents_); + bitField0_ = (bitField0_ & ~0x00000008); + } + result.srcExtents_ = srcExtents_; + } else { + result.srcExtents_ = srcExtentsBuilder_.build(); + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.srcLength_ = srcLength_; + to_bitField0_ |= 0x00000008; + } + if (dstExtentsBuilder_ == null) { + if (((bitField0_ & 0x00000020) != 0)) { + dstExtents_ = java.util.Collections.unmodifiableList(dstExtents_); + bitField0_ = (bitField0_ & ~0x00000020); + } + result.dstExtents_ = dstExtents_; + } else { + result.dstExtents_ = dstExtentsBuilder_.build(); + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.dstLength_ = dstLength_; + to_bitField0_ |= 0x00000010; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + to_bitField0_ |= 0x00000020; + } + result.dataSha256Hash_ = dataSha256Hash_; + if (((from_bitField0_ & 0x00000100) != 0)) { + to_bitField0_ |= 0x00000040; + } + result.srcSha256Hash_ = srcSha256Hash_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof chromeos_update_engine.UpdateMetadata.InstallOperation) { + return mergeFrom((chromeos_update_engine.UpdateMetadata.InstallOperation)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(chromeos_update_engine.UpdateMetadata.InstallOperation other) { + if (other == chromeos_update_engine.UpdateMetadata.InstallOperation.getDefaultInstance()) return this; + if (other.hasType()) { + setType(other.getType()); + } + if (other.hasDataOffset()) { + setDataOffset(other.getDataOffset()); + } + if (other.hasDataLength()) { + setDataLength(other.getDataLength()); + } + if (srcExtentsBuilder_ == null) { + if (!other.srcExtents_.isEmpty()) { + if (srcExtents_.isEmpty()) { + srcExtents_ = other.srcExtents_; + bitField0_ = (bitField0_ & ~0x00000008); + } else { + ensureSrcExtentsIsMutable(); + srcExtents_.addAll(other.srcExtents_); + } + onChanged(); + } + } else { + if (!other.srcExtents_.isEmpty()) { + if (srcExtentsBuilder_.isEmpty()) { + srcExtentsBuilder_.dispose(); + srcExtentsBuilder_ = null; + srcExtents_ = other.srcExtents_; + bitField0_ = (bitField0_ & ~0x00000008); + srcExtentsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getSrcExtentsFieldBuilder() : null; + } else { + srcExtentsBuilder_.addAllMessages(other.srcExtents_); + } + } + } + if (other.hasSrcLength()) { + setSrcLength(other.getSrcLength()); + } + if (dstExtentsBuilder_ == null) { + if (!other.dstExtents_.isEmpty()) { + if (dstExtents_.isEmpty()) { + dstExtents_ = other.dstExtents_; + bitField0_ = (bitField0_ & ~0x00000020); + } else { + ensureDstExtentsIsMutable(); + dstExtents_.addAll(other.dstExtents_); + } + onChanged(); + } + } else { + if (!other.dstExtents_.isEmpty()) { + if (dstExtentsBuilder_.isEmpty()) { + dstExtentsBuilder_.dispose(); + dstExtentsBuilder_ = null; + dstExtents_ = other.dstExtents_; + bitField0_ = (bitField0_ & ~0x00000020); + dstExtentsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getDstExtentsFieldBuilder() : null; + } else { + dstExtentsBuilder_.addAllMessages(other.dstExtents_); + } + } + } + if (other.hasDstLength()) { + setDstLength(other.getDstLength()); + } + if (other.hasDataSha256Hash()) { + setDataSha256Hash(other.getDataSha256Hash()); + } + if (other.hasSrcSha256Hash()) { + setSrcSha256Hash(other.getSrcSha256Hash()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + if (!hasType()) { + return false; + } + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + chromeos_update_engine.UpdateMetadata.InstallOperation parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (chromeos_update_engine.UpdateMetadata.InstallOperation) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private int type_ = 0; + /** + * required .chromeos_update_engine.InstallOperation.Type type = 1; + * @return Whether the type field is set. + */ + @java.lang.Override public boolean hasType() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * required .chromeos_update_engine.InstallOperation.Type type = 1; + * @return The type. + */ + @java.lang.Override + public chromeos_update_engine.UpdateMetadata.InstallOperation.Type getType() { + @SuppressWarnings("deprecation") + chromeos_update_engine.UpdateMetadata.InstallOperation.Type result = chromeos_update_engine.UpdateMetadata.InstallOperation.Type.valueOf(type_); + return result == null ? chromeos_update_engine.UpdateMetadata.InstallOperation.Type.REPLACE : result; + } + /** + * required .chromeos_update_engine.InstallOperation.Type type = 1; + * @param value The type to set. + * @return This builder for chaining. + */ + public Builder setType(chromeos_update_engine.UpdateMetadata.InstallOperation.Type value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + type_ = value.getNumber(); + onChanged(); + return this; + } + /** + * required .chromeos_update_engine.InstallOperation.Type type = 1; + * @return This builder for chaining. + */ + public Builder clearType() { + bitField0_ = (bitField0_ & ~0x00000001); + type_ = 0; + onChanged(); + return this; + } + + private long dataOffset_ ; + /** + *
+       * Only minor version 6 or newer support 64 bits |data_offset| and
+       * |data_length|, older client will read them as uint32.
+       * The offset into the delta file (after the protobuf)
+       * where the data (if any) is stored
+       * 
+ * + * optional uint64 data_offset = 2; + * @return Whether the dataOffset field is set. + */ + @java.lang.Override + public boolean hasDataOffset() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + *
+       * Only minor version 6 or newer support 64 bits |data_offset| and
+       * |data_length|, older client will read them as uint32.
+       * The offset into the delta file (after the protobuf)
+       * where the data (if any) is stored
+       * 
+ * + * optional uint64 data_offset = 2; + * @return The dataOffset. + */ + @java.lang.Override + public long getDataOffset() { + return dataOffset_; + } + /** + *
+       * Only minor version 6 or newer support 64 bits |data_offset| and
+       * |data_length|, older client will read them as uint32.
+       * The offset into the delta file (after the protobuf)
+       * where the data (if any) is stored
+       * 
+ * + * optional uint64 data_offset = 2; + * @param value The dataOffset to set. + * @return This builder for chaining. + */ + public Builder setDataOffset(long value) { + bitField0_ |= 0x00000002; + dataOffset_ = value; + onChanged(); + return this; + } + /** + *
+       * Only minor version 6 or newer support 64 bits |data_offset| and
+       * |data_length|, older client will read them as uint32.
+       * The offset into the delta file (after the protobuf)
+       * where the data (if any) is stored
+       * 
+ * + * optional uint64 data_offset = 2; + * @return This builder for chaining. + */ + public Builder clearDataOffset() { + bitField0_ = (bitField0_ & ~0x00000002); + dataOffset_ = 0L; + onChanged(); + return this; + } + + private long dataLength_ ; + /** + *
+       * The length of the data in the delta file
+       * 
+ * + * optional uint64 data_length = 3; + * @return Whether the dataLength field is set. + */ + @java.lang.Override + public boolean hasDataLength() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + *
+       * The length of the data in the delta file
+       * 
+ * + * optional uint64 data_length = 3; + * @return The dataLength. + */ + @java.lang.Override + public long getDataLength() { + return dataLength_; + } + /** + *
+       * The length of the data in the delta file
+       * 
+ * + * optional uint64 data_length = 3; + * @param value The dataLength to set. + * @return This builder for chaining. + */ + public Builder setDataLength(long value) { + bitField0_ |= 0x00000004; + dataLength_ = value; + onChanged(); + return this; + } + /** + *
+       * The length of the data in the delta file
+       * 
+ * + * optional uint64 data_length = 3; + * @return This builder for chaining. + */ + public Builder clearDataLength() { + bitField0_ = (bitField0_ & ~0x00000004); + dataLength_ = 0L; + onChanged(); + return this; + } + + private java.util.List srcExtents_ = + java.util.Collections.emptyList(); + private void ensureSrcExtentsIsMutable() { + if (!((bitField0_ & 0x00000008) != 0)) { + srcExtents_ = new java.util.ArrayList(srcExtents_); + bitField0_ |= 0x00000008; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + chromeos_update_engine.UpdateMetadata.Extent, chromeos_update_engine.UpdateMetadata.Extent.Builder, chromeos_update_engine.UpdateMetadata.ExtentOrBuilder> srcExtentsBuilder_; + + /** + *
+       * Ordered list of extents that are read from (if any) and written to.
+       * 
+ * + * repeated .chromeos_update_engine.Extent src_extents = 4; + */ + public java.util.List getSrcExtentsList() { + if (srcExtentsBuilder_ == null) { + return java.util.Collections.unmodifiableList(srcExtents_); + } else { + return srcExtentsBuilder_.getMessageList(); + } + } + /** + *
+       * Ordered list of extents that are read from (if any) and written to.
+       * 
+ * + * repeated .chromeos_update_engine.Extent src_extents = 4; + */ + public int getSrcExtentsCount() { + if (srcExtentsBuilder_ == null) { + return srcExtents_.size(); + } else { + return srcExtentsBuilder_.getCount(); + } + } + /** + *
+       * Ordered list of extents that are read from (if any) and written to.
+       * 
+ * + * repeated .chromeos_update_engine.Extent src_extents = 4; + */ + public chromeos_update_engine.UpdateMetadata.Extent getSrcExtents(int index) { + if (srcExtentsBuilder_ == null) { + return srcExtents_.get(index); + } else { + return srcExtentsBuilder_.getMessage(index); + } + } + /** + *
+       * Ordered list of extents that are read from (if any) and written to.
+       * 
+ * + * repeated .chromeos_update_engine.Extent src_extents = 4; + */ + public Builder setSrcExtents( + int index, chromeos_update_engine.UpdateMetadata.Extent value) { + if (srcExtentsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSrcExtentsIsMutable(); + srcExtents_.set(index, value); + onChanged(); + } else { + srcExtentsBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+       * Ordered list of extents that are read from (if any) and written to.
+       * 
+ * + * repeated .chromeos_update_engine.Extent src_extents = 4; + */ + public Builder setSrcExtents( + int index, chromeos_update_engine.UpdateMetadata.Extent.Builder builderForValue) { + if (srcExtentsBuilder_ == null) { + ensureSrcExtentsIsMutable(); + srcExtents_.set(index, builderForValue.build()); + onChanged(); + } else { + srcExtentsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+       * Ordered list of extents that are read from (if any) and written to.
+       * 
+ * + * repeated .chromeos_update_engine.Extent src_extents = 4; + */ + public Builder addSrcExtents(chromeos_update_engine.UpdateMetadata.Extent value) { + if (srcExtentsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSrcExtentsIsMutable(); + srcExtents_.add(value); + onChanged(); + } else { + srcExtentsBuilder_.addMessage(value); + } + return this; + } + /** + *
+       * Ordered list of extents that are read from (if any) and written to.
+       * 
+ * + * repeated .chromeos_update_engine.Extent src_extents = 4; + */ + public Builder addSrcExtents( + int index, chromeos_update_engine.UpdateMetadata.Extent value) { + if (srcExtentsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSrcExtentsIsMutable(); + srcExtents_.add(index, value); + onChanged(); + } else { + srcExtentsBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+       * Ordered list of extents that are read from (if any) and written to.
+       * 
+ * + * repeated .chromeos_update_engine.Extent src_extents = 4; + */ + public Builder addSrcExtents( + chromeos_update_engine.UpdateMetadata.Extent.Builder builderForValue) { + if (srcExtentsBuilder_ == null) { + ensureSrcExtentsIsMutable(); + srcExtents_.add(builderForValue.build()); + onChanged(); + } else { + srcExtentsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+       * Ordered list of extents that are read from (if any) and written to.
+       * 
+ * + * repeated .chromeos_update_engine.Extent src_extents = 4; + */ + public Builder addSrcExtents( + int index, chromeos_update_engine.UpdateMetadata.Extent.Builder builderForValue) { + if (srcExtentsBuilder_ == null) { + ensureSrcExtentsIsMutable(); + srcExtents_.add(index, builderForValue.build()); + onChanged(); + } else { + srcExtentsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+       * Ordered list of extents that are read from (if any) and written to.
+       * 
+ * + * repeated .chromeos_update_engine.Extent src_extents = 4; + */ + public Builder addAllSrcExtents( + java.lang.Iterable values) { + if (srcExtentsBuilder_ == null) { + ensureSrcExtentsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, srcExtents_); + onChanged(); + } else { + srcExtentsBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+       * Ordered list of extents that are read from (if any) and written to.
+       * 
+ * + * repeated .chromeos_update_engine.Extent src_extents = 4; + */ + public Builder clearSrcExtents() { + if (srcExtentsBuilder_ == null) { + srcExtents_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + } else { + srcExtentsBuilder_.clear(); + } + return this; + } + /** + *
+       * Ordered list of extents that are read from (if any) and written to.
+       * 
+ * + * repeated .chromeos_update_engine.Extent src_extents = 4; + */ + public Builder removeSrcExtents(int index) { + if (srcExtentsBuilder_ == null) { + ensureSrcExtentsIsMutable(); + srcExtents_.remove(index); + onChanged(); + } else { + srcExtentsBuilder_.remove(index); + } + return this; + } + /** + *
+       * Ordered list of extents that are read from (if any) and written to.
+       * 
+ * + * repeated .chromeos_update_engine.Extent src_extents = 4; + */ + public chromeos_update_engine.UpdateMetadata.Extent.Builder getSrcExtentsBuilder( + int index) { + return getSrcExtentsFieldBuilder().getBuilder(index); + } + /** + *
+       * Ordered list of extents that are read from (if any) and written to.
+       * 
+ * + * repeated .chromeos_update_engine.Extent src_extents = 4; + */ + public chromeos_update_engine.UpdateMetadata.ExtentOrBuilder getSrcExtentsOrBuilder( + int index) { + if (srcExtentsBuilder_ == null) { + return srcExtents_.get(index); } else { + return srcExtentsBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+       * Ordered list of extents that are read from (if any) and written to.
+       * 
+ * + * repeated .chromeos_update_engine.Extent src_extents = 4; + */ + public java.util.List + getSrcExtentsOrBuilderList() { + if (srcExtentsBuilder_ != null) { + return srcExtentsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(srcExtents_); + } + } + /** + *
+       * Ordered list of extents that are read from (if any) and written to.
+       * 
+ * + * repeated .chromeos_update_engine.Extent src_extents = 4; + */ + public chromeos_update_engine.UpdateMetadata.Extent.Builder addSrcExtentsBuilder() { + return getSrcExtentsFieldBuilder().addBuilder( + chromeos_update_engine.UpdateMetadata.Extent.getDefaultInstance()); + } + /** + *
+       * Ordered list of extents that are read from (if any) and written to.
+       * 
+ * + * repeated .chromeos_update_engine.Extent src_extents = 4; + */ + public chromeos_update_engine.UpdateMetadata.Extent.Builder addSrcExtentsBuilder( + int index) { + return getSrcExtentsFieldBuilder().addBuilder( + index, chromeos_update_engine.UpdateMetadata.Extent.getDefaultInstance()); + } + /** + *
+       * Ordered list of extents that are read from (if any) and written to.
+       * 
+ * + * repeated .chromeos_update_engine.Extent src_extents = 4; + */ + public java.util.List + getSrcExtentsBuilderList() { + return getSrcExtentsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + chromeos_update_engine.UpdateMetadata.Extent, chromeos_update_engine.UpdateMetadata.Extent.Builder, chromeos_update_engine.UpdateMetadata.ExtentOrBuilder> + getSrcExtentsFieldBuilder() { + if (srcExtentsBuilder_ == null) { + srcExtentsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + chromeos_update_engine.UpdateMetadata.Extent, chromeos_update_engine.UpdateMetadata.Extent.Builder, chromeos_update_engine.UpdateMetadata.ExtentOrBuilder>( + srcExtents_, + ((bitField0_ & 0x00000008) != 0), + getParentForChildren(), + isClean()); + srcExtents_ = null; + } + return srcExtentsBuilder_; + } + + private long srcLength_ ; + /** + *
+       * Byte length of src, equal to the number of blocks in src_extents *
+       * block_size. It is used for BSDIFF and SOURCE_BSDIFF, because we need to
+       * pass that external program the number of bytes to read from the blocks we
+       * pass it.  This is not used in any other operation.
+       * 
+ * + * optional uint64 src_length = 5; + * @return Whether the srcLength field is set. + */ + @java.lang.Override + public boolean hasSrcLength() { + return ((bitField0_ & 0x00000010) != 0); + } + /** + *
+       * Byte length of src, equal to the number of blocks in src_extents *
+       * block_size. It is used for BSDIFF and SOURCE_BSDIFF, because we need to
+       * pass that external program the number of bytes to read from the blocks we
+       * pass it.  This is not used in any other operation.
+       * 
+ * + * optional uint64 src_length = 5; + * @return The srcLength. + */ + @java.lang.Override + public long getSrcLength() { + return srcLength_; + } + /** + *
+       * Byte length of src, equal to the number of blocks in src_extents *
+       * block_size. It is used for BSDIFF and SOURCE_BSDIFF, because we need to
+       * pass that external program the number of bytes to read from the blocks we
+       * pass it.  This is not used in any other operation.
+       * 
+ * + * optional uint64 src_length = 5; + * @param value The srcLength to set. + * @return This builder for chaining. + */ + public Builder setSrcLength(long value) { + bitField0_ |= 0x00000010; + srcLength_ = value; + onChanged(); + return this; + } + /** + *
+       * Byte length of src, equal to the number of blocks in src_extents *
+       * block_size. It is used for BSDIFF and SOURCE_BSDIFF, because we need to
+       * pass that external program the number of bytes to read from the blocks we
+       * pass it.  This is not used in any other operation.
+       * 
+ * + * optional uint64 src_length = 5; + * @return This builder for chaining. + */ + public Builder clearSrcLength() { + bitField0_ = (bitField0_ & ~0x00000010); + srcLength_ = 0L; + onChanged(); + return this; + } + + private java.util.List dstExtents_ = + java.util.Collections.emptyList(); + private void ensureDstExtentsIsMutable() { + if (!((bitField0_ & 0x00000020) != 0)) { + dstExtents_ = new java.util.ArrayList(dstExtents_); + bitField0_ |= 0x00000020; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + chromeos_update_engine.UpdateMetadata.Extent, chromeos_update_engine.UpdateMetadata.Extent.Builder, chromeos_update_engine.UpdateMetadata.ExtentOrBuilder> dstExtentsBuilder_; + + /** + * repeated .chromeos_update_engine.Extent dst_extents = 6; + */ + public java.util.List getDstExtentsList() { + if (dstExtentsBuilder_ == null) { + return java.util.Collections.unmodifiableList(dstExtents_); + } else { + return dstExtentsBuilder_.getMessageList(); + } + } + /** + * repeated .chromeos_update_engine.Extent dst_extents = 6; + */ + public int getDstExtentsCount() { + if (dstExtentsBuilder_ == null) { + return dstExtents_.size(); + } else { + return dstExtentsBuilder_.getCount(); + } + } + /** + * repeated .chromeos_update_engine.Extent dst_extents = 6; + */ + public chromeos_update_engine.UpdateMetadata.Extent getDstExtents(int index) { + if (dstExtentsBuilder_ == null) { + return dstExtents_.get(index); + } else { + return dstExtentsBuilder_.getMessage(index); + } + } + /** + * repeated .chromeos_update_engine.Extent dst_extents = 6; + */ + public Builder setDstExtents( + int index, chromeos_update_engine.UpdateMetadata.Extent value) { + if (dstExtentsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDstExtentsIsMutable(); + dstExtents_.set(index, value); + onChanged(); + } else { + dstExtentsBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .chromeos_update_engine.Extent dst_extents = 6; + */ + public Builder setDstExtents( + int index, chromeos_update_engine.UpdateMetadata.Extent.Builder builderForValue) { + if (dstExtentsBuilder_ == null) { + ensureDstExtentsIsMutable(); + dstExtents_.set(index, builderForValue.build()); + onChanged(); + } else { + dstExtentsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .chromeos_update_engine.Extent dst_extents = 6; + */ + public Builder addDstExtents(chromeos_update_engine.UpdateMetadata.Extent value) { + if (dstExtentsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDstExtentsIsMutable(); + dstExtents_.add(value); + onChanged(); + } else { + dstExtentsBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .chromeos_update_engine.Extent dst_extents = 6; + */ + public Builder addDstExtents( + int index, chromeos_update_engine.UpdateMetadata.Extent value) { + if (dstExtentsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDstExtentsIsMutable(); + dstExtents_.add(index, value); + onChanged(); + } else { + dstExtentsBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .chromeos_update_engine.Extent dst_extents = 6; + */ + public Builder addDstExtents( + chromeos_update_engine.UpdateMetadata.Extent.Builder builderForValue) { + if (dstExtentsBuilder_ == null) { + ensureDstExtentsIsMutable(); + dstExtents_.add(builderForValue.build()); + onChanged(); + } else { + dstExtentsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .chromeos_update_engine.Extent dst_extents = 6; + */ + public Builder addDstExtents( + int index, chromeos_update_engine.UpdateMetadata.Extent.Builder builderForValue) { + if (dstExtentsBuilder_ == null) { + ensureDstExtentsIsMutable(); + dstExtents_.add(index, builderForValue.build()); + onChanged(); + } else { + dstExtentsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .chromeos_update_engine.Extent dst_extents = 6; + */ + public Builder addAllDstExtents( + java.lang.Iterable values) { + if (dstExtentsBuilder_ == null) { + ensureDstExtentsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, dstExtents_); + onChanged(); + } else { + dstExtentsBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .chromeos_update_engine.Extent dst_extents = 6; + */ + public Builder clearDstExtents() { + if (dstExtentsBuilder_ == null) { + dstExtents_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000020); + onChanged(); + } else { + dstExtentsBuilder_.clear(); + } + return this; + } + /** + * repeated .chromeos_update_engine.Extent dst_extents = 6; + */ + public Builder removeDstExtents(int index) { + if (dstExtentsBuilder_ == null) { + ensureDstExtentsIsMutable(); + dstExtents_.remove(index); + onChanged(); + } else { + dstExtentsBuilder_.remove(index); + } + return this; + } + /** + * repeated .chromeos_update_engine.Extent dst_extents = 6; + */ + public chromeos_update_engine.UpdateMetadata.Extent.Builder getDstExtentsBuilder( + int index) { + return getDstExtentsFieldBuilder().getBuilder(index); + } + /** + * repeated .chromeos_update_engine.Extent dst_extents = 6; + */ + public chromeos_update_engine.UpdateMetadata.ExtentOrBuilder getDstExtentsOrBuilder( + int index) { + if (dstExtentsBuilder_ == null) { + return dstExtents_.get(index); } else { + return dstExtentsBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .chromeos_update_engine.Extent dst_extents = 6; + */ + public java.util.List + getDstExtentsOrBuilderList() { + if (dstExtentsBuilder_ != null) { + return dstExtentsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(dstExtents_); + } + } + /** + * repeated .chromeos_update_engine.Extent dst_extents = 6; + */ + public chromeos_update_engine.UpdateMetadata.Extent.Builder addDstExtentsBuilder() { + return getDstExtentsFieldBuilder().addBuilder( + chromeos_update_engine.UpdateMetadata.Extent.getDefaultInstance()); + } + /** + * repeated .chromeos_update_engine.Extent dst_extents = 6; + */ + public chromeos_update_engine.UpdateMetadata.Extent.Builder addDstExtentsBuilder( + int index) { + return getDstExtentsFieldBuilder().addBuilder( + index, chromeos_update_engine.UpdateMetadata.Extent.getDefaultInstance()); + } + /** + * repeated .chromeos_update_engine.Extent dst_extents = 6; + */ + public java.util.List + getDstExtentsBuilderList() { + return getDstExtentsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + chromeos_update_engine.UpdateMetadata.Extent, chromeos_update_engine.UpdateMetadata.Extent.Builder, chromeos_update_engine.UpdateMetadata.ExtentOrBuilder> + getDstExtentsFieldBuilder() { + if (dstExtentsBuilder_ == null) { + dstExtentsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + chromeos_update_engine.UpdateMetadata.Extent, chromeos_update_engine.UpdateMetadata.Extent.Builder, chromeos_update_engine.UpdateMetadata.ExtentOrBuilder>( + dstExtents_, + ((bitField0_ & 0x00000020) != 0), + getParentForChildren(), + isClean()); + dstExtents_ = null; + } + return dstExtentsBuilder_; + } + + private long dstLength_ ; + /** + *
+       * Byte length of dst, equal to the number of blocks in dst_extents *
+       * block_size. Used for BSDIFF and SOURCE_BSDIFF, but not in any other
+       * operation.
+       * 
+ * + * optional uint64 dst_length = 7; + * @return Whether the dstLength field is set. + */ + @java.lang.Override + public boolean hasDstLength() { + return ((bitField0_ & 0x00000040) != 0); + } + /** + *
+       * Byte length of dst, equal to the number of blocks in dst_extents *
+       * block_size. Used for BSDIFF and SOURCE_BSDIFF, but not in any other
+       * operation.
+       * 
+ * + * optional uint64 dst_length = 7; + * @return The dstLength. + */ + @java.lang.Override + public long getDstLength() { + return dstLength_; + } + /** + *
+       * Byte length of dst, equal to the number of blocks in dst_extents *
+       * block_size. Used for BSDIFF and SOURCE_BSDIFF, but not in any other
+       * operation.
+       * 
+ * + * optional uint64 dst_length = 7; + * @param value The dstLength to set. + * @return This builder for chaining. + */ + public Builder setDstLength(long value) { + bitField0_ |= 0x00000040; + dstLength_ = value; + onChanged(); + return this; + } + /** + *
+       * Byte length of dst, equal to the number of blocks in dst_extents *
+       * block_size. Used for BSDIFF and SOURCE_BSDIFF, but not in any other
+       * operation.
+       * 
+ * + * optional uint64 dst_length = 7; + * @return This builder for chaining. + */ + public Builder clearDstLength() { + bitField0_ = (bitField0_ & ~0x00000040); + dstLength_ = 0L; + onChanged(); + return this; + } + + private com.google.protobuf.ByteString dataSha256Hash_ = com.google.protobuf.ByteString.EMPTY; + /** + *
+       * Optional SHA 256 hash of the blob associated with this operation.
+       * This is used as a primary validation for http-based downloads and
+       * as a defense-in-depth validation for https-based downloads. If
+       * the operation doesn't refer to any blob, this field will have
+       * zero bytes.
+       * 
+ * + * optional bytes data_sha256_hash = 8; + * @return Whether the dataSha256Hash field is set. + */ + @java.lang.Override + public boolean hasDataSha256Hash() { + return ((bitField0_ & 0x00000080) != 0); + } + /** + *
+       * Optional SHA 256 hash of the blob associated with this operation.
+       * This is used as a primary validation for http-based downloads and
+       * as a defense-in-depth validation for https-based downloads. If
+       * the operation doesn't refer to any blob, this field will have
+       * zero bytes.
+       * 
+ * + * optional bytes data_sha256_hash = 8; + * @return The dataSha256Hash. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDataSha256Hash() { + return dataSha256Hash_; + } + /** + *
+       * Optional SHA 256 hash of the blob associated with this operation.
+       * This is used as a primary validation for http-based downloads and
+       * as a defense-in-depth validation for https-based downloads. If
+       * the operation doesn't refer to any blob, this field will have
+       * zero bytes.
+       * 
+ * + * optional bytes data_sha256_hash = 8; + * @param value The dataSha256Hash to set. + * @return This builder for chaining. + */ + public Builder setDataSha256Hash(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000080; + dataSha256Hash_ = value; + onChanged(); + return this; + } + /** + *
+       * Optional SHA 256 hash of the blob associated with this operation.
+       * This is used as a primary validation for http-based downloads and
+       * as a defense-in-depth validation for https-based downloads. If
+       * the operation doesn't refer to any blob, this field will have
+       * zero bytes.
+       * 
+ * + * optional bytes data_sha256_hash = 8; + * @return This builder for chaining. + */ + public Builder clearDataSha256Hash() { + bitField0_ = (bitField0_ & ~0x00000080); + dataSha256Hash_ = getDefaultInstance().getDataSha256Hash(); + onChanged(); + return this; + } + + private com.google.protobuf.ByteString srcSha256Hash_ = com.google.protobuf.ByteString.EMPTY; + /** + *
+       * Indicates the SHA 256 hash of the source data referenced in src_extents at
+       * the time of applying the operation. If present, the update_engine daemon
+       * MUST read and verify the source data before applying the operation.
+       * 
+ * + * optional bytes src_sha256_hash = 9; + * @return Whether the srcSha256Hash field is set. + */ + @java.lang.Override + public boolean hasSrcSha256Hash() { + return ((bitField0_ & 0x00000100) != 0); + } + /** + *
+       * Indicates the SHA 256 hash of the source data referenced in src_extents at
+       * the time of applying the operation. If present, the update_engine daemon
+       * MUST read and verify the source data before applying the operation.
+       * 
+ * + * optional bytes src_sha256_hash = 9; + * @return The srcSha256Hash. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSrcSha256Hash() { + return srcSha256Hash_; + } + /** + *
+       * Indicates the SHA 256 hash of the source data referenced in src_extents at
+       * the time of applying the operation. If present, the update_engine daemon
+       * MUST read and verify the source data before applying the operation.
+       * 
+ * + * optional bytes src_sha256_hash = 9; + * @param value The srcSha256Hash to set. + * @return This builder for chaining. + */ + public Builder setSrcSha256Hash(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000100; + srcSha256Hash_ = value; + onChanged(); + return this; + } + /** + *
+       * Indicates the SHA 256 hash of the source data referenced in src_extents at
+       * the time of applying the operation. If present, the update_engine daemon
+       * MUST read and verify the source data before applying the operation.
+       * 
+ * + * optional bytes src_sha256_hash = 9; + * @return This builder for chaining. + */ + public Builder clearSrcSha256Hash() { + bitField0_ = (bitField0_ & ~0x00000100); + srcSha256Hash_ = getDefaultInstance().getSrcSha256Hash(); + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:chromeos_update_engine.InstallOperation) + } + + // @@protoc_insertion_point(class_scope:chromeos_update_engine.InstallOperation) + private static final chromeos_update_engine.UpdateMetadata.InstallOperation DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new chromeos_update_engine.UpdateMetadata.InstallOperation(); + } + + public static chromeos_update_engine.UpdateMetadata.InstallOperation getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @java.lang.Deprecated public static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public InstallOperation parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new InstallOperation(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public chromeos_update_engine.UpdateMetadata.InstallOperation getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface PartitionUpdateOrBuilder extends + // @@protoc_insertion_point(interface_extends:chromeos_update_engine.PartitionUpdate) + com.google.protobuf.MessageOrBuilder { + + /** + *
+     * A platform-specific name to identify the partition set being updated. For
+     * example, in Chrome OS this could be "ROOT" or "KERNEL".
+     * 
+ * + * required string partition_name = 1; + * @return Whether the partitionName field is set. + */ + boolean hasPartitionName(); + /** + *
+     * A platform-specific name to identify the partition set being updated. For
+     * example, in Chrome OS this could be "ROOT" or "KERNEL".
+     * 
+ * + * required string partition_name = 1; + * @return The partitionName. + */ + java.lang.String getPartitionName(); + /** + *
+     * A platform-specific name to identify the partition set being updated. For
+     * example, in Chrome OS this could be "ROOT" or "KERNEL".
+     * 
+ * + * required string partition_name = 1; + * @return The bytes for partitionName. + */ + com.google.protobuf.ByteString + getPartitionNameBytes(); + + /** + *
+     * Whether this partition carries a filesystem with post-install program that
+     * must be run to finalize the update process. See also |postinstall_path| and
+     * |filesystem_type|.
+     * 
+ * + * optional bool run_postinstall = 2; + * @return Whether the runPostinstall field is set. + */ + boolean hasRunPostinstall(); + /** + *
+     * Whether this partition carries a filesystem with post-install program that
+     * must be run to finalize the update process. See also |postinstall_path| and
+     * |filesystem_type|.
+     * 
+ * + * optional bool run_postinstall = 2; + * @return The runPostinstall. + */ + boolean getRunPostinstall(); + + /** + *
+     * The path of the executable program to run during the post-install step,
+     * relative to the root of this filesystem. If not set, the default "postinst"
+     * will be used. This setting is only used when |run_postinstall| is set and
+     * true.
+     * 
+ * + * optional string postinstall_path = 3; + * @return Whether the postinstallPath field is set. + */ + boolean hasPostinstallPath(); + /** + *
+     * The path of the executable program to run during the post-install step,
+     * relative to the root of this filesystem. If not set, the default "postinst"
+     * will be used. This setting is only used when |run_postinstall| is set and
+     * true.
+     * 
+ * + * optional string postinstall_path = 3; + * @return The postinstallPath. + */ + java.lang.String getPostinstallPath(); + /** + *
+     * The path of the executable program to run during the post-install step,
+     * relative to the root of this filesystem. If not set, the default "postinst"
+     * will be used. This setting is only used when |run_postinstall| is set and
+     * true.
+     * 
+ * + * optional string postinstall_path = 3; + * @return The bytes for postinstallPath. + */ + com.google.protobuf.ByteString + getPostinstallPathBytes(); + + /** + *
+     * The filesystem type as passed to the mount(2) syscall when mounting the new
+     * filesystem to run the post-install program. If not set, a fixed list of
+     * filesystems will be attempted. This setting is only used if
+     * |run_postinstall| is set and true.
+     * 
+ * + * optional string filesystem_type = 4; + * @return Whether the filesystemType field is set. + */ + boolean hasFilesystemType(); + /** + *
+     * The filesystem type as passed to the mount(2) syscall when mounting the new
+     * filesystem to run the post-install program. If not set, a fixed list of
+     * filesystems will be attempted. This setting is only used if
+     * |run_postinstall| is set and true.
+     * 
+ * + * optional string filesystem_type = 4; + * @return The filesystemType. + */ + java.lang.String getFilesystemType(); + /** + *
+     * The filesystem type as passed to the mount(2) syscall when mounting the new
+     * filesystem to run the post-install program. If not set, a fixed list of
+     * filesystems will be attempted. This setting is only used if
+     * |run_postinstall| is set and true.
+     * 
+ * + * optional string filesystem_type = 4; + * @return The bytes for filesystemType. + */ + com.google.protobuf.ByteString + getFilesystemTypeBytes(); + + /** + *
+     * If present, a list of signatures of the new_partition_info.hash signed with
+     * different keys. If the update_engine daemon requires vendor-signed images
+     * and has its public key installed, one of the signatures should be valid
+     * for /postinstall to run.
+     * 
+ * + * repeated .chromeos_update_engine.Signatures.Signature new_partition_signature = 5; + */ + java.util.List + getNewPartitionSignatureList(); + /** + *
+     * If present, a list of signatures of the new_partition_info.hash signed with
+     * different keys. If the update_engine daemon requires vendor-signed images
+     * and has its public key installed, one of the signatures should be valid
+     * for /postinstall to run.
+     * 
+ * + * repeated .chromeos_update_engine.Signatures.Signature new_partition_signature = 5; + */ + chromeos_update_engine.UpdateMetadata.Signatures.Signature getNewPartitionSignature(int index); + /** + *
+     * If present, a list of signatures of the new_partition_info.hash signed with
+     * different keys. If the update_engine daemon requires vendor-signed images
+     * and has its public key installed, one of the signatures should be valid
+     * for /postinstall to run.
+     * 
+ * + * repeated .chromeos_update_engine.Signatures.Signature new_partition_signature = 5; + */ + int getNewPartitionSignatureCount(); + /** + *
+     * If present, a list of signatures of the new_partition_info.hash signed with
+     * different keys. If the update_engine daemon requires vendor-signed images
+     * and has its public key installed, one of the signatures should be valid
+     * for /postinstall to run.
+     * 
+ * + * repeated .chromeos_update_engine.Signatures.Signature new_partition_signature = 5; + */ + java.util.List + getNewPartitionSignatureOrBuilderList(); + /** + *
+     * If present, a list of signatures of the new_partition_info.hash signed with
+     * different keys. If the update_engine daemon requires vendor-signed images
+     * and has its public key installed, one of the signatures should be valid
+     * for /postinstall to run.
+     * 
+ * + * repeated .chromeos_update_engine.Signatures.Signature new_partition_signature = 5; + */ + chromeos_update_engine.UpdateMetadata.Signatures.SignatureOrBuilder getNewPartitionSignatureOrBuilder( + int index); + + /** + * optional .chromeos_update_engine.PartitionInfo old_partition_info = 6; + * @return Whether the oldPartitionInfo field is set. + */ + boolean hasOldPartitionInfo(); + /** + * optional .chromeos_update_engine.PartitionInfo old_partition_info = 6; + * @return The oldPartitionInfo. + */ + chromeos_update_engine.UpdateMetadata.PartitionInfo getOldPartitionInfo(); + /** + * optional .chromeos_update_engine.PartitionInfo old_partition_info = 6; + */ + chromeos_update_engine.UpdateMetadata.PartitionInfoOrBuilder getOldPartitionInfoOrBuilder(); + + /** + * optional .chromeos_update_engine.PartitionInfo new_partition_info = 7; + * @return Whether the newPartitionInfo field is set. + */ + boolean hasNewPartitionInfo(); + /** + * optional .chromeos_update_engine.PartitionInfo new_partition_info = 7; + * @return The newPartitionInfo. + */ + chromeos_update_engine.UpdateMetadata.PartitionInfo getNewPartitionInfo(); + /** + * optional .chromeos_update_engine.PartitionInfo new_partition_info = 7; + */ + chromeos_update_engine.UpdateMetadata.PartitionInfoOrBuilder getNewPartitionInfoOrBuilder(); + + /** + *
+     * The list of operations to be performed to apply this PartitionUpdate. The
+     * associated operation blobs (in operations[i].data_offset, data_length)
+     * should be stored contiguously and in the same order.
+     * 
+ * + * repeated .chromeos_update_engine.InstallOperation operations = 8; + */ + java.util.List + getOperationsList(); + /** + *
+     * The list of operations to be performed to apply this PartitionUpdate. The
+     * associated operation blobs (in operations[i].data_offset, data_length)
+     * should be stored contiguously and in the same order.
+     * 
+ * + * repeated .chromeos_update_engine.InstallOperation operations = 8; + */ + chromeos_update_engine.UpdateMetadata.InstallOperation getOperations(int index); + /** + *
+     * The list of operations to be performed to apply this PartitionUpdate. The
+     * associated operation blobs (in operations[i].data_offset, data_length)
+     * should be stored contiguously and in the same order.
+     * 
+ * + * repeated .chromeos_update_engine.InstallOperation operations = 8; + */ + int getOperationsCount(); + /** + *
+     * The list of operations to be performed to apply this PartitionUpdate. The
+     * associated operation blobs (in operations[i].data_offset, data_length)
+     * should be stored contiguously and in the same order.
+     * 
+ * + * repeated .chromeos_update_engine.InstallOperation operations = 8; + */ + java.util.List + getOperationsOrBuilderList(); + /** + *
+     * The list of operations to be performed to apply this PartitionUpdate. The
+     * associated operation blobs (in operations[i].data_offset, data_length)
+     * should be stored contiguously and in the same order.
+     * 
+ * + * repeated .chromeos_update_engine.InstallOperation operations = 8; + */ + chromeos_update_engine.UpdateMetadata.InstallOperationOrBuilder getOperationsOrBuilder( + int index); + + /** + *
+     * Whether a failure in the postinstall step for this partition should be
+     * ignored.
+     * 
+ * + * optional bool postinstall_optional = 9; + * @return Whether the postinstallOptional field is set. + */ + boolean hasPostinstallOptional(); + /** + *
+     * Whether a failure in the postinstall step for this partition should be
+     * ignored.
+     * 
+ * + * optional bool postinstall_optional = 9; + * @return The postinstallOptional. + */ + boolean getPostinstallOptional(); + + /** + *
+     * The extent for data covered by verity hash tree.
+     * 
+ * + * optional .chromeos_update_engine.Extent hash_tree_data_extent = 10; + * @return Whether the hashTreeDataExtent field is set. + */ + boolean hasHashTreeDataExtent(); + /** + *
+     * The extent for data covered by verity hash tree.
+     * 
+ * + * optional .chromeos_update_engine.Extent hash_tree_data_extent = 10; + * @return The hashTreeDataExtent. + */ + chromeos_update_engine.UpdateMetadata.Extent getHashTreeDataExtent(); + /** + *
+     * The extent for data covered by verity hash tree.
+     * 
+ * + * optional .chromeos_update_engine.Extent hash_tree_data_extent = 10; + */ + chromeos_update_engine.UpdateMetadata.ExtentOrBuilder getHashTreeDataExtentOrBuilder(); + + /** + *
+     * The extent to store verity hash tree.
+     * 
+ * + * optional .chromeos_update_engine.Extent hash_tree_extent = 11; + * @return Whether the hashTreeExtent field is set. + */ + boolean hasHashTreeExtent(); + /** + *
+     * The extent to store verity hash tree.
+     * 
+ * + * optional .chromeos_update_engine.Extent hash_tree_extent = 11; + * @return The hashTreeExtent. + */ + chromeos_update_engine.UpdateMetadata.Extent getHashTreeExtent(); + /** + *
+     * The extent to store verity hash tree.
+     * 
+ * + * optional .chromeos_update_engine.Extent hash_tree_extent = 11; + */ + chromeos_update_engine.UpdateMetadata.ExtentOrBuilder getHashTreeExtentOrBuilder(); + + /** + *
+     * The hash algorithm used in verity hash tree.
+     * 
+ * + * optional string hash_tree_algorithm = 12; + * @return Whether the hashTreeAlgorithm field is set. + */ + boolean hasHashTreeAlgorithm(); + /** + *
+     * The hash algorithm used in verity hash tree.
+     * 
+ * + * optional string hash_tree_algorithm = 12; + * @return The hashTreeAlgorithm. + */ + java.lang.String getHashTreeAlgorithm(); + /** + *
+     * The hash algorithm used in verity hash tree.
+     * 
+ * + * optional string hash_tree_algorithm = 12; + * @return The bytes for hashTreeAlgorithm. + */ + com.google.protobuf.ByteString + getHashTreeAlgorithmBytes(); + + /** + *
+     * The salt used for verity hash tree.
+     * 
+ * + * optional bytes hash_tree_salt = 13; + * @return Whether the hashTreeSalt field is set. + */ + boolean hasHashTreeSalt(); + /** + *
+     * The salt used for verity hash tree.
+     * 
+ * + * optional bytes hash_tree_salt = 13; + * @return The hashTreeSalt. + */ + com.google.protobuf.ByteString getHashTreeSalt(); + + /** + *
+     * The extent for data covered by FEC.
+     * 
+ * + * optional .chromeos_update_engine.Extent fec_data_extent = 14; + * @return Whether the fecDataExtent field is set. + */ + boolean hasFecDataExtent(); + /** + *
+     * The extent for data covered by FEC.
+     * 
+ * + * optional .chromeos_update_engine.Extent fec_data_extent = 14; + * @return The fecDataExtent. + */ + chromeos_update_engine.UpdateMetadata.Extent getFecDataExtent(); + /** + *
+     * The extent for data covered by FEC.
+     * 
+ * + * optional .chromeos_update_engine.Extent fec_data_extent = 14; + */ + chromeos_update_engine.UpdateMetadata.ExtentOrBuilder getFecDataExtentOrBuilder(); + + /** + *
+     * The extent to store FEC.
+     * 
+ * + * optional .chromeos_update_engine.Extent fec_extent = 15; + * @return Whether the fecExtent field is set. + */ + boolean hasFecExtent(); + /** + *
+     * The extent to store FEC.
+     * 
+ * + * optional .chromeos_update_engine.Extent fec_extent = 15; + * @return The fecExtent. + */ + chromeos_update_engine.UpdateMetadata.Extent getFecExtent(); + /** + *
+     * The extent to store FEC.
+     * 
+ * + * optional .chromeos_update_engine.Extent fec_extent = 15; + */ + chromeos_update_engine.UpdateMetadata.ExtentOrBuilder getFecExtentOrBuilder(); + + /** + *
+     * The number of FEC roots.
+     * 
+ * + * optional uint32 fec_roots = 16 [default = 2]; + * @return Whether the fecRoots field is set. + */ + boolean hasFecRoots(); + /** + *
+     * The number of FEC roots.
+     * 
+ * + * optional uint32 fec_roots = 16 [default = 2]; + * @return The fecRoots. + */ + int getFecRoots(); + } + /** + *
+   * Describes the update to apply to a single partition.
+   * 
+ * + * Protobuf type {@code chromeos_update_engine.PartitionUpdate} + */ + public static final class PartitionUpdate extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:chromeos_update_engine.PartitionUpdate) + PartitionUpdateOrBuilder { + private static final long serialVersionUID = 0L; + // Use PartitionUpdate.newBuilder() to construct. + private PartitionUpdate(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private PartitionUpdate() { + partitionName_ = ""; + postinstallPath_ = ""; + filesystemType_ = ""; + newPartitionSignature_ = java.util.Collections.emptyList(); + operations_ = java.util.Collections.emptyList(); + hashTreeAlgorithm_ = ""; + hashTreeSalt_ = com.google.protobuf.ByteString.EMPTY; + fecRoots_ = 2; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new PartitionUpdate(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private PartitionUpdate( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + com.google.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00000001; + partitionName_ = bs; + break; + } + case 16: { + bitField0_ |= 0x00000002; + runPostinstall_ = input.readBool(); + break; + } + case 26: { + com.google.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00000004; + postinstallPath_ = bs; + break; + } + case 34: { + com.google.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00000008; + filesystemType_ = bs; + break; + } + case 42: { + if (!((mutable_bitField0_ & 0x00000010) != 0)) { + newPartitionSignature_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000010; + } + newPartitionSignature_.add( + input.readMessage(chromeos_update_engine.UpdateMetadata.Signatures.Signature.PARSER, extensionRegistry)); + break; + } + case 50: { + chromeos_update_engine.UpdateMetadata.PartitionInfo.Builder subBuilder = null; + if (((bitField0_ & 0x00000010) != 0)) { + subBuilder = oldPartitionInfo_.toBuilder(); + } + oldPartitionInfo_ = input.readMessage(chromeos_update_engine.UpdateMetadata.PartitionInfo.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(oldPartitionInfo_); + oldPartitionInfo_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00000010; + break; + } + case 58: { + chromeos_update_engine.UpdateMetadata.PartitionInfo.Builder subBuilder = null; + if (((bitField0_ & 0x00000020) != 0)) { + subBuilder = newPartitionInfo_.toBuilder(); + } + newPartitionInfo_ = input.readMessage(chromeos_update_engine.UpdateMetadata.PartitionInfo.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(newPartitionInfo_); + newPartitionInfo_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00000020; + break; + } + case 66: { + if (!((mutable_bitField0_ & 0x00000080) != 0)) { + operations_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000080; + } + operations_.add( + input.readMessage(chromeos_update_engine.UpdateMetadata.InstallOperation.PARSER, extensionRegistry)); + break; + } + case 72: { + bitField0_ |= 0x00000040; + postinstallOptional_ = input.readBool(); + break; + } + case 82: { + chromeos_update_engine.UpdateMetadata.Extent.Builder subBuilder = null; + if (((bitField0_ & 0x00000080) != 0)) { + subBuilder = hashTreeDataExtent_.toBuilder(); + } + hashTreeDataExtent_ = input.readMessage(chromeos_update_engine.UpdateMetadata.Extent.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(hashTreeDataExtent_); + hashTreeDataExtent_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00000080; + break; + } + case 90: { + chromeos_update_engine.UpdateMetadata.Extent.Builder subBuilder = null; + if (((bitField0_ & 0x00000100) != 0)) { + subBuilder = hashTreeExtent_.toBuilder(); + } + hashTreeExtent_ = input.readMessage(chromeos_update_engine.UpdateMetadata.Extent.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(hashTreeExtent_); + hashTreeExtent_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00000100; + break; + } + case 98: { + com.google.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00000200; + hashTreeAlgorithm_ = bs; + break; + } + case 106: { + bitField0_ |= 0x00000400; + hashTreeSalt_ = input.readBytes(); + break; + } + case 114: { + chromeos_update_engine.UpdateMetadata.Extent.Builder subBuilder = null; + if (((bitField0_ & 0x00000800) != 0)) { + subBuilder = fecDataExtent_.toBuilder(); + } + fecDataExtent_ = input.readMessage(chromeos_update_engine.UpdateMetadata.Extent.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(fecDataExtent_); + fecDataExtent_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00000800; + break; + } + case 122: { + chromeos_update_engine.UpdateMetadata.Extent.Builder subBuilder = null; + if (((bitField0_ & 0x00001000) != 0)) { + subBuilder = fecExtent_.toBuilder(); + } + fecExtent_ = input.readMessage(chromeos_update_engine.UpdateMetadata.Extent.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(fecExtent_); + fecExtent_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00001000; + break; + } + case 128: { + bitField0_ |= 0x00002000; + fecRoots_ = input.readUInt32(); + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000010) != 0)) { + newPartitionSignature_ = java.util.Collections.unmodifiableList(newPartitionSignature_); + } + if (((mutable_bitField0_ & 0x00000080) != 0)) { + operations_ = java.util.Collections.unmodifiableList(operations_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return chromeos_update_engine.UpdateMetadata.internal_static_chromeos_update_engine_PartitionUpdate_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return chromeos_update_engine.UpdateMetadata.internal_static_chromeos_update_engine_PartitionUpdate_fieldAccessorTable + .ensureFieldAccessorsInitialized( + chromeos_update_engine.UpdateMetadata.PartitionUpdate.class, chromeos_update_engine.UpdateMetadata.PartitionUpdate.Builder.class); + } + + private int bitField0_; + public static final int PARTITION_NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object partitionName_; + /** + *
+     * A platform-specific name to identify the partition set being updated. For
+     * example, in Chrome OS this could be "ROOT" or "KERNEL".
+     * 
+ * + * required string partition_name = 1; + * @return Whether the partitionName field is set. + */ + @java.lang.Override + public boolean hasPartitionName() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + *
+     * A platform-specific name to identify the partition set being updated. For
+     * example, in Chrome OS this could be "ROOT" or "KERNEL".
+     * 
+ * + * required string partition_name = 1; + * @return The partitionName. + */ + @java.lang.Override + public java.lang.String getPartitionName() { + java.lang.Object ref = partitionName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + partitionName_ = s; + } + return s; + } + } + /** + *
+     * A platform-specific name to identify the partition set being updated. For
+     * example, in Chrome OS this could be "ROOT" or "KERNEL".
+     * 
+ * + * required string partition_name = 1; + * @return The bytes for partitionName. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getPartitionNameBytes() { + java.lang.Object ref = partitionName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + partitionName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int RUN_POSTINSTALL_FIELD_NUMBER = 2; + private boolean runPostinstall_; + /** + *
+     * Whether this partition carries a filesystem with post-install program that
+     * must be run to finalize the update process. See also |postinstall_path| and
+     * |filesystem_type|.
+     * 
+ * + * optional bool run_postinstall = 2; + * @return Whether the runPostinstall field is set. + */ + @java.lang.Override + public boolean hasRunPostinstall() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + *
+     * Whether this partition carries a filesystem with post-install program that
+     * must be run to finalize the update process. See also |postinstall_path| and
+     * |filesystem_type|.
+     * 
+ * + * optional bool run_postinstall = 2; + * @return The runPostinstall. + */ + @java.lang.Override + public boolean getRunPostinstall() { + return runPostinstall_; + } + + public static final int POSTINSTALL_PATH_FIELD_NUMBER = 3; + private volatile java.lang.Object postinstallPath_; + /** + *
+     * The path of the executable program to run during the post-install step,
+     * relative to the root of this filesystem. If not set, the default "postinst"
+     * will be used. This setting is only used when |run_postinstall| is set and
+     * true.
+     * 
+ * + * optional string postinstall_path = 3; + * @return Whether the postinstallPath field is set. + */ + @java.lang.Override + public boolean hasPostinstallPath() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + *
+     * The path of the executable program to run during the post-install step,
+     * relative to the root of this filesystem. If not set, the default "postinst"
+     * will be used. This setting is only used when |run_postinstall| is set and
+     * true.
+     * 
+ * + * optional string postinstall_path = 3; + * @return The postinstallPath. + */ + @java.lang.Override + public java.lang.String getPostinstallPath() { + java.lang.Object ref = postinstallPath_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + postinstallPath_ = s; + } + return s; + } + } + /** + *
+     * The path of the executable program to run during the post-install step,
+     * relative to the root of this filesystem. If not set, the default "postinst"
+     * will be used. This setting is only used when |run_postinstall| is set and
+     * true.
+     * 
+ * + * optional string postinstall_path = 3; + * @return The bytes for postinstallPath. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getPostinstallPathBytes() { + java.lang.Object ref = postinstallPath_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + postinstallPath_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FILESYSTEM_TYPE_FIELD_NUMBER = 4; + private volatile java.lang.Object filesystemType_; + /** + *
+     * The filesystem type as passed to the mount(2) syscall when mounting the new
+     * filesystem to run the post-install program. If not set, a fixed list of
+     * filesystems will be attempted. This setting is only used if
+     * |run_postinstall| is set and true.
+     * 
+ * + * optional string filesystem_type = 4; + * @return Whether the filesystemType field is set. + */ + @java.lang.Override + public boolean hasFilesystemType() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + *
+     * The filesystem type as passed to the mount(2) syscall when mounting the new
+     * filesystem to run the post-install program. If not set, a fixed list of
+     * filesystems will be attempted. This setting is only used if
+     * |run_postinstall| is set and true.
+     * 
+ * + * optional string filesystem_type = 4; + * @return The filesystemType. + */ + @java.lang.Override + public java.lang.String getFilesystemType() { + java.lang.Object ref = filesystemType_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + filesystemType_ = s; + } + return s; + } + } + /** + *
+     * The filesystem type as passed to the mount(2) syscall when mounting the new
+     * filesystem to run the post-install program. If not set, a fixed list of
+     * filesystems will be attempted. This setting is only used if
+     * |run_postinstall| is set and true.
+     * 
+ * + * optional string filesystem_type = 4; + * @return The bytes for filesystemType. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getFilesystemTypeBytes() { + java.lang.Object ref = filesystemType_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + filesystemType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int NEW_PARTITION_SIGNATURE_FIELD_NUMBER = 5; + private java.util.List newPartitionSignature_; + /** + *
+     * If present, a list of signatures of the new_partition_info.hash signed with
+     * different keys. If the update_engine daemon requires vendor-signed images
+     * and has its public key installed, one of the signatures should be valid
+     * for /postinstall to run.
+     * 
+ * + * repeated .chromeos_update_engine.Signatures.Signature new_partition_signature = 5; + */ + @java.lang.Override + public java.util.List getNewPartitionSignatureList() { + return newPartitionSignature_; + } + /** + *
+     * If present, a list of signatures of the new_partition_info.hash signed with
+     * different keys. If the update_engine daemon requires vendor-signed images
+     * and has its public key installed, one of the signatures should be valid
+     * for /postinstall to run.
+     * 
+ * + * repeated .chromeos_update_engine.Signatures.Signature new_partition_signature = 5; + */ + @java.lang.Override + public java.util.List + getNewPartitionSignatureOrBuilderList() { + return newPartitionSignature_; + } + /** + *
+     * If present, a list of signatures of the new_partition_info.hash signed with
+     * different keys. If the update_engine daemon requires vendor-signed images
+     * and has its public key installed, one of the signatures should be valid
+     * for /postinstall to run.
+     * 
+ * + * repeated .chromeos_update_engine.Signatures.Signature new_partition_signature = 5; + */ + @java.lang.Override + public int getNewPartitionSignatureCount() { + return newPartitionSignature_.size(); + } + /** + *
+     * If present, a list of signatures of the new_partition_info.hash signed with
+     * different keys. If the update_engine daemon requires vendor-signed images
+     * and has its public key installed, one of the signatures should be valid
+     * for /postinstall to run.
+     * 
+ * + * repeated .chromeos_update_engine.Signatures.Signature new_partition_signature = 5; + */ + @java.lang.Override + public chromeos_update_engine.UpdateMetadata.Signatures.Signature getNewPartitionSignature(int index) { + return newPartitionSignature_.get(index); + } + /** + *
+     * If present, a list of signatures of the new_partition_info.hash signed with
+     * different keys. If the update_engine daemon requires vendor-signed images
+     * and has its public key installed, one of the signatures should be valid
+     * for /postinstall to run.
+     * 
+ * + * repeated .chromeos_update_engine.Signatures.Signature new_partition_signature = 5; + */ + @java.lang.Override + public chromeos_update_engine.UpdateMetadata.Signatures.SignatureOrBuilder getNewPartitionSignatureOrBuilder( + int index) { + return newPartitionSignature_.get(index); + } + + public static final int OLD_PARTITION_INFO_FIELD_NUMBER = 6; + private chromeos_update_engine.UpdateMetadata.PartitionInfo oldPartitionInfo_; + /** + * optional .chromeos_update_engine.PartitionInfo old_partition_info = 6; + * @return Whether the oldPartitionInfo field is set. + */ + @java.lang.Override + public boolean hasOldPartitionInfo() { + return ((bitField0_ & 0x00000010) != 0); + } + /** + * optional .chromeos_update_engine.PartitionInfo old_partition_info = 6; + * @return The oldPartitionInfo. + */ + @java.lang.Override + public chromeos_update_engine.UpdateMetadata.PartitionInfo getOldPartitionInfo() { + return oldPartitionInfo_ == null ? chromeos_update_engine.UpdateMetadata.PartitionInfo.getDefaultInstance() : oldPartitionInfo_; + } + /** + * optional .chromeos_update_engine.PartitionInfo old_partition_info = 6; + */ + @java.lang.Override + public chromeos_update_engine.UpdateMetadata.PartitionInfoOrBuilder getOldPartitionInfoOrBuilder() { + return oldPartitionInfo_ == null ? chromeos_update_engine.UpdateMetadata.PartitionInfo.getDefaultInstance() : oldPartitionInfo_; + } + + public static final int NEW_PARTITION_INFO_FIELD_NUMBER = 7; + private chromeos_update_engine.UpdateMetadata.PartitionInfo newPartitionInfo_; + /** + * optional .chromeos_update_engine.PartitionInfo new_partition_info = 7; + * @return Whether the newPartitionInfo field is set. + */ + @java.lang.Override + public boolean hasNewPartitionInfo() { + return ((bitField0_ & 0x00000020) != 0); + } + /** + * optional .chromeos_update_engine.PartitionInfo new_partition_info = 7; + * @return The newPartitionInfo. + */ + @java.lang.Override + public chromeos_update_engine.UpdateMetadata.PartitionInfo getNewPartitionInfo() { + return newPartitionInfo_ == null ? chromeos_update_engine.UpdateMetadata.PartitionInfo.getDefaultInstance() : newPartitionInfo_; + } + /** + * optional .chromeos_update_engine.PartitionInfo new_partition_info = 7; + */ + @java.lang.Override + public chromeos_update_engine.UpdateMetadata.PartitionInfoOrBuilder getNewPartitionInfoOrBuilder() { + return newPartitionInfo_ == null ? chromeos_update_engine.UpdateMetadata.PartitionInfo.getDefaultInstance() : newPartitionInfo_; + } + + public static final int OPERATIONS_FIELD_NUMBER = 8; + private java.util.List operations_; + /** + *
+     * The list of operations to be performed to apply this PartitionUpdate. The
+     * associated operation blobs (in operations[i].data_offset, data_length)
+     * should be stored contiguously and in the same order.
+     * 
+ * + * repeated .chromeos_update_engine.InstallOperation operations = 8; + */ + @java.lang.Override + public java.util.List getOperationsList() { + return operations_; + } + /** + *
+     * The list of operations to be performed to apply this PartitionUpdate. The
+     * associated operation blobs (in operations[i].data_offset, data_length)
+     * should be stored contiguously and in the same order.
+     * 
+ * + * repeated .chromeos_update_engine.InstallOperation operations = 8; + */ + @java.lang.Override + public java.util.List + getOperationsOrBuilderList() { + return operations_; + } + /** + *
+     * The list of operations to be performed to apply this PartitionUpdate. The
+     * associated operation blobs (in operations[i].data_offset, data_length)
+     * should be stored contiguously and in the same order.
+     * 
+ * + * repeated .chromeos_update_engine.InstallOperation operations = 8; + */ + @java.lang.Override + public int getOperationsCount() { + return operations_.size(); + } + /** + *
+     * The list of operations to be performed to apply this PartitionUpdate. The
+     * associated operation blobs (in operations[i].data_offset, data_length)
+     * should be stored contiguously and in the same order.
+     * 
+ * + * repeated .chromeos_update_engine.InstallOperation operations = 8; + */ + @java.lang.Override + public chromeos_update_engine.UpdateMetadata.InstallOperation getOperations(int index) { + return operations_.get(index); + } + /** + *
+     * The list of operations to be performed to apply this PartitionUpdate. The
+     * associated operation blobs (in operations[i].data_offset, data_length)
+     * should be stored contiguously and in the same order.
+     * 
+ * + * repeated .chromeos_update_engine.InstallOperation operations = 8; + */ + @java.lang.Override + public chromeos_update_engine.UpdateMetadata.InstallOperationOrBuilder getOperationsOrBuilder( + int index) { + return operations_.get(index); + } + + public static final int POSTINSTALL_OPTIONAL_FIELD_NUMBER = 9; + private boolean postinstallOptional_; + /** + *
+     * Whether a failure in the postinstall step for this partition should be
+     * ignored.
+     * 
+ * + * optional bool postinstall_optional = 9; + * @return Whether the postinstallOptional field is set. + */ + @java.lang.Override + public boolean hasPostinstallOptional() { + return ((bitField0_ & 0x00000040) != 0); + } + /** + *
+     * Whether a failure in the postinstall step for this partition should be
+     * ignored.
+     * 
+ * + * optional bool postinstall_optional = 9; + * @return The postinstallOptional. + */ + @java.lang.Override + public boolean getPostinstallOptional() { + return postinstallOptional_; + } + + public static final int HASH_TREE_DATA_EXTENT_FIELD_NUMBER = 10; + private chromeos_update_engine.UpdateMetadata.Extent hashTreeDataExtent_; + /** + *
+     * The extent for data covered by verity hash tree.
+     * 
+ * + * optional .chromeos_update_engine.Extent hash_tree_data_extent = 10; + * @return Whether the hashTreeDataExtent field is set. + */ + @java.lang.Override + public boolean hasHashTreeDataExtent() { + return ((bitField0_ & 0x00000080) != 0); + } + /** + *
+     * The extent for data covered by verity hash tree.
+     * 
+ * + * optional .chromeos_update_engine.Extent hash_tree_data_extent = 10; + * @return The hashTreeDataExtent. + */ + @java.lang.Override + public chromeos_update_engine.UpdateMetadata.Extent getHashTreeDataExtent() { + return hashTreeDataExtent_ == null ? chromeos_update_engine.UpdateMetadata.Extent.getDefaultInstance() : hashTreeDataExtent_; + } + /** + *
+     * The extent for data covered by verity hash tree.
+     * 
+ * + * optional .chromeos_update_engine.Extent hash_tree_data_extent = 10; + */ + @java.lang.Override + public chromeos_update_engine.UpdateMetadata.ExtentOrBuilder getHashTreeDataExtentOrBuilder() { + return hashTreeDataExtent_ == null ? chromeos_update_engine.UpdateMetadata.Extent.getDefaultInstance() : hashTreeDataExtent_; + } + + public static final int HASH_TREE_EXTENT_FIELD_NUMBER = 11; + private chromeos_update_engine.UpdateMetadata.Extent hashTreeExtent_; + /** + *
+     * The extent to store verity hash tree.
+     * 
+ * + * optional .chromeos_update_engine.Extent hash_tree_extent = 11; + * @return Whether the hashTreeExtent field is set. + */ + @java.lang.Override + public boolean hasHashTreeExtent() { + return ((bitField0_ & 0x00000100) != 0); + } + /** + *
+     * The extent to store verity hash tree.
+     * 
+ * + * optional .chromeos_update_engine.Extent hash_tree_extent = 11; + * @return The hashTreeExtent. + */ + @java.lang.Override + public chromeos_update_engine.UpdateMetadata.Extent getHashTreeExtent() { + return hashTreeExtent_ == null ? chromeos_update_engine.UpdateMetadata.Extent.getDefaultInstance() : hashTreeExtent_; + } + /** + *
+     * The extent to store verity hash tree.
+     * 
+ * + * optional .chromeos_update_engine.Extent hash_tree_extent = 11; + */ + @java.lang.Override + public chromeos_update_engine.UpdateMetadata.ExtentOrBuilder getHashTreeExtentOrBuilder() { + return hashTreeExtent_ == null ? chromeos_update_engine.UpdateMetadata.Extent.getDefaultInstance() : hashTreeExtent_; + } + + public static final int HASH_TREE_ALGORITHM_FIELD_NUMBER = 12; + private volatile java.lang.Object hashTreeAlgorithm_; + /** + *
+     * The hash algorithm used in verity hash tree.
+     * 
+ * + * optional string hash_tree_algorithm = 12; + * @return Whether the hashTreeAlgorithm field is set. + */ + @java.lang.Override + public boolean hasHashTreeAlgorithm() { + return ((bitField0_ & 0x00000200) != 0); + } + /** + *
+     * The hash algorithm used in verity hash tree.
+     * 
+ * + * optional string hash_tree_algorithm = 12; + * @return The hashTreeAlgorithm. + */ + @java.lang.Override + public java.lang.String getHashTreeAlgorithm() { + java.lang.Object ref = hashTreeAlgorithm_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + hashTreeAlgorithm_ = s; + } + return s; + } + } + /** + *
+     * The hash algorithm used in verity hash tree.
+     * 
+ * + * optional string hash_tree_algorithm = 12; + * @return The bytes for hashTreeAlgorithm. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getHashTreeAlgorithmBytes() { + java.lang.Object ref = hashTreeAlgorithm_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + hashTreeAlgorithm_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int HASH_TREE_SALT_FIELD_NUMBER = 13; + private com.google.protobuf.ByteString hashTreeSalt_; + /** + *
+     * The salt used for verity hash tree.
+     * 
+ * + * optional bytes hash_tree_salt = 13; + * @return Whether the hashTreeSalt field is set. + */ + @java.lang.Override + public boolean hasHashTreeSalt() { + return ((bitField0_ & 0x00000400) != 0); + } + /** + *
+     * The salt used for verity hash tree.
+     * 
+ * + * optional bytes hash_tree_salt = 13; + * @return The hashTreeSalt. + */ + @java.lang.Override + public com.google.protobuf.ByteString getHashTreeSalt() { + return hashTreeSalt_; + } + + public static final int FEC_DATA_EXTENT_FIELD_NUMBER = 14; + private chromeos_update_engine.UpdateMetadata.Extent fecDataExtent_; + /** + *
+     * The extent for data covered by FEC.
+     * 
+ * + * optional .chromeos_update_engine.Extent fec_data_extent = 14; + * @return Whether the fecDataExtent field is set. + */ + @java.lang.Override + public boolean hasFecDataExtent() { + return ((bitField0_ & 0x00000800) != 0); + } + /** + *
+     * The extent for data covered by FEC.
+     * 
+ * + * optional .chromeos_update_engine.Extent fec_data_extent = 14; + * @return The fecDataExtent. + */ + @java.lang.Override + public chromeos_update_engine.UpdateMetadata.Extent getFecDataExtent() { + return fecDataExtent_ == null ? chromeos_update_engine.UpdateMetadata.Extent.getDefaultInstance() : fecDataExtent_; + } + /** + *
+     * The extent for data covered by FEC.
+     * 
+ * + * optional .chromeos_update_engine.Extent fec_data_extent = 14; + */ + @java.lang.Override + public chromeos_update_engine.UpdateMetadata.ExtentOrBuilder getFecDataExtentOrBuilder() { + return fecDataExtent_ == null ? chromeos_update_engine.UpdateMetadata.Extent.getDefaultInstance() : fecDataExtent_; + } + + public static final int FEC_EXTENT_FIELD_NUMBER = 15; + private chromeos_update_engine.UpdateMetadata.Extent fecExtent_; + /** + *
+     * The extent to store FEC.
+     * 
+ * + * optional .chromeos_update_engine.Extent fec_extent = 15; + * @return Whether the fecExtent field is set. + */ + @java.lang.Override + public boolean hasFecExtent() { + return ((bitField0_ & 0x00001000) != 0); + } + /** + *
+     * The extent to store FEC.
+     * 
+ * + * optional .chromeos_update_engine.Extent fec_extent = 15; + * @return The fecExtent. + */ + @java.lang.Override + public chromeos_update_engine.UpdateMetadata.Extent getFecExtent() { + return fecExtent_ == null ? chromeos_update_engine.UpdateMetadata.Extent.getDefaultInstance() : fecExtent_; + } + /** + *
+     * The extent to store FEC.
+     * 
+ * + * optional .chromeos_update_engine.Extent fec_extent = 15; + */ + @java.lang.Override + public chromeos_update_engine.UpdateMetadata.ExtentOrBuilder getFecExtentOrBuilder() { + return fecExtent_ == null ? chromeos_update_engine.UpdateMetadata.Extent.getDefaultInstance() : fecExtent_; + } + + public static final int FEC_ROOTS_FIELD_NUMBER = 16; + private int fecRoots_; + /** + *
+     * The number of FEC roots.
+     * 
+ * + * optional uint32 fec_roots = 16 [default = 2]; + * @return Whether the fecRoots field is set. + */ + @java.lang.Override + public boolean hasFecRoots() { + return ((bitField0_ & 0x00002000) != 0); + } + /** + *
+     * The number of FEC roots.
+     * 
+ * + * optional uint32 fec_roots = 16 [default = 2]; + * @return The fecRoots. + */ + @java.lang.Override + public int getFecRoots() { + return fecRoots_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + if (!hasPartitionName()) { + memoizedIsInitialized = 0; + return false; + } + for (int i = 0; i < getOperationsCount(); i++) { + if (!getOperations(i).isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, partitionName_); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeBool(2, runPostinstall_); + } + if (((bitField0_ & 0x00000004) != 0)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, postinstallPath_); + } + if (((bitField0_ & 0x00000008) != 0)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, filesystemType_); + } + for (int i = 0; i < newPartitionSignature_.size(); i++) { + output.writeMessage(5, newPartitionSignature_.get(i)); + } + if (((bitField0_ & 0x00000010) != 0)) { + output.writeMessage(6, getOldPartitionInfo()); + } + if (((bitField0_ & 0x00000020) != 0)) { + output.writeMessage(7, getNewPartitionInfo()); + } + for (int i = 0; i < operations_.size(); i++) { + output.writeMessage(8, operations_.get(i)); + } + if (((bitField0_ & 0x00000040) != 0)) { + output.writeBool(9, postinstallOptional_); + } + if (((bitField0_ & 0x00000080) != 0)) { + output.writeMessage(10, getHashTreeDataExtent()); + } + if (((bitField0_ & 0x00000100) != 0)) { + output.writeMessage(11, getHashTreeExtent()); + } + if (((bitField0_ & 0x00000200) != 0)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 12, hashTreeAlgorithm_); + } + if (((bitField0_ & 0x00000400) != 0)) { + output.writeBytes(13, hashTreeSalt_); + } + if (((bitField0_ & 0x00000800) != 0)) { + output.writeMessage(14, getFecDataExtent()); + } + if (((bitField0_ & 0x00001000) != 0)) { + output.writeMessage(15, getFecExtent()); + } + if (((bitField0_ & 0x00002000) != 0)) { + output.writeUInt32(16, fecRoots_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, partitionName_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(2, runPostinstall_); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, postinstallPath_); + } + if (((bitField0_ & 0x00000008) != 0)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, filesystemType_); + } + for (int i = 0; i < newPartitionSignature_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(5, newPartitionSignature_.get(i)); + } + if (((bitField0_ & 0x00000010) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(6, getOldPartitionInfo()); + } + if (((bitField0_ & 0x00000020) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(7, getNewPartitionInfo()); + } + for (int i = 0; i < operations_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(8, operations_.get(i)); + } + if (((bitField0_ & 0x00000040) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(9, postinstallOptional_); + } + if (((bitField0_ & 0x00000080) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(10, getHashTreeDataExtent()); + } + if (((bitField0_ & 0x00000100) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(11, getHashTreeExtent()); + } + if (((bitField0_ & 0x00000200) != 0)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(12, hashTreeAlgorithm_); + } + if (((bitField0_ & 0x00000400) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(13, hashTreeSalt_); + } + if (((bitField0_ & 0x00000800) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(14, getFecDataExtent()); + } + if (((bitField0_ & 0x00001000) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(15, getFecExtent()); + } + if (((bitField0_ & 0x00002000) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(16, fecRoots_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof chromeos_update_engine.UpdateMetadata.PartitionUpdate)) { + return super.equals(obj); + } + chromeos_update_engine.UpdateMetadata.PartitionUpdate other = (chromeos_update_engine.UpdateMetadata.PartitionUpdate) obj; + + if (hasPartitionName() != other.hasPartitionName()) return false; + if (hasPartitionName()) { + if (!getPartitionName() + .equals(other.getPartitionName())) return false; + } + if (hasRunPostinstall() != other.hasRunPostinstall()) return false; + if (hasRunPostinstall()) { + if (getRunPostinstall() + != other.getRunPostinstall()) return false; + } + if (hasPostinstallPath() != other.hasPostinstallPath()) return false; + if (hasPostinstallPath()) { + if (!getPostinstallPath() + .equals(other.getPostinstallPath())) return false; + } + if (hasFilesystemType() != other.hasFilesystemType()) return false; + if (hasFilesystemType()) { + if (!getFilesystemType() + .equals(other.getFilesystemType())) return false; + } + if (!getNewPartitionSignatureList() + .equals(other.getNewPartitionSignatureList())) return false; + if (hasOldPartitionInfo() != other.hasOldPartitionInfo()) return false; + if (hasOldPartitionInfo()) { + if (!getOldPartitionInfo() + .equals(other.getOldPartitionInfo())) return false; + } + if (hasNewPartitionInfo() != other.hasNewPartitionInfo()) return false; + if (hasNewPartitionInfo()) { + if (!getNewPartitionInfo() + .equals(other.getNewPartitionInfo())) return false; + } + if (!getOperationsList() + .equals(other.getOperationsList())) return false; + if (hasPostinstallOptional() != other.hasPostinstallOptional()) return false; + if (hasPostinstallOptional()) { + if (getPostinstallOptional() + != other.getPostinstallOptional()) return false; + } + if (hasHashTreeDataExtent() != other.hasHashTreeDataExtent()) return false; + if (hasHashTreeDataExtent()) { + if (!getHashTreeDataExtent() + .equals(other.getHashTreeDataExtent())) return false; + } + if (hasHashTreeExtent() != other.hasHashTreeExtent()) return false; + if (hasHashTreeExtent()) { + if (!getHashTreeExtent() + .equals(other.getHashTreeExtent())) return false; + } + if (hasHashTreeAlgorithm() != other.hasHashTreeAlgorithm()) return false; + if (hasHashTreeAlgorithm()) { + if (!getHashTreeAlgorithm() + .equals(other.getHashTreeAlgorithm())) return false; + } + if (hasHashTreeSalt() != other.hasHashTreeSalt()) return false; + if (hasHashTreeSalt()) { + if (!getHashTreeSalt() + .equals(other.getHashTreeSalt())) return false; + } + if (hasFecDataExtent() != other.hasFecDataExtent()) return false; + if (hasFecDataExtent()) { + if (!getFecDataExtent() + .equals(other.getFecDataExtent())) return false; + } + if (hasFecExtent() != other.hasFecExtent()) return false; + if (hasFecExtent()) { + if (!getFecExtent() + .equals(other.getFecExtent())) return false; + } + if (hasFecRoots() != other.hasFecRoots()) return false; + if (hasFecRoots()) { + if (getFecRoots() + != other.getFecRoots()) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasPartitionName()) { + hash = (37 * hash) + PARTITION_NAME_FIELD_NUMBER; + hash = (53 * hash) + getPartitionName().hashCode(); + } + if (hasRunPostinstall()) { + hash = (37 * hash) + RUN_POSTINSTALL_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getRunPostinstall()); + } + if (hasPostinstallPath()) { + hash = (37 * hash) + POSTINSTALL_PATH_FIELD_NUMBER; + hash = (53 * hash) + getPostinstallPath().hashCode(); + } + if (hasFilesystemType()) { + hash = (37 * hash) + FILESYSTEM_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getFilesystemType().hashCode(); + } + if (getNewPartitionSignatureCount() > 0) { + hash = (37 * hash) + NEW_PARTITION_SIGNATURE_FIELD_NUMBER; + hash = (53 * hash) + getNewPartitionSignatureList().hashCode(); + } + if (hasOldPartitionInfo()) { + hash = (37 * hash) + OLD_PARTITION_INFO_FIELD_NUMBER; + hash = (53 * hash) + getOldPartitionInfo().hashCode(); + } + if (hasNewPartitionInfo()) { + hash = (37 * hash) + NEW_PARTITION_INFO_FIELD_NUMBER; + hash = (53 * hash) + getNewPartitionInfo().hashCode(); + } + if (getOperationsCount() > 0) { + hash = (37 * hash) + OPERATIONS_FIELD_NUMBER; + hash = (53 * hash) + getOperationsList().hashCode(); + } + if (hasPostinstallOptional()) { + hash = (37 * hash) + POSTINSTALL_OPTIONAL_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getPostinstallOptional()); + } + if (hasHashTreeDataExtent()) { + hash = (37 * hash) + HASH_TREE_DATA_EXTENT_FIELD_NUMBER; + hash = (53 * hash) + getHashTreeDataExtent().hashCode(); + } + if (hasHashTreeExtent()) { + hash = (37 * hash) + HASH_TREE_EXTENT_FIELD_NUMBER; + hash = (53 * hash) + getHashTreeExtent().hashCode(); + } + if (hasHashTreeAlgorithm()) { + hash = (37 * hash) + HASH_TREE_ALGORITHM_FIELD_NUMBER; + hash = (53 * hash) + getHashTreeAlgorithm().hashCode(); + } + if (hasHashTreeSalt()) { + hash = (37 * hash) + HASH_TREE_SALT_FIELD_NUMBER; + hash = (53 * hash) + getHashTreeSalt().hashCode(); + } + if (hasFecDataExtent()) { + hash = (37 * hash) + FEC_DATA_EXTENT_FIELD_NUMBER; + hash = (53 * hash) + getFecDataExtent().hashCode(); + } + if (hasFecExtent()) { + hash = (37 * hash) + FEC_EXTENT_FIELD_NUMBER; + hash = (53 * hash) + getFecExtent().hashCode(); + } + if (hasFecRoots()) { + hash = (37 * hash) + FEC_ROOTS_FIELD_NUMBER; + hash = (53 * hash) + getFecRoots(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static chromeos_update_engine.UpdateMetadata.PartitionUpdate parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static chromeos_update_engine.UpdateMetadata.PartitionUpdate parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static chromeos_update_engine.UpdateMetadata.PartitionUpdate parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static chromeos_update_engine.UpdateMetadata.PartitionUpdate parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static chromeos_update_engine.UpdateMetadata.PartitionUpdate parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static chromeos_update_engine.UpdateMetadata.PartitionUpdate parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static chromeos_update_engine.UpdateMetadata.PartitionUpdate parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static chromeos_update_engine.UpdateMetadata.PartitionUpdate parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static chromeos_update_engine.UpdateMetadata.PartitionUpdate parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static chromeos_update_engine.UpdateMetadata.PartitionUpdate parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static chromeos_update_engine.UpdateMetadata.PartitionUpdate parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static chromeos_update_engine.UpdateMetadata.PartitionUpdate parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(chromeos_update_engine.UpdateMetadata.PartitionUpdate prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+     * Describes the update to apply to a single partition.
+     * 
+ * + * Protobuf type {@code chromeos_update_engine.PartitionUpdate} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:chromeos_update_engine.PartitionUpdate) + chromeos_update_engine.UpdateMetadata.PartitionUpdateOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return chromeos_update_engine.UpdateMetadata.internal_static_chromeos_update_engine_PartitionUpdate_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return chromeos_update_engine.UpdateMetadata.internal_static_chromeos_update_engine_PartitionUpdate_fieldAccessorTable + .ensureFieldAccessorsInitialized( + chromeos_update_engine.UpdateMetadata.PartitionUpdate.class, chromeos_update_engine.UpdateMetadata.PartitionUpdate.Builder.class); + } + + // Construct using chromeos_update_engine.UpdateMetadata.PartitionUpdate.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getNewPartitionSignatureFieldBuilder(); + getOldPartitionInfoFieldBuilder(); + getNewPartitionInfoFieldBuilder(); + getOperationsFieldBuilder(); + getHashTreeDataExtentFieldBuilder(); + getHashTreeExtentFieldBuilder(); + getFecDataExtentFieldBuilder(); + getFecExtentFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + partitionName_ = ""; + bitField0_ = (bitField0_ & ~0x00000001); + runPostinstall_ = false; + bitField0_ = (bitField0_ & ~0x00000002); + postinstallPath_ = ""; + bitField0_ = (bitField0_ & ~0x00000004); + filesystemType_ = ""; + bitField0_ = (bitField0_ & ~0x00000008); + if (newPartitionSignatureBuilder_ == null) { + newPartitionSignature_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000010); + } else { + newPartitionSignatureBuilder_.clear(); + } + if (oldPartitionInfoBuilder_ == null) { + oldPartitionInfo_ = null; + } else { + oldPartitionInfoBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000020); + if (newPartitionInfoBuilder_ == null) { + newPartitionInfo_ = null; + } else { + newPartitionInfoBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000040); + if (operationsBuilder_ == null) { + operations_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000080); + } else { + operationsBuilder_.clear(); + } + postinstallOptional_ = false; + bitField0_ = (bitField0_ & ~0x00000100); + if (hashTreeDataExtentBuilder_ == null) { + hashTreeDataExtent_ = null; + } else { + hashTreeDataExtentBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000200); + if (hashTreeExtentBuilder_ == null) { + hashTreeExtent_ = null; + } else { + hashTreeExtentBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000400); + hashTreeAlgorithm_ = ""; + bitField0_ = (bitField0_ & ~0x00000800); + hashTreeSalt_ = com.google.protobuf.ByteString.EMPTY; + bitField0_ = (bitField0_ & ~0x00001000); + if (fecDataExtentBuilder_ == null) { + fecDataExtent_ = null; + } else { + fecDataExtentBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00002000); + if (fecExtentBuilder_ == null) { + fecExtent_ = null; + } else { + fecExtentBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00004000); + fecRoots_ = 2; + bitField0_ = (bitField0_ & ~0x00008000); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return chromeos_update_engine.UpdateMetadata.internal_static_chromeos_update_engine_PartitionUpdate_descriptor; + } + + @java.lang.Override + public chromeos_update_engine.UpdateMetadata.PartitionUpdate getDefaultInstanceForType() { + return chromeos_update_engine.UpdateMetadata.PartitionUpdate.getDefaultInstance(); + } + + @java.lang.Override + public chromeos_update_engine.UpdateMetadata.PartitionUpdate build() { + chromeos_update_engine.UpdateMetadata.PartitionUpdate result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public chromeos_update_engine.UpdateMetadata.PartitionUpdate buildPartial() { + chromeos_update_engine.UpdateMetadata.PartitionUpdate result = new chromeos_update_engine.UpdateMetadata.PartitionUpdate(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + to_bitField0_ |= 0x00000001; + } + result.partitionName_ = partitionName_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.runPostinstall_ = runPostinstall_; + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + to_bitField0_ |= 0x00000004; + } + result.postinstallPath_ = postinstallPath_; + if (((from_bitField0_ & 0x00000008) != 0)) { + to_bitField0_ |= 0x00000008; + } + result.filesystemType_ = filesystemType_; + if (newPartitionSignatureBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0)) { + newPartitionSignature_ = java.util.Collections.unmodifiableList(newPartitionSignature_); + bitField0_ = (bitField0_ & ~0x00000010); + } + result.newPartitionSignature_ = newPartitionSignature_; + } else { + result.newPartitionSignature_ = newPartitionSignatureBuilder_.build(); + } + if (((from_bitField0_ & 0x00000020) != 0)) { + if (oldPartitionInfoBuilder_ == null) { + result.oldPartitionInfo_ = oldPartitionInfo_; + } else { + result.oldPartitionInfo_ = oldPartitionInfoBuilder_.build(); + } + to_bitField0_ |= 0x00000010; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + if (newPartitionInfoBuilder_ == null) { + result.newPartitionInfo_ = newPartitionInfo_; + } else { + result.newPartitionInfo_ = newPartitionInfoBuilder_.build(); + } + to_bitField0_ |= 0x00000020; + } + if (operationsBuilder_ == null) { + if (((bitField0_ & 0x00000080) != 0)) { + operations_ = java.util.Collections.unmodifiableList(operations_); + bitField0_ = (bitField0_ & ~0x00000080); + } + result.operations_ = operations_; + } else { + result.operations_ = operationsBuilder_.build(); + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.postinstallOptional_ = postinstallOptional_; + to_bitField0_ |= 0x00000040; + } + if (((from_bitField0_ & 0x00000200) != 0)) { + if (hashTreeDataExtentBuilder_ == null) { + result.hashTreeDataExtent_ = hashTreeDataExtent_; + } else { + result.hashTreeDataExtent_ = hashTreeDataExtentBuilder_.build(); + } + to_bitField0_ |= 0x00000080; + } + if (((from_bitField0_ & 0x00000400) != 0)) { + if (hashTreeExtentBuilder_ == null) { + result.hashTreeExtent_ = hashTreeExtent_; + } else { + result.hashTreeExtent_ = hashTreeExtentBuilder_.build(); + } + to_bitField0_ |= 0x00000100; + } + if (((from_bitField0_ & 0x00000800) != 0)) { + to_bitField0_ |= 0x00000200; + } + result.hashTreeAlgorithm_ = hashTreeAlgorithm_; + if (((from_bitField0_ & 0x00001000) != 0)) { + to_bitField0_ |= 0x00000400; + } + result.hashTreeSalt_ = hashTreeSalt_; + if (((from_bitField0_ & 0x00002000) != 0)) { + if (fecDataExtentBuilder_ == null) { + result.fecDataExtent_ = fecDataExtent_; + } else { + result.fecDataExtent_ = fecDataExtentBuilder_.build(); + } + to_bitField0_ |= 0x00000800; + } + if (((from_bitField0_ & 0x00004000) != 0)) { + if (fecExtentBuilder_ == null) { + result.fecExtent_ = fecExtent_; + } else { + result.fecExtent_ = fecExtentBuilder_.build(); + } + to_bitField0_ |= 0x00001000; + } + if (((from_bitField0_ & 0x00008000) != 0)) { + to_bitField0_ |= 0x00002000; + } + result.fecRoots_ = fecRoots_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof chromeos_update_engine.UpdateMetadata.PartitionUpdate) { + return mergeFrom((chromeos_update_engine.UpdateMetadata.PartitionUpdate)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(chromeos_update_engine.UpdateMetadata.PartitionUpdate other) { + if (other == chromeos_update_engine.UpdateMetadata.PartitionUpdate.getDefaultInstance()) return this; + if (other.hasPartitionName()) { + bitField0_ |= 0x00000001; + partitionName_ = other.partitionName_; + onChanged(); + } + if (other.hasRunPostinstall()) { + setRunPostinstall(other.getRunPostinstall()); + } + if (other.hasPostinstallPath()) { + bitField0_ |= 0x00000004; + postinstallPath_ = other.postinstallPath_; + onChanged(); + } + if (other.hasFilesystemType()) { + bitField0_ |= 0x00000008; + filesystemType_ = other.filesystemType_; + onChanged(); + } + if (newPartitionSignatureBuilder_ == null) { + if (!other.newPartitionSignature_.isEmpty()) { + if (newPartitionSignature_.isEmpty()) { + newPartitionSignature_ = other.newPartitionSignature_; + bitField0_ = (bitField0_ & ~0x00000010); + } else { + ensureNewPartitionSignatureIsMutable(); + newPartitionSignature_.addAll(other.newPartitionSignature_); + } + onChanged(); + } + } else { + if (!other.newPartitionSignature_.isEmpty()) { + if (newPartitionSignatureBuilder_.isEmpty()) { + newPartitionSignatureBuilder_.dispose(); + newPartitionSignatureBuilder_ = null; + newPartitionSignature_ = other.newPartitionSignature_; + bitField0_ = (bitField0_ & ~0x00000010); + newPartitionSignatureBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getNewPartitionSignatureFieldBuilder() : null; + } else { + newPartitionSignatureBuilder_.addAllMessages(other.newPartitionSignature_); + } + } + } + if (other.hasOldPartitionInfo()) { + mergeOldPartitionInfo(other.getOldPartitionInfo()); + } + if (other.hasNewPartitionInfo()) { + mergeNewPartitionInfo(other.getNewPartitionInfo()); + } + if (operationsBuilder_ == null) { + if (!other.operations_.isEmpty()) { + if (operations_.isEmpty()) { + operations_ = other.operations_; + bitField0_ = (bitField0_ & ~0x00000080); + } else { + ensureOperationsIsMutable(); + operations_.addAll(other.operations_); + } + onChanged(); + } + } else { + if (!other.operations_.isEmpty()) { + if (operationsBuilder_.isEmpty()) { + operationsBuilder_.dispose(); + operationsBuilder_ = null; + operations_ = other.operations_; + bitField0_ = (bitField0_ & ~0x00000080); + operationsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getOperationsFieldBuilder() : null; + } else { + operationsBuilder_.addAllMessages(other.operations_); + } + } + } + if (other.hasPostinstallOptional()) { + setPostinstallOptional(other.getPostinstallOptional()); + } + if (other.hasHashTreeDataExtent()) { + mergeHashTreeDataExtent(other.getHashTreeDataExtent()); + } + if (other.hasHashTreeExtent()) { + mergeHashTreeExtent(other.getHashTreeExtent()); + } + if (other.hasHashTreeAlgorithm()) { + bitField0_ |= 0x00000800; + hashTreeAlgorithm_ = other.hashTreeAlgorithm_; + onChanged(); + } + if (other.hasHashTreeSalt()) { + setHashTreeSalt(other.getHashTreeSalt()); + } + if (other.hasFecDataExtent()) { + mergeFecDataExtent(other.getFecDataExtent()); + } + if (other.hasFecExtent()) { + mergeFecExtent(other.getFecExtent()); + } + if (other.hasFecRoots()) { + setFecRoots(other.getFecRoots()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + if (!hasPartitionName()) { + return false; + } + for (int i = 0; i < getOperationsCount(); i++) { + if (!getOperations(i).isInitialized()) { + return false; + } + } + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + chromeos_update_engine.UpdateMetadata.PartitionUpdate parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (chromeos_update_engine.UpdateMetadata.PartitionUpdate) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.lang.Object partitionName_ = ""; + /** + *
+       * A platform-specific name to identify the partition set being updated. For
+       * example, in Chrome OS this could be "ROOT" or "KERNEL".
+       * 
+ * + * required string partition_name = 1; + * @return Whether the partitionName field is set. + */ + public boolean hasPartitionName() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + *
+       * A platform-specific name to identify the partition set being updated. For
+       * example, in Chrome OS this could be "ROOT" or "KERNEL".
+       * 
+ * + * required string partition_name = 1; + * @return The partitionName. + */ + public java.lang.String getPartitionName() { + java.lang.Object ref = partitionName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + partitionName_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+       * A platform-specific name to identify the partition set being updated. For
+       * example, in Chrome OS this could be "ROOT" or "KERNEL".
+       * 
+ * + * required string partition_name = 1; + * @return The bytes for partitionName. + */ + public com.google.protobuf.ByteString + getPartitionNameBytes() { + java.lang.Object ref = partitionName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + partitionName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       * A platform-specific name to identify the partition set being updated. For
+       * example, in Chrome OS this could be "ROOT" or "KERNEL".
+       * 
+ * + * required string partition_name = 1; + * @param value The partitionName to set. + * @return This builder for chaining. + */ + public Builder setPartitionName( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + partitionName_ = value; + onChanged(); + return this; + } + /** + *
+       * A platform-specific name to identify the partition set being updated. For
+       * example, in Chrome OS this could be "ROOT" or "KERNEL".
+       * 
+ * + * required string partition_name = 1; + * @return This builder for chaining. + */ + public Builder clearPartitionName() { + bitField0_ = (bitField0_ & ~0x00000001); + partitionName_ = getDefaultInstance().getPartitionName(); + onChanged(); + return this; + } + /** + *
+       * A platform-specific name to identify the partition set being updated. For
+       * example, in Chrome OS this could be "ROOT" or "KERNEL".
+       * 
+ * + * required string partition_name = 1; + * @param value The bytes for partitionName to set. + * @return This builder for chaining. + */ + public Builder setPartitionNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + partitionName_ = value; + onChanged(); + return this; + } + + private boolean runPostinstall_ ; + /** + *
+       * Whether this partition carries a filesystem with post-install program that
+       * must be run to finalize the update process. See also |postinstall_path| and
+       * |filesystem_type|.
+       * 
+ * + * optional bool run_postinstall = 2; + * @return Whether the runPostinstall field is set. + */ + @java.lang.Override + public boolean hasRunPostinstall() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + *
+       * Whether this partition carries a filesystem with post-install program that
+       * must be run to finalize the update process. See also |postinstall_path| and
+       * |filesystem_type|.
+       * 
+ * + * optional bool run_postinstall = 2; + * @return The runPostinstall. + */ + @java.lang.Override + public boolean getRunPostinstall() { + return runPostinstall_; + } + /** + *
+       * Whether this partition carries a filesystem with post-install program that
+       * must be run to finalize the update process. See also |postinstall_path| and
+       * |filesystem_type|.
+       * 
+ * + * optional bool run_postinstall = 2; + * @param value The runPostinstall to set. + * @return This builder for chaining. + */ + public Builder setRunPostinstall(boolean value) { + bitField0_ |= 0x00000002; + runPostinstall_ = value; + onChanged(); + return this; + } + /** + *
+       * Whether this partition carries a filesystem with post-install program that
+       * must be run to finalize the update process. See also |postinstall_path| and
+       * |filesystem_type|.
+       * 
+ * + * optional bool run_postinstall = 2; + * @return This builder for chaining. + */ + public Builder clearRunPostinstall() { + bitField0_ = (bitField0_ & ~0x00000002); + runPostinstall_ = false; + onChanged(); + return this; + } + + private java.lang.Object postinstallPath_ = ""; + /** + *
+       * The path of the executable program to run during the post-install step,
+       * relative to the root of this filesystem. If not set, the default "postinst"
+       * will be used. This setting is only used when |run_postinstall| is set and
+       * true.
+       * 
+ * + * optional string postinstall_path = 3; + * @return Whether the postinstallPath field is set. + */ + public boolean hasPostinstallPath() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + *
+       * The path of the executable program to run during the post-install step,
+       * relative to the root of this filesystem. If not set, the default "postinst"
+       * will be used. This setting is only used when |run_postinstall| is set and
+       * true.
+       * 
+ * + * optional string postinstall_path = 3; + * @return The postinstallPath. + */ + public java.lang.String getPostinstallPath() { + java.lang.Object ref = postinstallPath_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + postinstallPath_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+       * The path of the executable program to run during the post-install step,
+       * relative to the root of this filesystem. If not set, the default "postinst"
+       * will be used. This setting is only used when |run_postinstall| is set and
+       * true.
+       * 
+ * + * optional string postinstall_path = 3; + * @return The bytes for postinstallPath. + */ + public com.google.protobuf.ByteString + getPostinstallPathBytes() { + java.lang.Object ref = postinstallPath_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + postinstallPath_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       * The path of the executable program to run during the post-install step,
+       * relative to the root of this filesystem. If not set, the default "postinst"
+       * will be used. This setting is only used when |run_postinstall| is set and
+       * true.
+       * 
+ * + * optional string postinstall_path = 3; + * @param value The postinstallPath to set. + * @return This builder for chaining. + */ + public Builder setPostinstallPath( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000004; + postinstallPath_ = value; + onChanged(); + return this; + } + /** + *
+       * The path of the executable program to run during the post-install step,
+       * relative to the root of this filesystem. If not set, the default "postinst"
+       * will be used. This setting is only used when |run_postinstall| is set and
+       * true.
+       * 
+ * + * optional string postinstall_path = 3; + * @return This builder for chaining. + */ + public Builder clearPostinstallPath() { + bitField0_ = (bitField0_ & ~0x00000004); + postinstallPath_ = getDefaultInstance().getPostinstallPath(); + onChanged(); + return this; + } + /** + *
+       * The path of the executable program to run during the post-install step,
+       * relative to the root of this filesystem. If not set, the default "postinst"
+       * will be used. This setting is only used when |run_postinstall| is set and
+       * true.
+       * 
+ * + * optional string postinstall_path = 3; + * @param value The bytes for postinstallPath to set. + * @return This builder for chaining. + */ + public Builder setPostinstallPathBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000004; + postinstallPath_ = value; + onChanged(); + return this; + } + + private java.lang.Object filesystemType_ = ""; + /** + *
+       * The filesystem type as passed to the mount(2) syscall when mounting the new
+       * filesystem to run the post-install program. If not set, a fixed list of
+       * filesystems will be attempted. This setting is only used if
+       * |run_postinstall| is set and true.
+       * 
+ * + * optional string filesystem_type = 4; + * @return Whether the filesystemType field is set. + */ + public boolean hasFilesystemType() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + *
+       * The filesystem type as passed to the mount(2) syscall when mounting the new
+       * filesystem to run the post-install program. If not set, a fixed list of
+       * filesystems will be attempted. This setting is only used if
+       * |run_postinstall| is set and true.
+       * 
+ * + * optional string filesystem_type = 4; + * @return The filesystemType. + */ + public java.lang.String getFilesystemType() { + java.lang.Object ref = filesystemType_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + filesystemType_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+       * The filesystem type as passed to the mount(2) syscall when mounting the new
+       * filesystem to run the post-install program. If not set, a fixed list of
+       * filesystems will be attempted. This setting is only used if
+       * |run_postinstall| is set and true.
+       * 
+ * + * optional string filesystem_type = 4; + * @return The bytes for filesystemType. + */ + public com.google.protobuf.ByteString + getFilesystemTypeBytes() { + java.lang.Object ref = filesystemType_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + filesystemType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       * The filesystem type as passed to the mount(2) syscall when mounting the new
+       * filesystem to run the post-install program. If not set, a fixed list of
+       * filesystems will be attempted. This setting is only used if
+       * |run_postinstall| is set and true.
+       * 
+ * + * optional string filesystem_type = 4; + * @param value The filesystemType to set. + * @return This builder for chaining. + */ + public Builder setFilesystemType( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000008; + filesystemType_ = value; + onChanged(); + return this; + } + /** + *
+       * The filesystem type as passed to the mount(2) syscall when mounting the new
+       * filesystem to run the post-install program. If not set, a fixed list of
+       * filesystems will be attempted. This setting is only used if
+       * |run_postinstall| is set and true.
+       * 
+ * + * optional string filesystem_type = 4; + * @return This builder for chaining. + */ + public Builder clearFilesystemType() { + bitField0_ = (bitField0_ & ~0x00000008); + filesystemType_ = getDefaultInstance().getFilesystemType(); + onChanged(); + return this; + } + /** + *
+       * The filesystem type as passed to the mount(2) syscall when mounting the new
+       * filesystem to run the post-install program. If not set, a fixed list of
+       * filesystems will be attempted. This setting is only used if
+       * |run_postinstall| is set and true.
+       * 
+ * + * optional string filesystem_type = 4; + * @param value The bytes for filesystemType to set. + * @return This builder for chaining. + */ + public Builder setFilesystemTypeBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000008; + filesystemType_ = value; + onChanged(); + return this; + } + + private java.util.List newPartitionSignature_ = + java.util.Collections.emptyList(); + private void ensureNewPartitionSignatureIsMutable() { + if (!((bitField0_ & 0x00000010) != 0)) { + newPartitionSignature_ = new java.util.ArrayList(newPartitionSignature_); + bitField0_ |= 0x00000010; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + chromeos_update_engine.UpdateMetadata.Signatures.Signature, chromeos_update_engine.UpdateMetadata.Signatures.Signature.Builder, chromeos_update_engine.UpdateMetadata.Signatures.SignatureOrBuilder> newPartitionSignatureBuilder_; + + /** + *
+       * If present, a list of signatures of the new_partition_info.hash signed with
+       * different keys. If the update_engine daemon requires vendor-signed images
+       * and has its public key installed, one of the signatures should be valid
+       * for /postinstall to run.
+       * 
+ * + * repeated .chromeos_update_engine.Signatures.Signature new_partition_signature = 5; + */ + public java.util.List getNewPartitionSignatureList() { + if (newPartitionSignatureBuilder_ == null) { + return java.util.Collections.unmodifiableList(newPartitionSignature_); + } else { + return newPartitionSignatureBuilder_.getMessageList(); + } + } + /** + *
+       * If present, a list of signatures of the new_partition_info.hash signed with
+       * different keys. If the update_engine daemon requires vendor-signed images
+       * and has its public key installed, one of the signatures should be valid
+       * for /postinstall to run.
+       * 
+ * + * repeated .chromeos_update_engine.Signatures.Signature new_partition_signature = 5; + */ + public int getNewPartitionSignatureCount() { + if (newPartitionSignatureBuilder_ == null) { + return newPartitionSignature_.size(); + } else { + return newPartitionSignatureBuilder_.getCount(); + } + } + /** + *
+       * If present, a list of signatures of the new_partition_info.hash signed with
+       * different keys. If the update_engine daemon requires vendor-signed images
+       * and has its public key installed, one of the signatures should be valid
+       * for /postinstall to run.
+       * 
+ * + * repeated .chromeos_update_engine.Signatures.Signature new_partition_signature = 5; + */ + public chromeos_update_engine.UpdateMetadata.Signatures.Signature getNewPartitionSignature(int index) { + if (newPartitionSignatureBuilder_ == null) { + return newPartitionSignature_.get(index); + } else { + return newPartitionSignatureBuilder_.getMessage(index); + } + } + /** + *
+       * If present, a list of signatures of the new_partition_info.hash signed with
+       * different keys. If the update_engine daemon requires vendor-signed images
+       * and has its public key installed, one of the signatures should be valid
+       * for /postinstall to run.
+       * 
+ * + * repeated .chromeos_update_engine.Signatures.Signature new_partition_signature = 5; + */ + public Builder setNewPartitionSignature( + int index, chromeos_update_engine.UpdateMetadata.Signatures.Signature value) { + if (newPartitionSignatureBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNewPartitionSignatureIsMutable(); + newPartitionSignature_.set(index, value); + onChanged(); + } else { + newPartitionSignatureBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+       * If present, a list of signatures of the new_partition_info.hash signed with
+       * different keys. If the update_engine daemon requires vendor-signed images
+       * and has its public key installed, one of the signatures should be valid
+       * for /postinstall to run.
+       * 
+ * + * repeated .chromeos_update_engine.Signatures.Signature new_partition_signature = 5; + */ + public Builder setNewPartitionSignature( + int index, chromeos_update_engine.UpdateMetadata.Signatures.Signature.Builder builderForValue) { + if (newPartitionSignatureBuilder_ == null) { + ensureNewPartitionSignatureIsMutable(); + newPartitionSignature_.set(index, builderForValue.build()); + onChanged(); + } else { + newPartitionSignatureBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+       * If present, a list of signatures of the new_partition_info.hash signed with
+       * different keys. If the update_engine daemon requires vendor-signed images
+       * and has its public key installed, one of the signatures should be valid
+       * for /postinstall to run.
+       * 
+ * + * repeated .chromeos_update_engine.Signatures.Signature new_partition_signature = 5; + */ + public Builder addNewPartitionSignature(chromeos_update_engine.UpdateMetadata.Signatures.Signature value) { + if (newPartitionSignatureBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNewPartitionSignatureIsMutable(); + newPartitionSignature_.add(value); + onChanged(); + } else { + newPartitionSignatureBuilder_.addMessage(value); + } + return this; + } + /** + *
+       * If present, a list of signatures of the new_partition_info.hash signed with
+       * different keys. If the update_engine daemon requires vendor-signed images
+       * and has its public key installed, one of the signatures should be valid
+       * for /postinstall to run.
+       * 
+ * + * repeated .chromeos_update_engine.Signatures.Signature new_partition_signature = 5; + */ + public Builder addNewPartitionSignature( + int index, chromeos_update_engine.UpdateMetadata.Signatures.Signature value) { + if (newPartitionSignatureBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNewPartitionSignatureIsMutable(); + newPartitionSignature_.add(index, value); + onChanged(); + } else { + newPartitionSignatureBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+       * If present, a list of signatures of the new_partition_info.hash signed with
+       * different keys. If the update_engine daemon requires vendor-signed images
+       * and has its public key installed, one of the signatures should be valid
+       * for /postinstall to run.
+       * 
+ * + * repeated .chromeos_update_engine.Signatures.Signature new_partition_signature = 5; + */ + public Builder addNewPartitionSignature( + chromeos_update_engine.UpdateMetadata.Signatures.Signature.Builder builderForValue) { + if (newPartitionSignatureBuilder_ == null) { + ensureNewPartitionSignatureIsMutable(); + newPartitionSignature_.add(builderForValue.build()); + onChanged(); + } else { + newPartitionSignatureBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+       * If present, a list of signatures of the new_partition_info.hash signed with
+       * different keys. If the update_engine daemon requires vendor-signed images
+       * and has its public key installed, one of the signatures should be valid
+       * for /postinstall to run.
+       * 
+ * + * repeated .chromeos_update_engine.Signatures.Signature new_partition_signature = 5; + */ + public Builder addNewPartitionSignature( + int index, chromeos_update_engine.UpdateMetadata.Signatures.Signature.Builder builderForValue) { + if (newPartitionSignatureBuilder_ == null) { + ensureNewPartitionSignatureIsMutable(); + newPartitionSignature_.add(index, builderForValue.build()); + onChanged(); + } else { + newPartitionSignatureBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+       * If present, a list of signatures of the new_partition_info.hash signed with
+       * different keys. If the update_engine daemon requires vendor-signed images
+       * and has its public key installed, one of the signatures should be valid
+       * for /postinstall to run.
+       * 
+ * + * repeated .chromeos_update_engine.Signatures.Signature new_partition_signature = 5; + */ + public Builder addAllNewPartitionSignature( + java.lang.Iterable values) { + if (newPartitionSignatureBuilder_ == null) { + ensureNewPartitionSignatureIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, newPartitionSignature_); + onChanged(); + } else { + newPartitionSignatureBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+       * If present, a list of signatures of the new_partition_info.hash signed with
+       * different keys. If the update_engine daemon requires vendor-signed images
+       * and has its public key installed, one of the signatures should be valid
+       * for /postinstall to run.
+       * 
+ * + * repeated .chromeos_update_engine.Signatures.Signature new_partition_signature = 5; + */ + public Builder clearNewPartitionSignature() { + if (newPartitionSignatureBuilder_ == null) { + newPartitionSignature_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + } else { + newPartitionSignatureBuilder_.clear(); + } + return this; + } + /** + *
+       * If present, a list of signatures of the new_partition_info.hash signed with
+       * different keys. If the update_engine daemon requires vendor-signed images
+       * and has its public key installed, one of the signatures should be valid
+       * for /postinstall to run.
+       * 
+ * + * repeated .chromeos_update_engine.Signatures.Signature new_partition_signature = 5; + */ + public Builder removeNewPartitionSignature(int index) { + if (newPartitionSignatureBuilder_ == null) { + ensureNewPartitionSignatureIsMutable(); + newPartitionSignature_.remove(index); + onChanged(); + } else { + newPartitionSignatureBuilder_.remove(index); + } + return this; + } + /** + *
+       * If present, a list of signatures of the new_partition_info.hash signed with
+       * different keys. If the update_engine daemon requires vendor-signed images
+       * and has its public key installed, one of the signatures should be valid
+       * for /postinstall to run.
+       * 
+ * + * repeated .chromeos_update_engine.Signatures.Signature new_partition_signature = 5; + */ + public chromeos_update_engine.UpdateMetadata.Signatures.Signature.Builder getNewPartitionSignatureBuilder( + int index) { + return getNewPartitionSignatureFieldBuilder().getBuilder(index); + } + /** + *
+       * If present, a list of signatures of the new_partition_info.hash signed with
+       * different keys. If the update_engine daemon requires vendor-signed images
+       * and has its public key installed, one of the signatures should be valid
+       * for /postinstall to run.
+       * 
+ * + * repeated .chromeos_update_engine.Signatures.Signature new_partition_signature = 5; + */ + public chromeos_update_engine.UpdateMetadata.Signatures.SignatureOrBuilder getNewPartitionSignatureOrBuilder( + int index) { + if (newPartitionSignatureBuilder_ == null) { + return newPartitionSignature_.get(index); } else { + return newPartitionSignatureBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+       * If present, a list of signatures of the new_partition_info.hash signed with
+       * different keys. If the update_engine daemon requires vendor-signed images
+       * and has its public key installed, one of the signatures should be valid
+       * for /postinstall to run.
+       * 
+ * + * repeated .chromeos_update_engine.Signatures.Signature new_partition_signature = 5; + */ + public java.util.List + getNewPartitionSignatureOrBuilderList() { + if (newPartitionSignatureBuilder_ != null) { + return newPartitionSignatureBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(newPartitionSignature_); + } + } + /** + *
+       * If present, a list of signatures of the new_partition_info.hash signed with
+       * different keys. If the update_engine daemon requires vendor-signed images
+       * and has its public key installed, one of the signatures should be valid
+       * for /postinstall to run.
+       * 
+ * + * repeated .chromeos_update_engine.Signatures.Signature new_partition_signature = 5; + */ + public chromeos_update_engine.UpdateMetadata.Signatures.Signature.Builder addNewPartitionSignatureBuilder() { + return getNewPartitionSignatureFieldBuilder().addBuilder( + chromeos_update_engine.UpdateMetadata.Signatures.Signature.getDefaultInstance()); + } + /** + *
+       * If present, a list of signatures of the new_partition_info.hash signed with
+       * different keys. If the update_engine daemon requires vendor-signed images
+       * and has its public key installed, one of the signatures should be valid
+       * for /postinstall to run.
+       * 
+ * + * repeated .chromeos_update_engine.Signatures.Signature new_partition_signature = 5; + */ + public chromeos_update_engine.UpdateMetadata.Signatures.Signature.Builder addNewPartitionSignatureBuilder( + int index) { + return getNewPartitionSignatureFieldBuilder().addBuilder( + index, chromeos_update_engine.UpdateMetadata.Signatures.Signature.getDefaultInstance()); + } + /** + *
+       * If present, a list of signatures of the new_partition_info.hash signed with
+       * different keys. If the update_engine daemon requires vendor-signed images
+       * and has its public key installed, one of the signatures should be valid
+       * for /postinstall to run.
+       * 
+ * + * repeated .chromeos_update_engine.Signatures.Signature new_partition_signature = 5; + */ + public java.util.List + getNewPartitionSignatureBuilderList() { + return getNewPartitionSignatureFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + chromeos_update_engine.UpdateMetadata.Signatures.Signature, chromeos_update_engine.UpdateMetadata.Signatures.Signature.Builder, chromeos_update_engine.UpdateMetadata.Signatures.SignatureOrBuilder> + getNewPartitionSignatureFieldBuilder() { + if (newPartitionSignatureBuilder_ == null) { + newPartitionSignatureBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + chromeos_update_engine.UpdateMetadata.Signatures.Signature, chromeos_update_engine.UpdateMetadata.Signatures.Signature.Builder, chromeos_update_engine.UpdateMetadata.Signatures.SignatureOrBuilder>( + newPartitionSignature_, + ((bitField0_ & 0x00000010) != 0), + getParentForChildren(), + isClean()); + newPartitionSignature_ = null; + } + return newPartitionSignatureBuilder_; + } + + private chromeos_update_engine.UpdateMetadata.PartitionInfo oldPartitionInfo_; + private com.google.protobuf.SingleFieldBuilderV3< + chromeos_update_engine.UpdateMetadata.PartitionInfo, chromeos_update_engine.UpdateMetadata.PartitionInfo.Builder, chromeos_update_engine.UpdateMetadata.PartitionInfoOrBuilder> oldPartitionInfoBuilder_; + /** + * optional .chromeos_update_engine.PartitionInfo old_partition_info = 6; + * @return Whether the oldPartitionInfo field is set. + */ + public boolean hasOldPartitionInfo() { + return ((bitField0_ & 0x00000020) != 0); + } + /** + * optional .chromeos_update_engine.PartitionInfo old_partition_info = 6; + * @return The oldPartitionInfo. + */ + public chromeos_update_engine.UpdateMetadata.PartitionInfo getOldPartitionInfo() { + if (oldPartitionInfoBuilder_ == null) { + return oldPartitionInfo_ == null ? chromeos_update_engine.UpdateMetadata.PartitionInfo.getDefaultInstance() : oldPartitionInfo_; + } else { + return oldPartitionInfoBuilder_.getMessage(); + } + } + /** + * optional .chromeos_update_engine.PartitionInfo old_partition_info = 6; + */ + public Builder setOldPartitionInfo(chromeos_update_engine.UpdateMetadata.PartitionInfo value) { + if (oldPartitionInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + oldPartitionInfo_ = value; + onChanged(); + } else { + oldPartitionInfoBuilder_.setMessage(value); + } + bitField0_ |= 0x00000020; + return this; + } + /** + * optional .chromeos_update_engine.PartitionInfo old_partition_info = 6; + */ + public Builder setOldPartitionInfo( + chromeos_update_engine.UpdateMetadata.PartitionInfo.Builder builderForValue) { + if (oldPartitionInfoBuilder_ == null) { + oldPartitionInfo_ = builderForValue.build(); + onChanged(); + } else { + oldPartitionInfoBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000020; + return this; + } + /** + * optional .chromeos_update_engine.PartitionInfo old_partition_info = 6; + */ + public Builder mergeOldPartitionInfo(chromeos_update_engine.UpdateMetadata.PartitionInfo value) { + if (oldPartitionInfoBuilder_ == null) { + if (((bitField0_ & 0x00000020) != 0) && + oldPartitionInfo_ != null && + oldPartitionInfo_ != chromeos_update_engine.UpdateMetadata.PartitionInfo.getDefaultInstance()) { + oldPartitionInfo_ = + chromeos_update_engine.UpdateMetadata.PartitionInfo.newBuilder(oldPartitionInfo_).mergeFrom(value).buildPartial(); + } else { + oldPartitionInfo_ = value; + } + onChanged(); + } else { + oldPartitionInfoBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000020; + return this; + } + /** + * optional .chromeos_update_engine.PartitionInfo old_partition_info = 6; + */ + public Builder clearOldPartitionInfo() { + if (oldPartitionInfoBuilder_ == null) { + oldPartitionInfo_ = null; + onChanged(); + } else { + oldPartitionInfoBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000020); + return this; + } + /** + * optional .chromeos_update_engine.PartitionInfo old_partition_info = 6; + */ + public chromeos_update_engine.UpdateMetadata.PartitionInfo.Builder getOldPartitionInfoBuilder() { + bitField0_ |= 0x00000020; + onChanged(); + return getOldPartitionInfoFieldBuilder().getBuilder(); + } + /** + * optional .chromeos_update_engine.PartitionInfo old_partition_info = 6; + */ + public chromeos_update_engine.UpdateMetadata.PartitionInfoOrBuilder getOldPartitionInfoOrBuilder() { + if (oldPartitionInfoBuilder_ != null) { + return oldPartitionInfoBuilder_.getMessageOrBuilder(); + } else { + return oldPartitionInfo_ == null ? + chromeos_update_engine.UpdateMetadata.PartitionInfo.getDefaultInstance() : oldPartitionInfo_; + } + } + /** + * optional .chromeos_update_engine.PartitionInfo old_partition_info = 6; + */ + private com.google.protobuf.SingleFieldBuilderV3< + chromeos_update_engine.UpdateMetadata.PartitionInfo, chromeos_update_engine.UpdateMetadata.PartitionInfo.Builder, chromeos_update_engine.UpdateMetadata.PartitionInfoOrBuilder> + getOldPartitionInfoFieldBuilder() { + if (oldPartitionInfoBuilder_ == null) { + oldPartitionInfoBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + chromeos_update_engine.UpdateMetadata.PartitionInfo, chromeos_update_engine.UpdateMetadata.PartitionInfo.Builder, chromeos_update_engine.UpdateMetadata.PartitionInfoOrBuilder>( + getOldPartitionInfo(), + getParentForChildren(), + isClean()); + oldPartitionInfo_ = null; + } + return oldPartitionInfoBuilder_; + } + + private chromeos_update_engine.UpdateMetadata.PartitionInfo newPartitionInfo_; + private com.google.protobuf.SingleFieldBuilderV3< + chromeos_update_engine.UpdateMetadata.PartitionInfo, chromeos_update_engine.UpdateMetadata.PartitionInfo.Builder, chromeos_update_engine.UpdateMetadata.PartitionInfoOrBuilder> newPartitionInfoBuilder_; + /** + * optional .chromeos_update_engine.PartitionInfo new_partition_info = 7; + * @return Whether the newPartitionInfo field is set. + */ + public boolean hasNewPartitionInfo() { + return ((bitField0_ & 0x00000040) != 0); + } + /** + * optional .chromeos_update_engine.PartitionInfo new_partition_info = 7; + * @return The newPartitionInfo. + */ + public chromeos_update_engine.UpdateMetadata.PartitionInfo getNewPartitionInfo() { + if (newPartitionInfoBuilder_ == null) { + return newPartitionInfo_ == null ? chromeos_update_engine.UpdateMetadata.PartitionInfo.getDefaultInstance() : newPartitionInfo_; + } else { + return newPartitionInfoBuilder_.getMessage(); + } + } + /** + * optional .chromeos_update_engine.PartitionInfo new_partition_info = 7; + */ + public Builder setNewPartitionInfo(chromeos_update_engine.UpdateMetadata.PartitionInfo value) { + if (newPartitionInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + newPartitionInfo_ = value; + onChanged(); + } else { + newPartitionInfoBuilder_.setMessage(value); + } + bitField0_ |= 0x00000040; + return this; + } + /** + * optional .chromeos_update_engine.PartitionInfo new_partition_info = 7; + */ + public Builder setNewPartitionInfo( + chromeos_update_engine.UpdateMetadata.PartitionInfo.Builder builderForValue) { + if (newPartitionInfoBuilder_ == null) { + newPartitionInfo_ = builderForValue.build(); + onChanged(); + } else { + newPartitionInfoBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000040; + return this; + } + /** + * optional .chromeos_update_engine.PartitionInfo new_partition_info = 7; + */ + public Builder mergeNewPartitionInfo(chromeos_update_engine.UpdateMetadata.PartitionInfo value) { + if (newPartitionInfoBuilder_ == null) { + if (((bitField0_ & 0x00000040) != 0) && + newPartitionInfo_ != null && + newPartitionInfo_ != chromeos_update_engine.UpdateMetadata.PartitionInfo.getDefaultInstance()) { + newPartitionInfo_ = + chromeos_update_engine.UpdateMetadata.PartitionInfo.newBuilder(newPartitionInfo_).mergeFrom(value).buildPartial(); + } else { + newPartitionInfo_ = value; + } + onChanged(); + } else { + newPartitionInfoBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000040; + return this; + } + /** + * optional .chromeos_update_engine.PartitionInfo new_partition_info = 7; + */ + public Builder clearNewPartitionInfo() { + if (newPartitionInfoBuilder_ == null) { + newPartitionInfo_ = null; + onChanged(); + } else { + newPartitionInfoBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000040); + return this; + } + /** + * optional .chromeos_update_engine.PartitionInfo new_partition_info = 7; + */ + public chromeos_update_engine.UpdateMetadata.PartitionInfo.Builder getNewPartitionInfoBuilder() { + bitField0_ |= 0x00000040; + onChanged(); + return getNewPartitionInfoFieldBuilder().getBuilder(); + } + /** + * optional .chromeos_update_engine.PartitionInfo new_partition_info = 7; + */ + public chromeos_update_engine.UpdateMetadata.PartitionInfoOrBuilder getNewPartitionInfoOrBuilder() { + if (newPartitionInfoBuilder_ != null) { + return newPartitionInfoBuilder_.getMessageOrBuilder(); + } else { + return newPartitionInfo_ == null ? + chromeos_update_engine.UpdateMetadata.PartitionInfo.getDefaultInstance() : newPartitionInfo_; + } + } + /** + * optional .chromeos_update_engine.PartitionInfo new_partition_info = 7; + */ + private com.google.protobuf.SingleFieldBuilderV3< + chromeos_update_engine.UpdateMetadata.PartitionInfo, chromeos_update_engine.UpdateMetadata.PartitionInfo.Builder, chromeos_update_engine.UpdateMetadata.PartitionInfoOrBuilder> + getNewPartitionInfoFieldBuilder() { + if (newPartitionInfoBuilder_ == null) { + newPartitionInfoBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + chromeos_update_engine.UpdateMetadata.PartitionInfo, chromeos_update_engine.UpdateMetadata.PartitionInfo.Builder, chromeos_update_engine.UpdateMetadata.PartitionInfoOrBuilder>( + getNewPartitionInfo(), + getParentForChildren(), + isClean()); + newPartitionInfo_ = null; + } + return newPartitionInfoBuilder_; + } + + private java.util.List operations_ = + java.util.Collections.emptyList(); + private void ensureOperationsIsMutable() { + if (!((bitField0_ & 0x00000080) != 0)) { + operations_ = new java.util.ArrayList(operations_); + bitField0_ |= 0x00000080; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + chromeos_update_engine.UpdateMetadata.InstallOperation, chromeos_update_engine.UpdateMetadata.InstallOperation.Builder, chromeos_update_engine.UpdateMetadata.InstallOperationOrBuilder> operationsBuilder_; + + /** + *
+       * The list of operations to be performed to apply this PartitionUpdate. The
+       * associated operation blobs (in operations[i].data_offset, data_length)
+       * should be stored contiguously and in the same order.
+       * 
+ * + * repeated .chromeos_update_engine.InstallOperation operations = 8; + */ + public java.util.List getOperationsList() { + if (operationsBuilder_ == null) { + return java.util.Collections.unmodifiableList(operations_); + } else { + return operationsBuilder_.getMessageList(); + } + } + /** + *
+       * The list of operations to be performed to apply this PartitionUpdate. The
+       * associated operation blobs (in operations[i].data_offset, data_length)
+       * should be stored contiguously and in the same order.
+       * 
+ * + * repeated .chromeos_update_engine.InstallOperation operations = 8; + */ + public int getOperationsCount() { + if (operationsBuilder_ == null) { + return operations_.size(); + } else { + return operationsBuilder_.getCount(); + } + } + /** + *
+       * The list of operations to be performed to apply this PartitionUpdate. The
+       * associated operation blobs (in operations[i].data_offset, data_length)
+       * should be stored contiguously and in the same order.
+       * 
+ * + * repeated .chromeos_update_engine.InstallOperation operations = 8; + */ + public chromeos_update_engine.UpdateMetadata.InstallOperation getOperations(int index) { + if (operationsBuilder_ == null) { + return operations_.get(index); + } else { + return operationsBuilder_.getMessage(index); + } + } + /** + *
+       * The list of operations to be performed to apply this PartitionUpdate. The
+       * associated operation blobs (in operations[i].data_offset, data_length)
+       * should be stored contiguously and in the same order.
+       * 
+ * + * repeated .chromeos_update_engine.InstallOperation operations = 8; + */ + public Builder setOperations( + int index, chromeos_update_engine.UpdateMetadata.InstallOperation value) { + if (operationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureOperationsIsMutable(); + operations_.set(index, value); + onChanged(); + } else { + operationsBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+       * The list of operations to be performed to apply this PartitionUpdate. The
+       * associated operation blobs (in operations[i].data_offset, data_length)
+       * should be stored contiguously and in the same order.
+       * 
+ * + * repeated .chromeos_update_engine.InstallOperation operations = 8; + */ + public Builder setOperations( + int index, chromeos_update_engine.UpdateMetadata.InstallOperation.Builder builderForValue) { + if (operationsBuilder_ == null) { + ensureOperationsIsMutable(); + operations_.set(index, builderForValue.build()); + onChanged(); + } else { + operationsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+       * The list of operations to be performed to apply this PartitionUpdate. The
+       * associated operation blobs (in operations[i].data_offset, data_length)
+       * should be stored contiguously and in the same order.
+       * 
+ * + * repeated .chromeos_update_engine.InstallOperation operations = 8; + */ + public Builder addOperations(chromeos_update_engine.UpdateMetadata.InstallOperation value) { + if (operationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureOperationsIsMutable(); + operations_.add(value); + onChanged(); + } else { + operationsBuilder_.addMessage(value); + } + return this; + } + /** + *
+       * The list of operations to be performed to apply this PartitionUpdate. The
+       * associated operation blobs (in operations[i].data_offset, data_length)
+       * should be stored contiguously and in the same order.
+       * 
+ * + * repeated .chromeos_update_engine.InstallOperation operations = 8; + */ + public Builder addOperations( + int index, chromeos_update_engine.UpdateMetadata.InstallOperation value) { + if (operationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureOperationsIsMutable(); + operations_.add(index, value); + onChanged(); + } else { + operationsBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+       * The list of operations to be performed to apply this PartitionUpdate. The
+       * associated operation blobs (in operations[i].data_offset, data_length)
+       * should be stored contiguously and in the same order.
+       * 
+ * + * repeated .chromeos_update_engine.InstallOperation operations = 8; + */ + public Builder addOperations( + chromeos_update_engine.UpdateMetadata.InstallOperation.Builder builderForValue) { + if (operationsBuilder_ == null) { + ensureOperationsIsMutable(); + operations_.add(builderForValue.build()); + onChanged(); + } else { + operationsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+       * The list of operations to be performed to apply this PartitionUpdate. The
+       * associated operation blobs (in operations[i].data_offset, data_length)
+       * should be stored contiguously and in the same order.
+       * 
+ * + * repeated .chromeos_update_engine.InstallOperation operations = 8; + */ + public Builder addOperations( + int index, chromeos_update_engine.UpdateMetadata.InstallOperation.Builder builderForValue) { + if (operationsBuilder_ == null) { + ensureOperationsIsMutable(); + operations_.add(index, builderForValue.build()); + onChanged(); + } else { + operationsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+       * The list of operations to be performed to apply this PartitionUpdate. The
+       * associated operation blobs (in operations[i].data_offset, data_length)
+       * should be stored contiguously and in the same order.
+       * 
+ * + * repeated .chromeos_update_engine.InstallOperation operations = 8; + */ + public Builder addAllOperations( + java.lang.Iterable values) { + if (operationsBuilder_ == null) { + ensureOperationsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, operations_); + onChanged(); + } else { + operationsBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+       * The list of operations to be performed to apply this PartitionUpdate. The
+       * associated operation blobs (in operations[i].data_offset, data_length)
+       * should be stored contiguously and in the same order.
+       * 
+ * + * repeated .chromeos_update_engine.InstallOperation operations = 8; + */ + public Builder clearOperations() { + if (operationsBuilder_ == null) { + operations_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000080); + onChanged(); + } else { + operationsBuilder_.clear(); + } + return this; + } + /** + *
+       * The list of operations to be performed to apply this PartitionUpdate. The
+       * associated operation blobs (in operations[i].data_offset, data_length)
+       * should be stored contiguously and in the same order.
+       * 
+ * + * repeated .chromeos_update_engine.InstallOperation operations = 8; + */ + public Builder removeOperations(int index) { + if (operationsBuilder_ == null) { + ensureOperationsIsMutable(); + operations_.remove(index); + onChanged(); + } else { + operationsBuilder_.remove(index); + } + return this; + } + /** + *
+       * The list of operations to be performed to apply this PartitionUpdate. The
+       * associated operation blobs (in operations[i].data_offset, data_length)
+       * should be stored contiguously and in the same order.
+       * 
+ * + * repeated .chromeos_update_engine.InstallOperation operations = 8; + */ + public chromeos_update_engine.UpdateMetadata.InstallOperation.Builder getOperationsBuilder( + int index) { + return getOperationsFieldBuilder().getBuilder(index); + } + /** + *
+       * The list of operations to be performed to apply this PartitionUpdate. The
+       * associated operation blobs (in operations[i].data_offset, data_length)
+       * should be stored contiguously and in the same order.
+       * 
+ * + * repeated .chromeos_update_engine.InstallOperation operations = 8; + */ + public chromeos_update_engine.UpdateMetadata.InstallOperationOrBuilder getOperationsOrBuilder( + int index) { + if (operationsBuilder_ == null) { + return operations_.get(index); } else { + return operationsBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+       * The list of operations to be performed to apply this PartitionUpdate. The
+       * associated operation blobs (in operations[i].data_offset, data_length)
+       * should be stored contiguously and in the same order.
+       * 
+ * + * repeated .chromeos_update_engine.InstallOperation operations = 8; + */ + public java.util.List + getOperationsOrBuilderList() { + if (operationsBuilder_ != null) { + return operationsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(operations_); + } + } + /** + *
+       * The list of operations to be performed to apply this PartitionUpdate. The
+       * associated operation blobs (in operations[i].data_offset, data_length)
+       * should be stored contiguously and in the same order.
+       * 
+ * + * repeated .chromeos_update_engine.InstallOperation operations = 8; + */ + public chromeos_update_engine.UpdateMetadata.InstallOperation.Builder addOperationsBuilder() { + return getOperationsFieldBuilder().addBuilder( + chromeos_update_engine.UpdateMetadata.InstallOperation.getDefaultInstance()); + } + /** + *
+       * The list of operations to be performed to apply this PartitionUpdate. The
+       * associated operation blobs (in operations[i].data_offset, data_length)
+       * should be stored contiguously and in the same order.
+       * 
+ * + * repeated .chromeos_update_engine.InstallOperation operations = 8; + */ + public chromeos_update_engine.UpdateMetadata.InstallOperation.Builder addOperationsBuilder( + int index) { + return getOperationsFieldBuilder().addBuilder( + index, chromeos_update_engine.UpdateMetadata.InstallOperation.getDefaultInstance()); + } + /** + *
+       * The list of operations to be performed to apply this PartitionUpdate. The
+       * associated operation blobs (in operations[i].data_offset, data_length)
+       * should be stored contiguously and in the same order.
+       * 
+ * + * repeated .chromeos_update_engine.InstallOperation operations = 8; + */ + public java.util.List + getOperationsBuilderList() { + return getOperationsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + chromeos_update_engine.UpdateMetadata.InstallOperation, chromeos_update_engine.UpdateMetadata.InstallOperation.Builder, chromeos_update_engine.UpdateMetadata.InstallOperationOrBuilder> + getOperationsFieldBuilder() { + if (operationsBuilder_ == null) { + operationsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + chromeos_update_engine.UpdateMetadata.InstallOperation, chromeos_update_engine.UpdateMetadata.InstallOperation.Builder, chromeos_update_engine.UpdateMetadata.InstallOperationOrBuilder>( + operations_, + ((bitField0_ & 0x00000080) != 0), + getParentForChildren(), + isClean()); + operations_ = null; + } + return operationsBuilder_; + } + + private boolean postinstallOptional_ ; + /** + *
+       * Whether a failure in the postinstall step for this partition should be
+       * ignored.
+       * 
+ * + * optional bool postinstall_optional = 9; + * @return Whether the postinstallOptional field is set. + */ + @java.lang.Override + public boolean hasPostinstallOptional() { + return ((bitField0_ & 0x00000100) != 0); + } + /** + *
+       * Whether a failure in the postinstall step for this partition should be
+       * ignored.
+       * 
+ * + * optional bool postinstall_optional = 9; + * @return The postinstallOptional. + */ + @java.lang.Override + public boolean getPostinstallOptional() { + return postinstallOptional_; + } + /** + *
+       * Whether a failure in the postinstall step for this partition should be
+       * ignored.
+       * 
+ * + * optional bool postinstall_optional = 9; + * @param value The postinstallOptional to set. + * @return This builder for chaining. + */ + public Builder setPostinstallOptional(boolean value) { + bitField0_ |= 0x00000100; + postinstallOptional_ = value; + onChanged(); + return this; + } + /** + *
+       * Whether a failure in the postinstall step for this partition should be
+       * ignored.
+       * 
+ * + * optional bool postinstall_optional = 9; + * @return This builder for chaining. + */ + public Builder clearPostinstallOptional() { + bitField0_ = (bitField0_ & ~0x00000100); + postinstallOptional_ = false; + onChanged(); + return this; + } + + private chromeos_update_engine.UpdateMetadata.Extent hashTreeDataExtent_; + private com.google.protobuf.SingleFieldBuilderV3< + chromeos_update_engine.UpdateMetadata.Extent, chromeos_update_engine.UpdateMetadata.Extent.Builder, chromeos_update_engine.UpdateMetadata.ExtentOrBuilder> hashTreeDataExtentBuilder_; + /** + *
+       * The extent for data covered by verity hash tree.
+       * 
+ * + * optional .chromeos_update_engine.Extent hash_tree_data_extent = 10; + * @return Whether the hashTreeDataExtent field is set. + */ + public boolean hasHashTreeDataExtent() { + return ((bitField0_ & 0x00000200) != 0); + } + /** + *
+       * The extent for data covered by verity hash tree.
+       * 
+ * + * optional .chromeos_update_engine.Extent hash_tree_data_extent = 10; + * @return The hashTreeDataExtent. + */ + public chromeos_update_engine.UpdateMetadata.Extent getHashTreeDataExtent() { + if (hashTreeDataExtentBuilder_ == null) { + return hashTreeDataExtent_ == null ? chromeos_update_engine.UpdateMetadata.Extent.getDefaultInstance() : hashTreeDataExtent_; + } else { + return hashTreeDataExtentBuilder_.getMessage(); + } + } + /** + *
+       * The extent for data covered by verity hash tree.
+       * 
+ * + * optional .chromeos_update_engine.Extent hash_tree_data_extent = 10; + */ + public Builder setHashTreeDataExtent(chromeos_update_engine.UpdateMetadata.Extent value) { + if (hashTreeDataExtentBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + hashTreeDataExtent_ = value; + onChanged(); + } else { + hashTreeDataExtentBuilder_.setMessage(value); + } + bitField0_ |= 0x00000200; + return this; + } + /** + *
+       * The extent for data covered by verity hash tree.
+       * 
+ * + * optional .chromeos_update_engine.Extent hash_tree_data_extent = 10; + */ + public Builder setHashTreeDataExtent( + chromeos_update_engine.UpdateMetadata.Extent.Builder builderForValue) { + if (hashTreeDataExtentBuilder_ == null) { + hashTreeDataExtent_ = builderForValue.build(); + onChanged(); + } else { + hashTreeDataExtentBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000200; + return this; + } + /** + *
+       * The extent for data covered by verity hash tree.
+       * 
+ * + * optional .chromeos_update_engine.Extent hash_tree_data_extent = 10; + */ + public Builder mergeHashTreeDataExtent(chromeos_update_engine.UpdateMetadata.Extent value) { + if (hashTreeDataExtentBuilder_ == null) { + if (((bitField0_ & 0x00000200) != 0) && + hashTreeDataExtent_ != null && + hashTreeDataExtent_ != chromeos_update_engine.UpdateMetadata.Extent.getDefaultInstance()) { + hashTreeDataExtent_ = + chromeos_update_engine.UpdateMetadata.Extent.newBuilder(hashTreeDataExtent_).mergeFrom(value).buildPartial(); + } else { + hashTreeDataExtent_ = value; + } + onChanged(); + } else { + hashTreeDataExtentBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000200; + return this; + } + /** + *
+       * The extent for data covered by verity hash tree.
+       * 
+ * + * optional .chromeos_update_engine.Extent hash_tree_data_extent = 10; + */ + public Builder clearHashTreeDataExtent() { + if (hashTreeDataExtentBuilder_ == null) { + hashTreeDataExtent_ = null; + onChanged(); + } else { + hashTreeDataExtentBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000200); + return this; + } + /** + *
+       * The extent for data covered by verity hash tree.
+       * 
+ * + * optional .chromeos_update_engine.Extent hash_tree_data_extent = 10; + */ + public chromeos_update_engine.UpdateMetadata.Extent.Builder getHashTreeDataExtentBuilder() { + bitField0_ |= 0x00000200; + onChanged(); + return getHashTreeDataExtentFieldBuilder().getBuilder(); + } + /** + *
+       * The extent for data covered by verity hash tree.
+       * 
+ * + * optional .chromeos_update_engine.Extent hash_tree_data_extent = 10; + */ + public chromeos_update_engine.UpdateMetadata.ExtentOrBuilder getHashTreeDataExtentOrBuilder() { + if (hashTreeDataExtentBuilder_ != null) { + return hashTreeDataExtentBuilder_.getMessageOrBuilder(); + } else { + return hashTreeDataExtent_ == null ? + chromeos_update_engine.UpdateMetadata.Extent.getDefaultInstance() : hashTreeDataExtent_; + } + } + /** + *
+       * The extent for data covered by verity hash tree.
+       * 
+ * + * optional .chromeos_update_engine.Extent hash_tree_data_extent = 10; + */ + private com.google.protobuf.SingleFieldBuilderV3< + chromeos_update_engine.UpdateMetadata.Extent, chromeos_update_engine.UpdateMetadata.Extent.Builder, chromeos_update_engine.UpdateMetadata.ExtentOrBuilder> + getHashTreeDataExtentFieldBuilder() { + if (hashTreeDataExtentBuilder_ == null) { + hashTreeDataExtentBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + chromeos_update_engine.UpdateMetadata.Extent, chromeos_update_engine.UpdateMetadata.Extent.Builder, chromeos_update_engine.UpdateMetadata.ExtentOrBuilder>( + getHashTreeDataExtent(), + getParentForChildren(), + isClean()); + hashTreeDataExtent_ = null; + } + return hashTreeDataExtentBuilder_; + } + + private chromeos_update_engine.UpdateMetadata.Extent hashTreeExtent_; + private com.google.protobuf.SingleFieldBuilderV3< + chromeos_update_engine.UpdateMetadata.Extent, chromeos_update_engine.UpdateMetadata.Extent.Builder, chromeos_update_engine.UpdateMetadata.ExtentOrBuilder> hashTreeExtentBuilder_; + /** + *
+       * The extent to store verity hash tree.
+       * 
+ * + * optional .chromeos_update_engine.Extent hash_tree_extent = 11; + * @return Whether the hashTreeExtent field is set. + */ + public boolean hasHashTreeExtent() { + return ((bitField0_ & 0x00000400) != 0); + } + /** + *
+       * The extent to store verity hash tree.
+       * 
+ * + * optional .chromeos_update_engine.Extent hash_tree_extent = 11; + * @return The hashTreeExtent. + */ + public chromeos_update_engine.UpdateMetadata.Extent getHashTreeExtent() { + if (hashTreeExtentBuilder_ == null) { + return hashTreeExtent_ == null ? chromeos_update_engine.UpdateMetadata.Extent.getDefaultInstance() : hashTreeExtent_; + } else { + return hashTreeExtentBuilder_.getMessage(); + } + } + /** + *
+       * The extent to store verity hash tree.
+       * 
+ * + * optional .chromeos_update_engine.Extent hash_tree_extent = 11; + */ + public Builder setHashTreeExtent(chromeos_update_engine.UpdateMetadata.Extent value) { + if (hashTreeExtentBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + hashTreeExtent_ = value; + onChanged(); + } else { + hashTreeExtentBuilder_.setMessage(value); + } + bitField0_ |= 0x00000400; + return this; + } + /** + *
+       * The extent to store verity hash tree.
+       * 
+ * + * optional .chromeos_update_engine.Extent hash_tree_extent = 11; + */ + public Builder setHashTreeExtent( + chromeos_update_engine.UpdateMetadata.Extent.Builder builderForValue) { + if (hashTreeExtentBuilder_ == null) { + hashTreeExtent_ = builderForValue.build(); + onChanged(); + } else { + hashTreeExtentBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000400; + return this; + } + /** + *
+       * The extent to store verity hash tree.
+       * 
+ * + * optional .chromeos_update_engine.Extent hash_tree_extent = 11; + */ + public Builder mergeHashTreeExtent(chromeos_update_engine.UpdateMetadata.Extent value) { + if (hashTreeExtentBuilder_ == null) { + if (((bitField0_ & 0x00000400) != 0) && + hashTreeExtent_ != null && + hashTreeExtent_ != chromeos_update_engine.UpdateMetadata.Extent.getDefaultInstance()) { + hashTreeExtent_ = + chromeos_update_engine.UpdateMetadata.Extent.newBuilder(hashTreeExtent_).mergeFrom(value).buildPartial(); + } else { + hashTreeExtent_ = value; + } + onChanged(); + } else { + hashTreeExtentBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000400; + return this; + } + /** + *
+       * The extent to store verity hash tree.
+       * 
+ * + * optional .chromeos_update_engine.Extent hash_tree_extent = 11; + */ + public Builder clearHashTreeExtent() { + if (hashTreeExtentBuilder_ == null) { + hashTreeExtent_ = null; + onChanged(); + } else { + hashTreeExtentBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000400); + return this; + } + /** + *
+       * The extent to store verity hash tree.
+       * 
+ * + * optional .chromeos_update_engine.Extent hash_tree_extent = 11; + */ + public chromeos_update_engine.UpdateMetadata.Extent.Builder getHashTreeExtentBuilder() { + bitField0_ |= 0x00000400; + onChanged(); + return getHashTreeExtentFieldBuilder().getBuilder(); + } + /** + *
+       * The extent to store verity hash tree.
+       * 
+ * + * optional .chromeos_update_engine.Extent hash_tree_extent = 11; + */ + public chromeos_update_engine.UpdateMetadata.ExtentOrBuilder getHashTreeExtentOrBuilder() { + if (hashTreeExtentBuilder_ != null) { + return hashTreeExtentBuilder_.getMessageOrBuilder(); + } else { + return hashTreeExtent_ == null ? + chromeos_update_engine.UpdateMetadata.Extent.getDefaultInstance() : hashTreeExtent_; + } + } + /** + *
+       * The extent to store verity hash tree.
+       * 
+ * + * optional .chromeos_update_engine.Extent hash_tree_extent = 11; + */ + private com.google.protobuf.SingleFieldBuilderV3< + chromeos_update_engine.UpdateMetadata.Extent, chromeos_update_engine.UpdateMetadata.Extent.Builder, chromeos_update_engine.UpdateMetadata.ExtentOrBuilder> + getHashTreeExtentFieldBuilder() { + if (hashTreeExtentBuilder_ == null) { + hashTreeExtentBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + chromeos_update_engine.UpdateMetadata.Extent, chromeos_update_engine.UpdateMetadata.Extent.Builder, chromeos_update_engine.UpdateMetadata.ExtentOrBuilder>( + getHashTreeExtent(), + getParentForChildren(), + isClean()); + hashTreeExtent_ = null; + } + return hashTreeExtentBuilder_; + } + + private java.lang.Object hashTreeAlgorithm_ = ""; + /** + *
+       * The hash algorithm used in verity hash tree.
+       * 
+ * + * optional string hash_tree_algorithm = 12; + * @return Whether the hashTreeAlgorithm field is set. + */ + public boolean hasHashTreeAlgorithm() { + return ((bitField0_ & 0x00000800) != 0); + } + /** + *
+       * The hash algorithm used in verity hash tree.
+       * 
+ * + * optional string hash_tree_algorithm = 12; + * @return The hashTreeAlgorithm. + */ + public java.lang.String getHashTreeAlgorithm() { + java.lang.Object ref = hashTreeAlgorithm_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + hashTreeAlgorithm_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+       * The hash algorithm used in verity hash tree.
+       * 
+ * + * optional string hash_tree_algorithm = 12; + * @return The bytes for hashTreeAlgorithm. + */ + public com.google.protobuf.ByteString + getHashTreeAlgorithmBytes() { + java.lang.Object ref = hashTreeAlgorithm_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + hashTreeAlgorithm_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       * The hash algorithm used in verity hash tree.
+       * 
+ * + * optional string hash_tree_algorithm = 12; + * @param value The hashTreeAlgorithm to set. + * @return This builder for chaining. + */ + public Builder setHashTreeAlgorithm( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000800; + hashTreeAlgorithm_ = value; + onChanged(); + return this; + } + /** + *
+       * The hash algorithm used in verity hash tree.
+       * 
+ * + * optional string hash_tree_algorithm = 12; + * @return This builder for chaining. + */ + public Builder clearHashTreeAlgorithm() { + bitField0_ = (bitField0_ & ~0x00000800); + hashTreeAlgorithm_ = getDefaultInstance().getHashTreeAlgorithm(); + onChanged(); + return this; + } + /** + *
+       * The hash algorithm used in verity hash tree.
+       * 
+ * + * optional string hash_tree_algorithm = 12; + * @param value The bytes for hashTreeAlgorithm to set. + * @return This builder for chaining. + */ + public Builder setHashTreeAlgorithmBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000800; + hashTreeAlgorithm_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.ByteString hashTreeSalt_ = com.google.protobuf.ByteString.EMPTY; + /** + *
+       * The salt used for verity hash tree.
+       * 
+ * + * optional bytes hash_tree_salt = 13; + * @return Whether the hashTreeSalt field is set. + */ + @java.lang.Override + public boolean hasHashTreeSalt() { + return ((bitField0_ & 0x00001000) != 0); + } + /** + *
+       * The salt used for verity hash tree.
+       * 
+ * + * optional bytes hash_tree_salt = 13; + * @return The hashTreeSalt. + */ + @java.lang.Override + public com.google.protobuf.ByteString getHashTreeSalt() { + return hashTreeSalt_; + } + /** + *
+       * The salt used for verity hash tree.
+       * 
+ * + * optional bytes hash_tree_salt = 13; + * @param value The hashTreeSalt to set. + * @return This builder for chaining. + */ + public Builder setHashTreeSalt(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00001000; + hashTreeSalt_ = value; + onChanged(); + return this; + } + /** + *
+       * The salt used for verity hash tree.
+       * 
+ * + * optional bytes hash_tree_salt = 13; + * @return This builder for chaining. + */ + public Builder clearHashTreeSalt() { + bitField0_ = (bitField0_ & ~0x00001000); + hashTreeSalt_ = getDefaultInstance().getHashTreeSalt(); + onChanged(); + return this; + } + + private chromeos_update_engine.UpdateMetadata.Extent fecDataExtent_; + private com.google.protobuf.SingleFieldBuilderV3< + chromeos_update_engine.UpdateMetadata.Extent, chromeos_update_engine.UpdateMetadata.Extent.Builder, chromeos_update_engine.UpdateMetadata.ExtentOrBuilder> fecDataExtentBuilder_; + /** + *
+       * The extent for data covered by FEC.
+       * 
+ * + * optional .chromeos_update_engine.Extent fec_data_extent = 14; + * @return Whether the fecDataExtent field is set. + */ + public boolean hasFecDataExtent() { + return ((bitField0_ & 0x00002000) != 0); + } + /** + *
+       * The extent for data covered by FEC.
+       * 
+ * + * optional .chromeos_update_engine.Extent fec_data_extent = 14; + * @return The fecDataExtent. + */ + public chromeos_update_engine.UpdateMetadata.Extent getFecDataExtent() { + if (fecDataExtentBuilder_ == null) { + return fecDataExtent_ == null ? chromeos_update_engine.UpdateMetadata.Extent.getDefaultInstance() : fecDataExtent_; + } else { + return fecDataExtentBuilder_.getMessage(); + } + } + /** + *
+       * The extent for data covered by FEC.
+       * 
+ * + * optional .chromeos_update_engine.Extent fec_data_extent = 14; + */ + public Builder setFecDataExtent(chromeos_update_engine.UpdateMetadata.Extent value) { + if (fecDataExtentBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + fecDataExtent_ = value; + onChanged(); + } else { + fecDataExtentBuilder_.setMessage(value); + } + bitField0_ |= 0x00002000; + return this; + } + /** + *
+       * The extent for data covered by FEC.
+       * 
+ * + * optional .chromeos_update_engine.Extent fec_data_extent = 14; + */ + public Builder setFecDataExtent( + chromeos_update_engine.UpdateMetadata.Extent.Builder builderForValue) { + if (fecDataExtentBuilder_ == null) { + fecDataExtent_ = builderForValue.build(); + onChanged(); + } else { + fecDataExtentBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00002000; + return this; + } + /** + *
+       * The extent for data covered by FEC.
+       * 
+ * + * optional .chromeos_update_engine.Extent fec_data_extent = 14; + */ + public Builder mergeFecDataExtent(chromeos_update_engine.UpdateMetadata.Extent value) { + if (fecDataExtentBuilder_ == null) { + if (((bitField0_ & 0x00002000) != 0) && + fecDataExtent_ != null && + fecDataExtent_ != chromeos_update_engine.UpdateMetadata.Extent.getDefaultInstance()) { + fecDataExtent_ = + chromeos_update_engine.UpdateMetadata.Extent.newBuilder(fecDataExtent_).mergeFrom(value).buildPartial(); + } else { + fecDataExtent_ = value; + } + onChanged(); + } else { + fecDataExtentBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00002000; + return this; + } + /** + *
+       * The extent for data covered by FEC.
+       * 
+ * + * optional .chromeos_update_engine.Extent fec_data_extent = 14; + */ + public Builder clearFecDataExtent() { + if (fecDataExtentBuilder_ == null) { + fecDataExtent_ = null; + onChanged(); + } else { + fecDataExtentBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00002000); + return this; + } + /** + *
+       * The extent for data covered by FEC.
+       * 
+ * + * optional .chromeos_update_engine.Extent fec_data_extent = 14; + */ + public chromeos_update_engine.UpdateMetadata.Extent.Builder getFecDataExtentBuilder() { + bitField0_ |= 0x00002000; + onChanged(); + return getFecDataExtentFieldBuilder().getBuilder(); + } + /** + *
+       * The extent for data covered by FEC.
+       * 
+ * + * optional .chromeos_update_engine.Extent fec_data_extent = 14; + */ + public chromeos_update_engine.UpdateMetadata.ExtentOrBuilder getFecDataExtentOrBuilder() { + if (fecDataExtentBuilder_ != null) { + return fecDataExtentBuilder_.getMessageOrBuilder(); + } else { + return fecDataExtent_ == null ? + chromeos_update_engine.UpdateMetadata.Extent.getDefaultInstance() : fecDataExtent_; + } + } + /** + *
+       * The extent for data covered by FEC.
+       * 
+ * + * optional .chromeos_update_engine.Extent fec_data_extent = 14; + */ + private com.google.protobuf.SingleFieldBuilderV3< + chromeos_update_engine.UpdateMetadata.Extent, chromeos_update_engine.UpdateMetadata.Extent.Builder, chromeos_update_engine.UpdateMetadata.ExtentOrBuilder> + getFecDataExtentFieldBuilder() { + if (fecDataExtentBuilder_ == null) { + fecDataExtentBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + chromeos_update_engine.UpdateMetadata.Extent, chromeos_update_engine.UpdateMetadata.Extent.Builder, chromeos_update_engine.UpdateMetadata.ExtentOrBuilder>( + getFecDataExtent(), + getParentForChildren(), + isClean()); + fecDataExtent_ = null; + } + return fecDataExtentBuilder_; + } + + private chromeos_update_engine.UpdateMetadata.Extent fecExtent_; + private com.google.protobuf.SingleFieldBuilderV3< + chromeos_update_engine.UpdateMetadata.Extent, chromeos_update_engine.UpdateMetadata.Extent.Builder, chromeos_update_engine.UpdateMetadata.ExtentOrBuilder> fecExtentBuilder_; + /** + *
+       * The extent to store FEC.
+       * 
+ * + * optional .chromeos_update_engine.Extent fec_extent = 15; + * @return Whether the fecExtent field is set. + */ + public boolean hasFecExtent() { + return ((bitField0_ & 0x00004000) != 0); + } + /** + *
+       * The extent to store FEC.
+       * 
+ * + * optional .chromeos_update_engine.Extent fec_extent = 15; + * @return The fecExtent. + */ + public chromeos_update_engine.UpdateMetadata.Extent getFecExtent() { + if (fecExtentBuilder_ == null) { + return fecExtent_ == null ? chromeos_update_engine.UpdateMetadata.Extent.getDefaultInstance() : fecExtent_; + } else { + return fecExtentBuilder_.getMessage(); + } + } + /** + *
+       * The extent to store FEC.
+       * 
+ * + * optional .chromeos_update_engine.Extent fec_extent = 15; + */ + public Builder setFecExtent(chromeos_update_engine.UpdateMetadata.Extent value) { + if (fecExtentBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + fecExtent_ = value; + onChanged(); + } else { + fecExtentBuilder_.setMessage(value); + } + bitField0_ |= 0x00004000; + return this; + } + /** + *
+       * The extent to store FEC.
+       * 
+ * + * optional .chromeos_update_engine.Extent fec_extent = 15; + */ + public Builder setFecExtent( + chromeos_update_engine.UpdateMetadata.Extent.Builder builderForValue) { + if (fecExtentBuilder_ == null) { + fecExtent_ = builderForValue.build(); + onChanged(); + } else { + fecExtentBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00004000; + return this; + } + /** + *
+       * The extent to store FEC.
+       * 
+ * + * optional .chromeos_update_engine.Extent fec_extent = 15; + */ + public Builder mergeFecExtent(chromeos_update_engine.UpdateMetadata.Extent value) { + if (fecExtentBuilder_ == null) { + if (((bitField0_ & 0x00004000) != 0) && + fecExtent_ != null && + fecExtent_ != chromeos_update_engine.UpdateMetadata.Extent.getDefaultInstance()) { + fecExtent_ = + chromeos_update_engine.UpdateMetadata.Extent.newBuilder(fecExtent_).mergeFrom(value).buildPartial(); + } else { + fecExtent_ = value; + } + onChanged(); + } else { + fecExtentBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00004000; + return this; + } + /** + *
+       * The extent to store FEC.
+       * 
+ * + * optional .chromeos_update_engine.Extent fec_extent = 15; + */ + public Builder clearFecExtent() { + if (fecExtentBuilder_ == null) { + fecExtent_ = null; + onChanged(); + } else { + fecExtentBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00004000); + return this; + } + /** + *
+       * The extent to store FEC.
+       * 
+ * + * optional .chromeos_update_engine.Extent fec_extent = 15; + */ + public chromeos_update_engine.UpdateMetadata.Extent.Builder getFecExtentBuilder() { + bitField0_ |= 0x00004000; + onChanged(); + return getFecExtentFieldBuilder().getBuilder(); + } + /** + *
+       * The extent to store FEC.
+       * 
+ * + * optional .chromeos_update_engine.Extent fec_extent = 15; + */ + public chromeos_update_engine.UpdateMetadata.ExtentOrBuilder getFecExtentOrBuilder() { + if (fecExtentBuilder_ != null) { + return fecExtentBuilder_.getMessageOrBuilder(); + } else { + return fecExtent_ == null ? + chromeos_update_engine.UpdateMetadata.Extent.getDefaultInstance() : fecExtent_; + } + } + /** + *
+       * The extent to store FEC.
+       * 
+ * + * optional .chromeos_update_engine.Extent fec_extent = 15; + */ + private com.google.protobuf.SingleFieldBuilderV3< + chromeos_update_engine.UpdateMetadata.Extent, chromeos_update_engine.UpdateMetadata.Extent.Builder, chromeos_update_engine.UpdateMetadata.ExtentOrBuilder> + getFecExtentFieldBuilder() { + if (fecExtentBuilder_ == null) { + fecExtentBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + chromeos_update_engine.UpdateMetadata.Extent, chromeos_update_engine.UpdateMetadata.Extent.Builder, chromeos_update_engine.UpdateMetadata.ExtentOrBuilder>( + getFecExtent(), + getParentForChildren(), + isClean()); + fecExtent_ = null; + } + return fecExtentBuilder_; + } + + private int fecRoots_ = 2; + /** + *
+       * The number of FEC roots.
+       * 
+ * + * optional uint32 fec_roots = 16 [default = 2]; + * @return Whether the fecRoots field is set. + */ + @java.lang.Override + public boolean hasFecRoots() { + return ((bitField0_ & 0x00008000) != 0); + } + /** + *
+       * The number of FEC roots.
+       * 
+ * + * optional uint32 fec_roots = 16 [default = 2]; + * @return The fecRoots. + */ + @java.lang.Override + public int getFecRoots() { + return fecRoots_; + } + /** + *
+       * The number of FEC roots.
+       * 
+ * + * optional uint32 fec_roots = 16 [default = 2]; + * @param value The fecRoots to set. + * @return This builder for chaining. + */ + public Builder setFecRoots(int value) { + bitField0_ |= 0x00008000; + fecRoots_ = value; + onChanged(); + return this; + } + /** + *
+       * The number of FEC roots.
+       * 
+ * + * optional uint32 fec_roots = 16 [default = 2]; + * @return This builder for chaining. + */ + public Builder clearFecRoots() { + bitField0_ = (bitField0_ & ~0x00008000); + fecRoots_ = 2; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:chromeos_update_engine.PartitionUpdate) + } + + // @@protoc_insertion_point(class_scope:chromeos_update_engine.PartitionUpdate) + private static final chromeos_update_engine.UpdateMetadata.PartitionUpdate DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new chromeos_update_engine.UpdateMetadata.PartitionUpdate(); + } + + public static chromeos_update_engine.UpdateMetadata.PartitionUpdate getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @java.lang.Deprecated public static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PartitionUpdate parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new PartitionUpdate(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public chromeos_update_engine.UpdateMetadata.PartitionUpdate getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface DynamicPartitionGroupOrBuilder extends + // @@protoc_insertion_point(interface_extends:chromeos_update_engine.DynamicPartitionGroup) + com.google.protobuf.MessageOrBuilder { + + /** + *
+     * Name of the group.
+     * 
+ * + * required string name = 1; + * @return Whether the name field is set. + */ + boolean hasName(); + /** + *
+     * Name of the group.
+     * 
+ * + * required string name = 1; + * @return The name. + */ + java.lang.String getName(); + /** + *
+     * Name of the group.
+     * 
+ * + * required string name = 1; + * @return The bytes for name. + */ + com.google.protobuf.ByteString + getNameBytes(); + + /** + *
+     * Maximum size of the group. The sum of sizes of all partitions in the group
+     * must not exceed the maximum size of the group.
+     * 
+ * + * optional uint64 size = 2; + * @return Whether the size field is set. + */ + boolean hasSize(); + /** + *
+     * Maximum size of the group. The sum of sizes of all partitions in the group
+     * must not exceed the maximum size of the group.
+     * 
+ * + * optional uint64 size = 2; + * @return The size. + */ + long getSize(); + + /** + *
+     * A list of partitions that belong to the group.
+     * 
+ * + * repeated string partition_names = 3; + * @return A list containing the partitionNames. + */ + java.util.List + getPartitionNamesList(); + /** + *
+     * A list of partitions that belong to the group.
+     * 
+ * + * repeated string partition_names = 3; + * @return The count of partitionNames. + */ + int getPartitionNamesCount(); + /** + *
+     * A list of partitions that belong to the group.
+     * 
+ * + * repeated string partition_names = 3; + * @param index The index of the element to return. + * @return The partitionNames at the given index. + */ + java.lang.String getPartitionNames(int index); + /** + *
+     * A list of partitions that belong to the group.
+     * 
+ * + * repeated string partition_names = 3; + * @param index The index of the value to return. + * @return The bytes of the partitionNames at the given index. + */ + com.google.protobuf.ByteString + getPartitionNamesBytes(int index); + } + /** + * Protobuf type {@code chromeos_update_engine.DynamicPartitionGroup} + */ + public static final class DynamicPartitionGroup extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:chromeos_update_engine.DynamicPartitionGroup) + DynamicPartitionGroupOrBuilder { + private static final long serialVersionUID = 0L; + // Use DynamicPartitionGroup.newBuilder() to construct. + private DynamicPartitionGroup(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private DynamicPartitionGroup() { + name_ = ""; + partitionNames_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new DynamicPartitionGroup(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private DynamicPartitionGroup( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + com.google.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00000001; + name_ = bs; + break; + } + case 16: { + bitField0_ |= 0x00000002; + size_ = input.readUInt64(); + break; + } + case 26: { + com.google.protobuf.ByteString bs = input.readBytes(); + if (!((mutable_bitField0_ & 0x00000004) != 0)) { + partitionNames_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000004; + } + partitionNames_.add(bs); + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000004) != 0)) { + partitionNames_ = partitionNames_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return chromeos_update_engine.UpdateMetadata.internal_static_chromeos_update_engine_DynamicPartitionGroup_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return chromeos_update_engine.UpdateMetadata.internal_static_chromeos_update_engine_DynamicPartitionGroup_fieldAccessorTable + .ensureFieldAccessorsInitialized( + chromeos_update_engine.UpdateMetadata.DynamicPartitionGroup.class, chromeos_update_engine.UpdateMetadata.DynamicPartitionGroup.Builder.class); + } + + private int bitField0_; + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + *
+     * Name of the group.
+     * 
+ * + * required string name = 1; + * @return Whether the name field is set. + */ + @java.lang.Override + public boolean hasName() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + *
+     * Name of the group.
+     * 
+ * + * required string name = 1; + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + name_ = s; + } + return s; + } + } + /** + *
+     * Name of the group.
+     * 
+ * + * required string name = 1; + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SIZE_FIELD_NUMBER = 2; + private long size_; + /** + *
+     * Maximum size of the group. The sum of sizes of all partitions in the group
+     * must not exceed the maximum size of the group.
+     * 
+ * + * optional uint64 size = 2; + * @return Whether the size field is set. + */ + @java.lang.Override + public boolean hasSize() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + *
+     * Maximum size of the group. The sum of sizes of all partitions in the group
+     * must not exceed the maximum size of the group.
+     * 
+ * + * optional uint64 size = 2; + * @return The size. + */ + @java.lang.Override + public long getSize() { + return size_; + } + + public static final int PARTITION_NAMES_FIELD_NUMBER = 3; + private com.google.protobuf.LazyStringList partitionNames_; + /** + *
+     * A list of partitions that belong to the group.
+     * 
+ * + * repeated string partition_names = 3; + * @return A list containing the partitionNames. + */ + public com.google.protobuf.ProtocolStringList + getPartitionNamesList() { + return partitionNames_; + } + /** + *
+     * A list of partitions that belong to the group.
+     * 
+ * + * repeated string partition_names = 3; + * @return The count of partitionNames. + */ + public int getPartitionNamesCount() { + return partitionNames_.size(); + } + /** + *
+     * A list of partitions that belong to the group.
+     * 
+ * + * repeated string partition_names = 3; + * @param index The index of the element to return. + * @return The partitionNames at the given index. + */ + public java.lang.String getPartitionNames(int index) { + return partitionNames_.get(index); + } + /** + *
+     * A list of partitions that belong to the group.
+     * 
+ * + * repeated string partition_names = 3; + * @param index The index of the value to return. + * @return The bytes of the partitionNames at the given index. + */ + public com.google.protobuf.ByteString + getPartitionNamesBytes(int index) { + return partitionNames_.getByteString(index); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + if (!hasName()) { + memoizedIsInitialized = 0; + return false; + } + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeUInt64(2, size_); + } + for (int i = 0; i < partitionNames_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, partitionNames_.getRaw(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(2, size_); + } + { + int dataSize = 0; + for (int i = 0; i < partitionNames_.size(); i++) { + dataSize += computeStringSizeNoTag(partitionNames_.getRaw(i)); + } + size += dataSize; + size += 1 * getPartitionNamesList().size(); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof chromeos_update_engine.UpdateMetadata.DynamicPartitionGroup)) { + return super.equals(obj); + } + chromeos_update_engine.UpdateMetadata.DynamicPartitionGroup other = (chromeos_update_engine.UpdateMetadata.DynamicPartitionGroup) obj; + + if (hasName() != other.hasName()) return false; + if (hasName()) { + if (!getName() + .equals(other.getName())) return false; + } + if (hasSize() != other.hasSize()) return false; + if (hasSize()) { + if (getSize() + != other.getSize()) return false; + } + if (!getPartitionNamesList() + .equals(other.getPartitionNamesList())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasName()) { + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + } + if (hasSize()) { + hash = (37 * hash) + SIZE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getSize()); + } + if (getPartitionNamesCount() > 0) { + hash = (37 * hash) + PARTITION_NAMES_FIELD_NUMBER; + hash = (53 * hash) + getPartitionNamesList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static chromeos_update_engine.UpdateMetadata.DynamicPartitionGroup parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static chromeos_update_engine.UpdateMetadata.DynamicPartitionGroup parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static chromeos_update_engine.UpdateMetadata.DynamicPartitionGroup parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static chromeos_update_engine.UpdateMetadata.DynamicPartitionGroup parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static chromeos_update_engine.UpdateMetadata.DynamicPartitionGroup parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static chromeos_update_engine.UpdateMetadata.DynamicPartitionGroup parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static chromeos_update_engine.UpdateMetadata.DynamicPartitionGroup parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static chromeos_update_engine.UpdateMetadata.DynamicPartitionGroup parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static chromeos_update_engine.UpdateMetadata.DynamicPartitionGroup parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static chromeos_update_engine.UpdateMetadata.DynamicPartitionGroup parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static chromeos_update_engine.UpdateMetadata.DynamicPartitionGroup parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static chromeos_update_engine.UpdateMetadata.DynamicPartitionGroup parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(chromeos_update_engine.UpdateMetadata.DynamicPartitionGroup prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code chromeos_update_engine.DynamicPartitionGroup} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:chromeos_update_engine.DynamicPartitionGroup) + chromeos_update_engine.UpdateMetadata.DynamicPartitionGroupOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return chromeos_update_engine.UpdateMetadata.internal_static_chromeos_update_engine_DynamicPartitionGroup_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return chromeos_update_engine.UpdateMetadata.internal_static_chromeos_update_engine_DynamicPartitionGroup_fieldAccessorTable + .ensureFieldAccessorsInitialized( + chromeos_update_engine.UpdateMetadata.DynamicPartitionGroup.class, chromeos_update_engine.UpdateMetadata.DynamicPartitionGroup.Builder.class); + } + + // Construct using chromeos_update_engine.UpdateMetadata.DynamicPartitionGroup.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + bitField0_ = (bitField0_ & ~0x00000001); + size_ = 0L; + bitField0_ = (bitField0_ & ~0x00000002); + partitionNames_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000004); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return chromeos_update_engine.UpdateMetadata.internal_static_chromeos_update_engine_DynamicPartitionGroup_descriptor; + } + + @java.lang.Override + public chromeos_update_engine.UpdateMetadata.DynamicPartitionGroup getDefaultInstanceForType() { + return chromeos_update_engine.UpdateMetadata.DynamicPartitionGroup.getDefaultInstance(); + } + + @java.lang.Override + public chromeos_update_engine.UpdateMetadata.DynamicPartitionGroup build() { + chromeos_update_engine.UpdateMetadata.DynamicPartitionGroup result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public chromeos_update_engine.UpdateMetadata.DynamicPartitionGroup buildPartial() { + chromeos_update_engine.UpdateMetadata.DynamicPartitionGroup result = new chromeos_update_engine.UpdateMetadata.DynamicPartitionGroup(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + to_bitField0_ |= 0x00000001; + } + result.name_ = name_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.size_ = size_; + to_bitField0_ |= 0x00000002; + } + if (((bitField0_ & 0x00000004) != 0)) { + partitionNames_ = partitionNames_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.partitionNames_ = partitionNames_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof chromeos_update_engine.UpdateMetadata.DynamicPartitionGroup) { + return mergeFrom((chromeos_update_engine.UpdateMetadata.DynamicPartitionGroup)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(chromeos_update_engine.UpdateMetadata.DynamicPartitionGroup other) { + if (other == chromeos_update_engine.UpdateMetadata.DynamicPartitionGroup.getDefaultInstance()) return this; + if (other.hasName()) { + bitField0_ |= 0x00000001; + name_ = other.name_; + onChanged(); + } + if (other.hasSize()) { + setSize(other.getSize()); + } + if (!other.partitionNames_.isEmpty()) { + if (partitionNames_.isEmpty()) { + partitionNames_ = other.partitionNames_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensurePartitionNamesIsMutable(); + partitionNames_.addAll(other.partitionNames_); + } + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + if (!hasName()) { + return false; + } + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + chromeos_update_engine.UpdateMetadata.DynamicPartitionGroup parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (chromeos_update_engine.UpdateMetadata.DynamicPartitionGroup) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + *
+       * Name of the group.
+       * 
+ * + * required string name = 1; + * @return Whether the name field is set. + */ + public boolean hasName() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + *
+       * Name of the group.
+       * 
+ * + * required string name = 1; + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + name_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+       * Name of the group.
+       * 
+ * + * required string name = 1; + * @return The bytes for name. + */ + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       * Name of the group.
+       * 
+ * + * required string name = 1; + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + name_ = value; + onChanged(); + return this; + } + /** + *
+       * Name of the group.
+       * 
+ * + * required string name = 1; + * @return This builder for chaining. + */ + public Builder clearName() { + bitField0_ = (bitField0_ & ~0x00000001); + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + *
+       * Name of the group.
+       * 
+ * + * required string name = 1; + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + name_ = value; + onChanged(); + return this; + } + + private long size_ ; + /** + *
+       * Maximum size of the group. The sum of sizes of all partitions in the group
+       * must not exceed the maximum size of the group.
+       * 
+ * + * optional uint64 size = 2; + * @return Whether the size field is set. + */ + @java.lang.Override + public boolean hasSize() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + *
+       * Maximum size of the group. The sum of sizes of all partitions in the group
+       * must not exceed the maximum size of the group.
+       * 
+ * + * optional uint64 size = 2; + * @return The size. + */ + @java.lang.Override + public long getSize() { + return size_; + } + /** + *
+       * Maximum size of the group. The sum of sizes of all partitions in the group
+       * must not exceed the maximum size of the group.
+       * 
+ * + * optional uint64 size = 2; + * @param value The size to set. + * @return This builder for chaining. + */ + public Builder setSize(long value) { + bitField0_ |= 0x00000002; + size_ = value; + onChanged(); + return this; + } + /** + *
+       * Maximum size of the group. The sum of sizes of all partitions in the group
+       * must not exceed the maximum size of the group.
+       * 
+ * + * optional uint64 size = 2; + * @return This builder for chaining. + */ + public Builder clearSize() { + bitField0_ = (bitField0_ & ~0x00000002); + size_ = 0L; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList partitionNames_ = com.google.protobuf.LazyStringArrayList.EMPTY; + private void ensurePartitionNamesIsMutable() { + if (!((bitField0_ & 0x00000004) != 0)) { + partitionNames_ = new com.google.protobuf.LazyStringArrayList(partitionNames_); + bitField0_ |= 0x00000004; + } + } + /** + *
+       * A list of partitions that belong to the group.
+       * 
+ * + * repeated string partition_names = 3; + * @return A list containing the partitionNames. + */ + public com.google.protobuf.ProtocolStringList + getPartitionNamesList() { + return partitionNames_.getUnmodifiableView(); + } + /** + *
+       * A list of partitions that belong to the group.
+       * 
+ * + * repeated string partition_names = 3; + * @return The count of partitionNames. + */ + public int getPartitionNamesCount() { + return partitionNames_.size(); + } + /** + *
+       * A list of partitions that belong to the group.
+       * 
+ * + * repeated string partition_names = 3; + * @param index The index of the element to return. + * @return The partitionNames at the given index. + */ + public java.lang.String getPartitionNames(int index) { + return partitionNames_.get(index); + } + /** + *
+       * A list of partitions that belong to the group.
+       * 
+ * + * repeated string partition_names = 3; + * @param index The index of the value to return. + * @return The bytes of the partitionNames at the given index. + */ + public com.google.protobuf.ByteString + getPartitionNamesBytes(int index) { + return partitionNames_.getByteString(index); + } + /** + *
+       * A list of partitions that belong to the group.
+       * 
+ * + * repeated string partition_names = 3; + * @param index The index to set the value at. + * @param value The partitionNames to set. + * @return This builder for chaining. + */ + public Builder setPartitionNames( + int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensurePartitionNamesIsMutable(); + partitionNames_.set(index, value); + onChanged(); + return this; + } + /** + *
+       * A list of partitions that belong to the group.
+       * 
+ * + * repeated string partition_names = 3; + * @param value The partitionNames to add. + * @return This builder for chaining. + */ + public Builder addPartitionNames( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensurePartitionNamesIsMutable(); + partitionNames_.add(value); + onChanged(); + return this; + } + /** + *
+       * A list of partitions that belong to the group.
+       * 
+ * + * repeated string partition_names = 3; + * @param values The partitionNames to add. + * @return This builder for chaining. + */ + public Builder addAllPartitionNames( + java.lang.Iterable values) { + ensurePartitionNamesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, partitionNames_); + onChanged(); + return this; + } + /** + *
+       * A list of partitions that belong to the group.
+       * 
+ * + * repeated string partition_names = 3; + * @return This builder for chaining. + */ + public Builder clearPartitionNames() { + partitionNames_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + *
+       * A list of partitions that belong to the group.
+       * 
+ * + * repeated string partition_names = 3; + * @param value The bytes of the partitionNames to add. + * @return This builder for chaining. + */ + public Builder addPartitionNamesBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + ensurePartitionNamesIsMutable(); + partitionNames_.add(value); + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:chromeos_update_engine.DynamicPartitionGroup) + } + + // @@protoc_insertion_point(class_scope:chromeos_update_engine.DynamicPartitionGroup) + private static final chromeos_update_engine.UpdateMetadata.DynamicPartitionGroup DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new chromeos_update_engine.UpdateMetadata.DynamicPartitionGroup(); + } + + public static chromeos_update_engine.UpdateMetadata.DynamicPartitionGroup getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @java.lang.Deprecated public static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DynamicPartitionGroup parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DynamicPartitionGroup(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public chromeos_update_engine.UpdateMetadata.DynamicPartitionGroup getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface DynamicPartitionMetadataOrBuilder extends + // @@protoc_insertion_point(interface_extends:chromeos_update_engine.DynamicPartitionMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + *
+     * All updatable groups present in |partitions| of this DeltaArchiveManifest.
+     * - If an updatable group is on the device but not in the manifest, it is
+     *   not updated. Hence, the group will not be resized, and partitions cannot
+     *   be added to or removed from the group.
+     * - If an updatable group is in the manifest but not on the device, the group
+     *   is added to the device.
+     * 
+ * + * repeated .chromeos_update_engine.DynamicPartitionGroup groups = 1; + */ + java.util.List + getGroupsList(); + /** + *
+     * All updatable groups present in |partitions| of this DeltaArchiveManifest.
+     * - If an updatable group is on the device but not in the manifest, it is
+     *   not updated. Hence, the group will not be resized, and partitions cannot
+     *   be added to or removed from the group.
+     * - If an updatable group is in the manifest but not on the device, the group
+     *   is added to the device.
+     * 
+ * + * repeated .chromeos_update_engine.DynamicPartitionGroup groups = 1; + */ + chromeos_update_engine.UpdateMetadata.DynamicPartitionGroup getGroups(int index); + /** + *
+     * All updatable groups present in |partitions| of this DeltaArchiveManifest.
+     * - If an updatable group is on the device but not in the manifest, it is
+     *   not updated. Hence, the group will not be resized, and partitions cannot
+     *   be added to or removed from the group.
+     * - If an updatable group is in the manifest but not on the device, the group
+     *   is added to the device.
+     * 
+ * + * repeated .chromeos_update_engine.DynamicPartitionGroup groups = 1; + */ + int getGroupsCount(); + /** + *
+     * All updatable groups present in |partitions| of this DeltaArchiveManifest.
+     * - If an updatable group is on the device but not in the manifest, it is
+     *   not updated. Hence, the group will not be resized, and partitions cannot
+     *   be added to or removed from the group.
+     * - If an updatable group is in the manifest but not on the device, the group
+     *   is added to the device.
+     * 
+ * + * repeated .chromeos_update_engine.DynamicPartitionGroup groups = 1; + */ + java.util.List + getGroupsOrBuilderList(); + /** + *
+     * All updatable groups present in |partitions| of this DeltaArchiveManifest.
+     * - If an updatable group is on the device but not in the manifest, it is
+     *   not updated. Hence, the group will not be resized, and partitions cannot
+     *   be added to or removed from the group.
+     * - If an updatable group is in the manifest but not on the device, the group
+     *   is added to the device.
+     * 
+ * + * repeated .chromeos_update_engine.DynamicPartitionGroup groups = 1; + */ + chromeos_update_engine.UpdateMetadata.DynamicPartitionGroupOrBuilder getGroupsOrBuilder( + int index); + + /** + *
+     * Whether dynamic partitions have snapshots during the update. If this is
+     * set to true, the update_engine daemon creates snapshots for all dynamic
+     * partitions if possible. If this is unset, the update_engine daemon MUST
+     * NOT create snapshots for dynamic partitions.
+     * 
+ * + * optional bool snapshot_enabled = 2; + * @return Whether the snapshotEnabled field is set. + */ + boolean hasSnapshotEnabled(); + /** + *
+     * Whether dynamic partitions have snapshots during the update. If this is
+     * set to true, the update_engine daemon creates snapshots for all dynamic
+     * partitions if possible. If this is unset, the update_engine daemon MUST
+     * NOT create snapshots for dynamic partitions.
+     * 
+ * + * optional bool snapshot_enabled = 2; + * @return The snapshotEnabled. + */ + boolean getSnapshotEnabled(); + } + /** + *
+   * Metadata related to all dynamic partitions.
+   * 
+ * + * Protobuf type {@code chromeos_update_engine.DynamicPartitionMetadata} + */ + public static final class DynamicPartitionMetadata extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:chromeos_update_engine.DynamicPartitionMetadata) + DynamicPartitionMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use DynamicPartitionMetadata.newBuilder() to construct. + private DynamicPartitionMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private DynamicPartitionMetadata() { + groups_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new DynamicPartitionMetadata(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private DynamicPartitionMetadata( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + groups_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + groups_.add( + input.readMessage(chromeos_update_engine.UpdateMetadata.DynamicPartitionGroup.PARSER, extensionRegistry)); + break; + } + case 16: { + bitField0_ |= 0x00000001; + snapshotEnabled_ = input.readBool(); + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + groups_ = java.util.Collections.unmodifiableList(groups_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return chromeos_update_engine.UpdateMetadata.internal_static_chromeos_update_engine_DynamicPartitionMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return chromeos_update_engine.UpdateMetadata.internal_static_chromeos_update_engine_DynamicPartitionMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + chromeos_update_engine.UpdateMetadata.DynamicPartitionMetadata.class, chromeos_update_engine.UpdateMetadata.DynamicPartitionMetadata.Builder.class); + } + + private int bitField0_; + public static final int GROUPS_FIELD_NUMBER = 1; + private java.util.List groups_; + /** + *
+     * All updatable groups present in |partitions| of this DeltaArchiveManifest.
+     * - If an updatable group is on the device but not in the manifest, it is
+     *   not updated. Hence, the group will not be resized, and partitions cannot
+     *   be added to or removed from the group.
+     * - If an updatable group is in the manifest but not on the device, the group
+     *   is added to the device.
+     * 
+ * + * repeated .chromeos_update_engine.DynamicPartitionGroup groups = 1; + */ + @java.lang.Override + public java.util.List getGroupsList() { + return groups_; + } + /** + *
+     * All updatable groups present in |partitions| of this DeltaArchiveManifest.
+     * - If an updatable group is on the device but not in the manifest, it is
+     *   not updated. Hence, the group will not be resized, and partitions cannot
+     *   be added to or removed from the group.
+     * - If an updatable group is in the manifest but not on the device, the group
+     *   is added to the device.
+     * 
+ * + * repeated .chromeos_update_engine.DynamicPartitionGroup groups = 1; + */ + @java.lang.Override + public java.util.List + getGroupsOrBuilderList() { + return groups_; + } + /** + *
+     * All updatable groups present in |partitions| of this DeltaArchiveManifest.
+     * - If an updatable group is on the device but not in the manifest, it is
+     *   not updated. Hence, the group will not be resized, and partitions cannot
+     *   be added to or removed from the group.
+     * - If an updatable group is in the manifest but not on the device, the group
+     *   is added to the device.
+     * 
+ * + * repeated .chromeos_update_engine.DynamicPartitionGroup groups = 1; + */ + @java.lang.Override + public int getGroupsCount() { + return groups_.size(); + } + /** + *
+     * All updatable groups present in |partitions| of this DeltaArchiveManifest.
+     * - If an updatable group is on the device but not in the manifest, it is
+     *   not updated. Hence, the group will not be resized, and partitions cannot
+     *   be added to or removed from the group.
+     * - If an updatable group is in the manifest but not on the device, the group
+     *   is added to the device.
+     * 
+ * + * repeated .chromeos_update_engine.DynamicPartitionGroup groups = 1; + */ + @java.lang.Override + public chromeos_update_engine.UpdateMetadata.DynamicPartitionGroup getGroups(int index) { + return groups_.get(index); + } + /** + *
+     * All updatable groups present in |partitions| of this DeltaArchiveManifest.
+     * - If an updatable group is on the device but not in the manifest, it is
+     *   not updated. Hence, the group will not be resized, and partitions cannot
+     *   be added to or removed from the group.
+     * - If an updatable group is in the manifest but not on the device, the group
+     *   is added to the device.
+     * 
+ * + * repeated .chromeos_update_engine.DynamicPartitionGroup groups = 1; + */ + @java.lang.Override + public chromeos_update_engine.UpdateMetadata.DynamicPartitionGroupOrBuilder getGroupsOrBuilder( + int index) { + return groups_.get(index); + } + + public static final int SNAPSHOT_ENABLED_FIELD_NUMBER = 2; + private boolean snapshotEnabled_; + /** + *
+     * Whether dynamic partitions have snapshots during the update. If this is
+     * set to true, the update_engine daemon creates snapshots for all dynamic
+     * partitions if possible. If this is unset, the update_engine daemon MUST
+     * NOT create snapshots for dynamic partitions.
+     * 
+ * + * optional bool snapshot_enabled = 2; + * @return Whether the snapshotEnabled field is set. + */ + @java.lang.Override + public boolean hasSnapshotEnabled() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + *
+     * Whether dynamic partitions have snapshots during the update. If this is
+     * set to true, the update_engine daemon creates snapshots for all dynamic
+     * partitions if possible. If this is unset, the update_engine daemon MUST
+     * NOT create snapshots for dynamic partitions.
+     * 
+ * + * optional bool snapshot_enabled = 2; + * @return The snapshotEnabled. + */ + @java.lang.Override + public boolean getSnapshotEnabled() { + return snapshotEnabled_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + for (int i = 0; i < getGroupsCount(); i++) { + if (!getGroups(i).isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + for (int i = 0; i < groups_.size(); i++) { + output.writeMessage(1, groups_.get(i)); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeBool(2, snapshotEnabled_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < groups_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, groups_.get(i)); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(2, snapshotEnabled_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof chromeos_update_engine.UpdateMetadata.DynamicPartitionMetadata)) { + return super.equals(obj); + } + chromeos_update_engine.UpdateMetadata.DynamicPartitionMetadata other = (chromeos_update_engine.UpdateMetadata.DynamicPartitionMetadata) obj; + + if (!getGroupsList() + .equals(other.getGroupsList())) return false; + if (hasSnapshotEnabled() != other.hasSnapshotEnabled()) return false; + if (hasSnapshotEnabled()) { + if (getSnapshotEnabled() + != other.getSnapshotEnabled()) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getGroupsCount() > 0) { + hash = (37 * hash) + GROUPS_FIELD_NUMBER; + hash = (53 * hash) + getGroupsList().hashCode(); + } + if (hasSnapshotEnabled()) { + hash = (37 * hash) + SNAPSHOT_ENABLED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getSnapshotEnabled()); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static chromeos_update_engine.UpdateMetadata.DynamicPartitionMetadata parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static chromeos_update_engine.UpdateMetadata.DynamicPartitionMetadata parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static chromeos_update_engine.UpdateMetadata.DynamicPartitionMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static chromeos_update_engine.UpdateMetadata.DynamicPartitionMetadata parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static chromeos_update_engine.UpdateMetadata.DynamicPartitionMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static chromeos_update_engine.UpdateMetadata.DynamicPartitionMetadata parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static chromeos_update_engine.UpdateMetadata.DynamicPartitionMetadata parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static chromeos_update_engine.UpdateMetadata.DynamicPartitionMetadata parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static chromeos_update_engine.UpdateMetadata.DynamicPartitionMetadata parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static chromeos_update_engine.UpdateMetadata.DynamicPartitionMetadata parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static chromeos_update_engine.UpdateMetadata.DynamicPartitionMetadata parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static chromeos_update_engine.UpdateMetadata.DynamicPartitionMetadata parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(chromeos_update_engine.UpdateMetadata.DynamicPartitionMetadata prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+     * Metadata related to all dynamic partitions.
+     * 
+ * + * Protobuf type {@code chromeos_update_engine.DynamicPartitionMetadata} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:chromeos_update_engine.DynamicPartitionMetadata) + chromeos_update_engine.UpdateMetadata.DynamicPartitionMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return chromeos_update_engine.UpdateMetadata.internal_static_chromeos_update_engine_DynamicPartitionMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return chromeos_update_engine.UpdateMetadata.internal_static_chromeos_update_engine_DynamicPartitionMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + chromeos_update_engine.UpdateMetadata.DynamicPartitionMetadata.class, chromeos_update_engine.UpdateMetadata.DynamicPartitionMetadata.Builder.class); + } + + // Construct using chromeos_update_engine.UpdateMetadata.DynamicPartitionMetadata.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getGroupsFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (groupsBuilder_ == null) { + groups_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + groupsBuilder_.clear(); + } + snapshotEnabled_ = false; + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return chromeos_update_engine.UpdateMetadata.internal_static_chromeos_update_engine_DynamicPartitionMetadata_descriptor; + } + + @java.lang.Override + public chromeos_update_engine.UpdateMetadata.DynamicPartitionMetadata getDefaultInstanceForType() { + return chromeos_update_engine.UpdateMetadata.DynamicPartitionMetadata.getDefaultInstance(); + } + + @java.lang.Override + public chromeos_update_engine.UpdateMetadata.DynamicPartitionMetadata build() { + chromeos_update_engine.UpdateMetadata.DynamicPartitionMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public chromeos_update_engine.UpdateMetadata.DynamicPartitionMetadata buildPartial() { + chromeos_update_engine.UpdateMetadata.DynamicPartitionMetadata result = new chromeos_update_engine.UpdateMetadata.DynamicPartitionMetadata(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (groupsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + groups_ = java.util.Collections.unmodifiableList(groups_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.groups_ = groups_; + } else { + result.groups_ = groupsBuilder_.build(); + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.snapshotEnabled_ = snapshotEnabled_; + to_bitField0_ |= 0x00000001; + } + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof chromeos_update_engine.UpdateMetadata.DynamicPartitionMetadata) { + return mergeFrom((chromeos_update_engine.UpdateMetadata.DynamicPartitionMetadata)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(chromeos_update_engine.UpdateMetadata.DynamicPartitionMetadata other) { + if (other == chromeos_update_engine.UpdateMetadata.DynamicPartitionMetadata.getDefaultInstance()) return this; + if (groupsBuilder_ == null) { + if (!other.groups_.isEmpty()) { + if (groups_.isEmpty()) { + groups_ = other.groups_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureGroupsIsMutable(); + groups_.addAll(other.groups_); + } + onChanged(); + } + } else { + if (!other.groups_.isEmpty()) { + if (groupsBuilder_.isEmpty()) { + groupsBuilder_.dispose(); + groupsBuilder_ = null; + groups_ = other.groups_; + bitField0_ = (bitField0_ & ~0x00000001); + groupsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getGroupsFieldBuilder() : null; + } else { + groupsBuilder_.addAllMessages(other.groups_); + } + } + } + if (other.hasSnapshotEnabled()) { + setSnapshotEnabled(other.getSnapshotEnabled()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + for (int i = 0; i < getGroupsCount(); i++) { + if (!getGroups(i).isInitialized()) { + return false; + } + } + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + chromeos_update_engine.UpdateMetadata.DynamicPartitionMetadata parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (chromeos_update_engine.UpdateMetadata.DynamicPartitionMetadata) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.util.List groups_ = + java.util.Collections.emptyList(); + private void ensureGroupsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + groups_ = new java.util.ArrayList(groups_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + chromeos_update_engine.UpdateMetadata.DynamicPartitionGroup, chromeos_update_engine.UpdateMetadata.DynamicPartitionGroup.Builder, chromeos_update_engine.UpdateMetadata.DynamicPartitionGroupOrBuilder> groupsBuilder_; + + /** + *
+       * All updatable groups present in |partitions| of this DeltaArchiveManifest.
+       * - If an updatable group is on the device but not in the manifest, it is
+       *   not updated. Hence, the group will not be resized, and partitions cannot
+       *   be added to or removed from the group.
+       * - If an updatable group is in the manifest but not on the device, the group
+       *   is added to the device.
+       * 
+ * + * repeated .chromeos_update_engine.DynamicPartitionGroup groups = 1; + */ + public java.util.List getGroupsList() { + if (groupsBuilder_ == null) { + return java.util.Collections.unmodifiableList(groups_); + } else { + return groupsBuilder_.getMessageList(); + } + } + /** + *
+       * All updatable groups present in |partitions| of this DeltaArchiveManifest.
+       * - If an updatable group is on the device but not in the manifest, it is
+       *   not updated. Hence, the group will not be resized, and partitions cannot
+       *   be added to or removed from the group.
+       * - If an updatable group is in the manifest but not on the device, the group
+       *   is added to the device.
+       * 
+ * + * repeated .chromeos_update_engine.DynamicPartitionGroup groups = 1; + */ + public int getGroupsCount() { + if (groupsBuilder_ == null) { + return groups_.size(); + } else { + return groupsBuilder_.getCount(); + } + } + /** + *
+       * All updatable groups present in |partitions| of this DeltaArchiveManifest.
+       * - If an updatable group is on the device but not in the manifest, it is
+       *   not updated. Hence, the group will not be resized, and partitions cannot
+       *   be added to or removed from the group.
+       * - If an updatable group is in the manifest but not on the device, the group
+       *   is added to the device.
+       * 
+ * + * repeated .chromeos_update_engine.DynamicPartitionGroup groups = 1; + */ + public chromeos_update_engine.UpdateMetadata.DynamicPartitionGroup getGroups(int index) { + if (groupsBuilder_ == null) { + return groups_.get(index); + } else { + return groupsBuilder_.getMessage(index); + } + } + /** + *
+       * All updatable groups present in |partitions| of this DeltaArchiveManifest.
+       * - If an updatable group is on the device but not in the manifest, it is
+       *   not updated. Hence, the group will not be resized, and partitions cannot
+       *   be added to or removed from the group.
+       * - If an updatable group is in the manifest but not on the device, the group
+       *   is added to the device.
+       * 
+ * + * repeated .chromeos_update_engine.DynamicPartitionGroup groups = 1; + */ + public Builder setGroups( + int index, chromeos_update_engine.UpdateMetadata.DynamicPartitionGroup value) { + if (groupsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureGroupsIsMutable(); + groups_.set(index, value); + onChanged(); + } else { + groupsBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+       * All updatable groups present in |partitions| of this DeltaArchiveManifest.
+       * - If an updatable group is on the device but not in the manifest, it is
+       *   not updated. Hence, the group will not be resized, and partitions cannot
+       *   be added to or removed from the group.
+       * - If an updatable group is in the manifest but not on the device, the group
+       *   is added to the device.
+       * 
+ * + * repeated .chromeos_update_engine.DynamicPartitionGroup groups = 1; + */ + public Builder setGroups( + int index, chromeos_update_engine.UpdateMetadata.DynamicPartitionGroup.Builder builderForValue) { + if (groupsBuilder_ == null) { + ensureGroupsIsMutable(); + groups_.set(index, builderForValue.build()); + onChanged(); + } else { + groupsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+       * All updatable groups present in |partitions| of this DeltaArchiveManifest.
+       * - If an updatable group is on the device but not in the manifest, it is
+       *   not updated. Hence, the group will not be resized, and partitions cannot
+       *   be added to or removed from the group.
+       * - If an updatable group is in the manifest but not on the device, the group
+       *   is added to the device.
+       * 
+ * + * repeated .chromeos_update_engine.DynamicPartitionGroup groups = 1; + */ + public Builder addGroups(chromeos_update_engine.UpdateMetadata.DynamicPartitionGroup value) { + if (groupsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureGroupsIsMutable(); + groups_.add(value); + onChanged(); + } else { + groupsBuilder_.addMessage(value); + } + return this; + } + /** + *
+       * All updatable groups present in |partitions| of this DeltaArchiveManifest.
+       * - If an updatable group is on the device but not in the manifest, it is
+       *   not updated. Hence, the group will not be resized, and partitions cannot
+       *   be added to or removed from the group.
+       * - If an updatable group is in the manifest but not on the device, the group
+       *   is added to the device.
+       * 
+ * + * repeated .chromeos_update_engine.DynamicPartitionGroup groups = 1; + */ + public Builder addGroups( + int index, chromeos_update_engine.UpdateMetadata.DynamicPartitionGroup value) { + if (groupsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureGroupsIsMutable(); + groups_.add(index, value); + onChanged(); + } else { + groupsBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+       * All updatable groups present in |partitions| of this DeltaArchiveManifest.
+       * - If an updatable group is on the device but not in the manifest, it is
+       *   not updated. Hence, the group will not be resized, and partitions cannot
+       *   be added to or removed from the group.
+       * - If an updatable group is in the manifest but not on the device, the group
+       *   is added to the device.
+       * 
+ * + * repeated .chromeos_update_engine.DynamicPartitionGroup groups = 1; + */ + public Builder addGroups( + chromeos_update_engine.UpdateMetadata.DynamicPartitionGroup.Builder builderForValue) { + if (groupsBuilder_ == null) { + ensureGroupsIsMutable(); + groups_.add(builderForValue.build()); + onChanged(); + } else { + groupsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+       * All updatable groups present in |partitions| of this DeltaArchiveManifest.
+       * - If an updatable group is on the device but not in the manifest, it is
+       *   not updated. Hence, the group will not be resized, and partitions cannot
+       *   be added to or removed from the group.
+       * - If an updatable group is in the manifest but not on the device, the group
+       *   is added to the device.
+       * 
+ * + * repeated .chromeos_update_engine.DynamicPartitionGroup groups = 1; + */ + public Builder addGroups( + int index, chromeos_update_engine.UpdateMetadata.DynamicPartitionGroup.Builder builderForValue) { + if (groupsBuilder_ == null) { + ensureGroupsIsMutable(); + groups_.add(index, builderForValue.build()); + onChanged(); + } else { + groupsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+       * All updatable groups present in |partitions| of this DeltaArchiveManifest.
+       * - If an updatable group is on the device but not in the manifest, it is
+       *   not updated. Hence, the group will not be resized, and partitions cannot
+       *   be added to or removed from the group.
+       * - If an updatable group is in the manifest but not on the device, the group
+       *   is added to the device.
+       * 
+ * + * repeated .chromeos_update_engine.DynamicPartitionGroup groups = 1; + */ + public Builder addAllGroups( + java.lang.Iterable values) { + if (groupsBuilder_ == null) { + ensureGroupsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, groups_); + onChanged(); + } else { + groupsBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+       * All updatable groups present in |partitions| of this DeltaArchiveManifest.
+       * - If an updatable group is on the device but not in the manifest, it is
+       *   not updated. Hence, the group will not be resized, and partitions cannot
+       *   be added to or removed from the group.
+       * - If an updatable group is in the manifest but not on the device, the group
+       *   is added to the device.
+       * 
+ * + * repeated .chromeos_update_engine.DynamicPartitionGroup groups = 1; + */ + public Builder clearGroups() { + if (groupsBuilder_ == null) { + groups_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + groupsBuilder_.clear(); + } + return this; + } + /** + *
+       * All updatable groups present in |partitions| of this DeltaArchiveManifest.
+       * - If an updatable group is on the device but not in the manifest, it is
+       *   not updated. Hence, the group will not be resized, and partitions cannot
+       *   be added to or removed from the group.
+       * - If an updatable group is in the manifest but not on the device, the group
+       *   is added to the device.
+       * 
+ * + * repeated .chromeos_update_engine.DynamicPartitionGroup groups = 1; + */ + public Builder removeGroups(int index) { + if (groupsBuilder_ == null) { + ensureGroupsIsMutable(); + groups_.remove(index); + onChanged(); + } else { + groupsBuilder_.remove(index); + } + return this; + } + /** + *
+       * All updatable groups present in |partitions| of this DeltaArchiveManifest.
+       * - If an updatable group is on the device but not in the manifest, it is
+       *   not updated. Hence, the group will not be resized, and partitions cannot
+       *   be added to or removed from the group.
+       * - If an updatable group is in the manifest but not on the device, the group
+       *   is added to the device.
+       * 
+ * + * repeated .chromeos_update_engine.DynamicPartitionGroup groups = 1; + */ + public chromeos_update_engine.UpdateMetadata.DynamicPartitionGroup.Builder getGroupsBuilder( + int index) { + return getGroupsFieldBuilder().getBuilder(index); + } + /** + *
+       * All updatable groups present in |partitions| of this DeltaArchiveManifest.
+       * - If an updatable group is on the device but not in the manifest, it is
+       *   not updated. Hence, the group will not be resized, and partitions cannot
+       *   be added to or removed from the group.
+       * - If an updatable group is in the manifest but not on the device, the group
+       *   is added to the device.
+       * 
+ * + * repeated .chromeos_update_engine.DynamicPartitionGroup groups = 1; + */ + public chromeos_update_engine.UpdateMetadata.DynamicPartitionGroupOrBuilder getGroupsOrBuilder( + int index) { + if (groupsBuilder_ == null) { + return groups_.get(index); } else { + return groupsBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+       * All updatable groups present in |partitions| of this DeltaArchiveManifest.
+       * - If an updatable group is on the device but not in the manifest, it is
+       *   not updated. Hence, the group will not be resized, and partitions cannot
+       *   be added to or removed from the group.
+       * - If an updatable group is in the manifest but not on the device, the group
+       *   is added to the device.
+       * 
+ * + * repeated .chromeos_update_engine.DynamicPartitionGroup groups = 1; + */ + public java.util.List + getGroupsOrBuilderList() { + if (groupsBuilder_ != null) { + return groupsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(groups_); + } + } + /** + *
+       * All updatable groups present in |partitions| of this DeltaArchiveManifest.
+       * - If an updatable group is on the device but not in the manifest, it is
+       *   not updated. Hence, the group will not be resized, and partitions cannot
+       *   be added to or removed from the group.
+       * - If an updatable group is in the manifest but not on the device, the group
+       *   is added to the device.
+       * 
+ * + * repeated .chromeos_update_engine.DynamicPartitionGroup groups = 1; + */ + public chromeos_update_engine.UpdateMetadata.DynamicPartitionGroup.Builder addGroupsBuilder() { + return getGroupsFieldBuilder().addBuilder( + chromeos_update_engine.UpdateMetadata.DynamicPartitionGroup.getDefaultInstance()); + } + /** + *
+       * All updatable groups present in |partitions| of this DeltaArchiveManifest.
+       * - If an updatable group is on the device but not in the manifest, it is
+       *   not updated. Hence, the group will not be resized, and partitions cannot
+       *   be added to or removed from the group.
+       * - If an updatable group is in the manifest but not on the device, the group
+       *   is added to the device.
+       * 
+ * + * repeated .chromeos_update_engine.DynamicPartitionGroup groups = 1; + */ + public chromeos_update_engine.UpdateMetadata.DynamicPartitionGroup.Builder addGroupsBuilder( + int index) { + return getGroupsFieldBuilder().addBuilder( + index, chromeos_update_engine.UpdateMetadata.DynamicPartitionGroup.getDefaultInstance()); + } + /** + *
+       * All updatable groups present in |partitions| of this DeltaArchiveManifest.
+       * - If an updatable group is on the device but not in the manifest, it is
+       *   not updated. Hence, the group will not be resized, and partitions cannot
+       *   be added to or removed from the group.
+       * - If an updatable group is in the manifest but not on the device, the group
+       *   is added to the device.
+       * 
+ * + * repeated .chromeos_update_engine.DynamicPartitionGroup groups = 1; + */ + public java.util.List + getGroupsBuilderList() { + return getGroupsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + chromeos_update_engine.UpdateMetadata.DynamicPartitionGroup, chromeos_update_engine.UpdateMetadata.DynamicPartitionGroup.Builder, chromeos_update_engine.UpdateMetadata.DynamicPartitionGroupOrBuilder> + getGroupsFieldBuilder() { + if (groupsBuilder_ == null) { + groupsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + chromeos_update_engine.UpdateMetadata.DynamicPartitionGroup, chromeos_update_engine.UpdateMetadata.DynamicPartitionGroup.Builder, chromeos_update_engine.UpdateMetadata.DynamicPartitionGroupOrBuilder>( + groups_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + groups_ = null; + } + return groupsBuilder_; + } + + private boolean snapshotEnabled_ ; + /** + *
+       * Whether dynamic partitions have snapshots during the update. If this is
+       * set to true, the update_engine daemon creates snapshots for all dynamic
+       * partitions if possible. If this is unset, the update_engine daemon MUST
+       * NOT create snapshots for dynamic partitions.
+       * 
+ * + * optional bool snapshot_enabled = 2; + * @return Whether the snapshotEnabled field is set. + */ + @java.lang.Override + public boolean hasSnapshotEnabled() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + *
+       * Whether dynamic partitions have snapshots during the update. If this is
+       * set to true, the update_engine daemon creates snapshots for all dynamic
+       * partitions if possible. If this is unset, the update_engine daemon MUST
+       * NOT create snapshots for dynamic partitions.
+       * 
+ * + * optional bool snapshot_enabled = 2; + * @return The snapshotEnabled. + */ + @java.lang.Override + public boolean getSnapshotEnabled() { + return snapshotEnabled_; + } + /** + *
+       * Whether dynamic partitions have snapshots during the update. If this is
+       * set to true, the update_engine daemon creates snapshots for all dynamic
+       * partitions if possible. If this is unset, the update_engine daemon MUST
+       * NOT create snapshots for dynamic partitions.
+       * 
+ * + * optional bool snapshot_enabled = 2; + * @param value The snapshotEnabled to set. + * @return This builder for chaining. + */ + public Builder setSnapshotEnabled(boolean value) { + bitField0_ |= 0x00000002; + snapshotEnabled_ = value; + onChanged(); + return this; + } + /** + *
+       * Whether dynamic partitions have snapshots during the update. If this is
+       * set to true, the update_engine daemon creates snapshots for all dynamic
+       * partitions if possible. If this is unset, the update_engine daemon MUST
+       * NOT create snapshots for dynamic partitions.
+       * 
+ * + * optional bool snapshot_enabled = 2; + * @return This builder for chaining. + */ + public Builder clearSnapshotEnabled() { + bitField0_ = (bitField0_ & ~0x00000002); + snapshotEnabled_ = false; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:chromeos_update_engine.DynamicPartitionMetadata) + } + + // @@protoc_insertion_point(class_scope:chromeos_update_engine.DynamicPartitionMetadata) + private static final chromeos_update_engine.UpdateMetadata.DynamicPartitionMetadata DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new chromeos_update_engine.UpdateMetadata.DynamicPartitionMetadata(); + } + + public static chromeos_update_engine.UpdateMetadata.DynamicPartitionMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @java.lang.Deprecated public static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DynamicPartitionMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DynamicPartitionMetadata(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public chromeos_update_engine.UpdateMetadata.DynamicPartitionMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface DeltaArchiveManifestOrBuilder extends + // @@protoc_insertion_point(interface_extends:chromeos_update_engine.DeltaArchiveManifest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+     * Only present in major version = 1. List of install operations for the
+     * kernel and rootfs partitions. For major version = 2 see the |partitions|
+     * field.
+     * 
+ * + * repeated .chromeos_update_engine.InstallOperation install_operations = 1; + */ + java.util.List + getInstallOperationsList(); + /** + *
+     * Only present in major version = 1. List of install operations for the
+     * kernel and rootfs partitions. For major version = 2 see the |partitions|
+     * field.
+     * 
+ * + * repeated .chromeos_update_engine.InstallOperation install_operations = 1; + */ + chromeos_update_engine.UpdateMetadata.InstallOperation getInstallOperations(int index); + /** + *
+     * Only present in major version = 1. List of install operations for the
+     * kernel and rootfs partitions. For major version = 2 see the |partitions|
+     * field.
+     * 
+ * + * repeated .chromeos_update_engine.InstallOperation install_operations = 1; + */ + int getInstallOperationsCount(); + /** + *
+     * Only present in major version = 1. List of install operations for the
+     * kernel and rootfs partitions. For major version = 2 see the |partitions|
+     * field.
+     * 
+ * + * repeated .chromeos_update_engine.InstallOperation install_operations = 1; + */ + java.util.List + getInstallOperationsOrBuilderList(); + /** + *
+     * Only present in major version = 1. List of install operations for the
+     * kernel and rootfs partitions. For major version = 2 see the |partitions|
+     * field.
+     * 
+ * + * repeated .chromeos_update_engine.InstallOperation install_operations = 1; + */ + chromeos_update_engine.UpdateMetadata.InstallOperationOrBuilder getInstallOperationsOrBuilder( + int index); + + /** + * repeated .chromeos_update_engine.InstallOperation kernel_install_operations = 2; + */ + java.util.List + getKernelInstallOperationsList(); + /** + * repeated .chromeos_update_engine.InstallOperation kernel_install_operations = 2; + */ + chromeos_update_engine.UpdateMetadata.InstallOperation getKernelInstallOperations(int index); + /** + * repeated .chromeos_update_engine.InstallOperation kernel_install_operations = 2; + */ + int getKernelInstallOperationsCount(); + /** + * repeated .chromeos_update_engine.InstallOperation kernel_install_operations = 2; + */ + java.util.List + getKernelInstallOperationsOrBuilderList(); + /** + * repeated .chromeos_update_engine.InstallOperation kernel_install_operations = 2; + */ + chromeos_update_engine.UpdateMetadata.InstallOperationOrBuilder getKernelInstallOperationsOrBuilder( + int index); + + /** + *
+     * (At time of writing) usually 4096
+     * 
+ * + * optional uint32 block_size = 3 [default = 4096]; + * @return Whether the blockSize field is set. + */ + boolean hasBlockSize(); + /** + *
+     * (At time of writing) usually 4096
+     * 
+ * + * optional uint32 block_size = 3 [default = 4096]; + * @return The blockSize. + */ + int getBlockSize(); + + /** + *
+     * If signatures are present, the offset into the blobs, generally
+     * tacked onto the end of the file, and the length. We use an offset
+     * rather than a bool to allow for more flexibility in future file formats.
+     * If either is absent, it means signatures aren't supported in this
+     * file.
+     * 
+ * + * optional uint64 signatures_offset = 4; + * @return Whether the signaturesOffset field is set. + */ + boolean hasSignaturesOffset(); + /** + *
+     * If signatures are present, the offset into the blobs, generally
+     * tacked onto the end of the file, and the length. We use an offset
+     * rather than a bool to allow for more flexibility in future file formats.
+     * If either is absent, it means signatures aren't supported in this
+     * file.
+     * 
+ * + * optional uint64 signatures_offset = 4; + * @return The signaturesOffset. + */ + long getSignaturesOffset(); + + /** + * optional uint64 signatures_size = 5; + * @return Whether the signaturesSize field is set. + */ + boolean hasSignaturesSize(); + /** + * optional uint64 signatures_size = 5; + * @return The signaturesSize. + */ + long getSignaturesSize(); + + /** + *
+     * Only present in major version = 1. Partition metadata used to validate the
+     * update. For major version = 2 see the |partitions| field.
+     * 
+ * + * optional .chromeos_update_engine.PartitionInfo old_kernel_info = 6; + * @return Whether the oldKernelInfo field is set. + */ + boolean hasOldKernelInfo(); + /** + *
+     * Only present in major version = 1. Partition metadata used to validate the
+     * update. For major version = 2 see the |partitions| field.
+     * 
+ * + * optional .chromeos_update_engine.PartitionInfo old_kernel_info = 6; + * @return The oldKernelInfo. + */ + chromeos_update_engine.UpdateMetadata.PartitionInfo getOldKernelInfo(); + /** + *
+     * Only present in major version = 1. Partition metadata used to validate the
+     * update. For major version = 2 see the |partitions| field.
+     * 
+ * + * optional .chromeos_update_engine.PartitionInfo old_kernel_info = 6; + */ + chromeos_update_engine.UpdateMetadata.PartitionInfoOrBuilder getOldKernelInfoOrBuilder(); + + /** + * optional .chromeos_update_engine.PartitionInfo new_kernel_info = 7; + * @return Whether the newKernelInfo field is set. + */ + boolean hasNewKernelInfo(); + /** + * optional .chromeos_update_engine.PartitionInfo new_kernel_info = 7; + * @return The newKernelInfo. + */ + chromeos_update_engine.UpdateMetadata.PartitionInfo getNewKernelInfo(); + /** + * optional .chromeos_update_engine.PartitionInfo new_kernel_info = 7; + */ + chromeos_update_engine.UpdateMetadata.PartitionInfoOrBuilder getNewKernelInfoOrBuilder(); + + /** + * optional .chromeos_update_engine.PartitionInfo old_rootfs_info = 8; + * @return Whether the oldRootfsInfo field is set. + */ + boolean hasOldRootfsInfo(); + /** + * optional .chromeos_update_engine.PartitionInfo old_rootfs_info = 8; + * @return The oldRootfsInfo. + */ + chromeos_update_engine.UpdateMetadata.PartitionInfo getOldRootfsInfo(); + /** + * optional .chromeos_update_engine.PartitionInfo old_rootfs_info = 8; + */ + chromeos_update_engine.UpdateMetadata.PartitionInfoOrBuilder getOldRootfsInfoOrBuilder(); + + /** + * optional .chromeos_update_engine.PartitionInfo new_rootfs_info = 9; + * @return Whether the newRootfsInfo field is set. + */ + boolean hasNewRootfsInfo(); + /** + * optional .chromeos_update_engine.PartitionInfo new_rootfs_info = 9; + * @return The newRootfsInfo. + */ + chromeos_update_engine.UpdateMetadata.PartitionInfo getNewRootfsInfo(); + /** + * optional .chromeos_update_engine.PartitionInfo new_rootfs_info = 9; + */ + chromeos_update_engine.UpdateMetadata.PartitionInfoOrBuilder getNewRootfsInfoOrBuilder(); + + /** + *
+     * old_image_info will only be present for delta images.
+     * 
+ * + * optional .chromeos_update_engine.ImageInfo old_image_info = 10; + * @return Whether the oldImageInfo field is set. + */ + boolean hasOldImageInfo(); + /** + *
+     * old_image_info will only be present for delta images.
+     * 
+ * + * optional .chromeos_update_engine.ImageInfo old_image_info = 10; + * @return The oldImageInfo. + */ + chromeos_update_engine.UpdateMetadata.ImageInfo getOldImageInfo(); + /** + *
+     * old_image_info will only be present for delta images.
+     * 
+ * + * optional .chromeos_update_engine.ImageInfo old_image_info = 10; + */ + chromeos_update_engine.UpdateMetadata.ImageInfoOrBuilder getOldImageInfoOrBuilder(); + + /** + * optional .chromeos_update_engine.ImageInfo new_image_info = 11; + * @return Whether the newImageInfo field is set. + */ + boolean hasNewImageInfo(); + /** + * optional .chromeos_update_engine.ImageInfo new_image_info = 11; + * @return The newImageInfo. + */ + chromeos_update_engine.UpdateMetadata.ImageInfo getNewImageInfo(); + /** + * optional .chromeos_update_engine.ImageInfo new_image_info = 11; + */ + chromeos_update_engine.UpdateMetadata.ImageInfoOrBuilder getNewImageInfoOrBuilder(); + + /** + *
+     * The minor version, also referred as "delta version", of the payload.
+     * Minor version 0 is full payload, everything else is delta payload.
+     * 
+ * + * optional uint32 minor_version = 12 [default = 0]; + * @return Whether the minorVersion field is set. + */ + boolean hasMinorVersion(); + /** + *
+     * The minor version, also referred as "delta version", of the payload.
+     * Minor version 0 is full payload, everything else is delta payload.
+     * 
+ * + * optional uint32 minor_version = 12 [default = 0]; + * @return The minorVersion. + */ + int getMinorVersion(); + + /** + *
+     * Only present in major version >= 2. List of partitions that will be
+     * updated, in the order they will be updated. This field replaces the
+     * |install_operations|, |kernel_install_operations| and the
+     * |{old,new}_{kernel,rootfs}_info| fields used in major version = 1. This
+     * array can have more than two partitions if needed, and they are identified
+     * by the partition name.
+     * 
+ * + * repeated .chromeos_update_engine.PartitionUpdate partitions = 13; + */ + java.util.List + getPartitionsList(); + /** + *
+     * Only present in major version >= 2. List of partitions that will be
+     * updated, in the order they will be updated. This field replaces the
+     * |install_operations|, |kernel_install_operations| and the
+     * |{old,new}_{kernel,rootfs}_info| fields used in major version = 1. This
+     * array can have more than two partitions if needed, and they are identified
+     * by the partition name.
+     * 
+ * + * repeated .chromeos_update_engine.PartitionUpdate partitions = 13; + */ + chromeos_update_engine.UpdateMetadata.PartitionUpdate getPartitions(int index); + /** + *
+     * Only present in major version >= 2. List of partitions that will be
+     * updated, in the order they will be updated. This field replaces the
+     * |install_operations|, |kernel_install_operations| and the
+     * |{old,new}_{kernel,rootfs}_info| fields used in major version = 1. This
+     * array can have more than two partitions if needed, and they are identified
+     * by the partition name.
+     * 
+ * + * repeated .chromeos_update_engine.PartitionUpdate partitions = 13; + */ + int getPartitionsCount(); + /** + *
+     * Only present in major version >= 2. List of partitions that will be
+     * updated, in the order they will be updated. This field replaces the
+     * |install_operations|, |kernel_install_operations| and the
+     * |{old,new}_{kernel,rootfs}_info| fields used in major version = 1. This
+     * array can have more than two partitions if needed, and they are identified
+     * by the partition name.
+     * 
+ * + * repeated .chromeos_update_engine.PartitionUpdate partitions = 13; + */ + java.util.List + getPartitionsOrBuilderList(); + /** + *
+     * Only present in major version >= 2. List of partitions that will be
+     * updated, in the order they will be updated. This field replaces the
+     * |install_operations|, |kernel_install_operations| and the
+     * |{old,new}_{kernel,rootfs}_info| fields used in major version = 1. This
+     * array can have more than two partitions if needed, and they are identified
+     * by the partition name.
+     * 
+ * + * repeated .chromeos_update_engine.PartitionUpdate partitions = 13; + */ + chromeos_update_engine.UpdateMetadata.PartitionUpdateOrBuilder getPartitionsOrBuilder( + int index); + + /** + *
+     * The maximum timestamp of the OS allowed to apply this payload.
+     * Can be used to prevent downgrading the OS.
+     * 
+ * + * optional int64 max_timestamp = 14; + * @return Whether the maxTimestamp field is set. + */ + boolean hasMaxTimestamp(); + /** + *
+     * The maximum timestamp of the OS allowed to apply this payload.
+     * Can be used to prevent downgrading the OS.
+     * 
+ * + * optional int64 max_timestamp = 14; + * @return The maxTimestamp. + */ + long getMaxTimestamp(); + + /** + *
+     * Metadata related to all dynamic partitions.
+     * 
+ * + * optional .chromeos_update_engine.DynamicPartitionMetadata dynamic_partition_metadata = 15; + * @return Whether the dynamicPartitionMetadata field is set. + */ + boolean hasDynamicPartitionMetadata(); + /** + *
+     * Metadata related to all dynamic partitions.
+     * 
+ * + * optional .chromeos_update_engine.DynamicPartitionMetadata dynamic_partition_metadata = 15; + * @return The dynamicPartitionMetadata. + */ + chromeos_update_engine.UpdateMetadata.DynamicPartitionMetadata getDynamicPartitionMetadata(); + /** + *
+     * Metadata related to all dynamic partitions.
+     * 
+ * + * optional .chromeos_update_engine.DynamicPartitionMetadata dynamic_partition_metadata = 15; + */ + chromeos_update_engine.UpdateMetadata.DynamicPartitionMetadataOrBuilder getDynamicPartitionMetadataOrBuilder(); + + /** + *
+     * If the payload only updates a subset of partitions on the device.
+     * 
+ * + * optional bool partial_update = 16; + * @return Whether the partialUpdate field is set. + */ + boolean hasPartialUpdate(); + /** + *
+     * If the payload only updates a subset of partitions on the device.
+     * 
+ * + * optional bool partial_update = 16; + * @return The partialUpdate. + */ + boolean getPartialUpdate(); + } + /** + * Protobuf type {@code chromeos_update_engine.DeltaArchiveManifest} + */ + public static final class DeltaArchiveManifest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:chromeos_update_engine.DeltaArchiveManifest) + DeltaArchiveManifestOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeltaArchiveManifest.newBuilder() to construct. + private DeltaArchiveManifest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private DeltaArchiveManifest() { + installOperations_ = java.util.Collections.emptyList(); + kernelInstallOperations_ = java.util.Collections.emptyList(); + blockSize_ = 4096; + partitions_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new DeltaArchiveManifest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private DeltaArchiveManifest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + installOperations_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + installOperations_.add( + input.readMessage(chromeos_update_engine.UpdateMetadata.InstallOperation.PARSER, extensionRegistry)); + break; + } + case 18: { + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + kernelInstallOperations_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000002; + } + kernelInstallOperations_.add( + input.readMessage(chromeos_update_engine.UpdateMetadata.InstallOperation.PARSER, extensionRegistry)); + break; + } + case 24: { + bitField0_ |= 0x00000001; + blockSize_ = input.readUInt32(); + break; + } + case 32: { + bitField0_ |= 0x00000002; + signaturesOffset_ = input.readUInt64(); + break; + } + case 40: { + bitField0_ |= 0x00000004; + signaturesSize_ = input.readUInt64(); + break; + } + case 50: { + chromeos_update_engine.UpdateMetadata.PartitionInfo.Builder subBuilder = null; + if (((bitField0_ & 0x00000008) != 0)) { + subBuilder = oldKernelInfo_.toBuilder(); + } + oldKernelInfo_ = input.readMessage(chromeos_update_engine.UpdateMetadata.PartitionInfo.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(oldKernelInfo_); + oldKernelInfo_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00000008; + break; + } + case 58: { + chromeos_update_engine.UpdateMetadata.PartitionInfo.Builder subBuilder = null; + if (((bitField0_ & 0x00000010) != 0)) { + subBuilder = newKernelInfo_.toBuilder(); + } + newKernelInfo_ = input.readMessage(chromeos_update_engine.UpdateMetadata.PartitionInfo.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(newKernelInfo_); + newKernelInfo_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00000010; + break; + } + case 66: { + chromeos_update_engine.UpdateMetadata.PartitionInfo.Builder subBuilder = null; + if (((bitField0_ & 0x00000020) != 0)) { + subBuilder = oldRootfsInfo_.toBuilder(); + } + oldRootfsInfo_ = input.readMessage(chromeos_update_engine.UpdateMetadata.PartitionInfo.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(oldRootfsInfo_); + oldRootfsInfo_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00000020; + break; + } + case 74: { + chromeos_update_engine.UpdateMetadata.PartitionInfo.Builder subBuilder = null; + if (((bitField0_ & 0x00000040) != 0)) { + subBuilder = newRootfsInfo_.toBuilder(); + } + newRootfsInfo_ = input.readMessage(chromeos_update_engine.UpdateMetadata.PartitionInfo.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(newRootfsInfo_); + newRootfsInfo_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00000040; + break; + } + case 82: { + chromeos_update_engine.UpdateMetadata.ImageInfo.Builder subBuilder = null; + if (((bitField0_ & 0x00000080) != 0)) { + subBuilder = oldImageInfo_.toBuilder(); + } + oldImageInfo_ = input.readMessage(chromeos_update_engine.UpdateMetadata.ImageInfo.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(oldImageInfo_); + oldImageInfo_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00000080; + break; + } + case 90: { + chromeos_update_engine.UpdateMetadata.ImageInfo.Builder subBuilder = null; + if (((bitField0_ & 0x00000100) != 0)) { + subBuilder = newImageInfo_.toBuilder(); + } + newImageInfo_ = input.readMessage(chromeos_update_engine.UpdateMetadata.ImageInfo.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(newImageInfo_); + newImageInfo_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00000100; + break; + } + case 96: { + bitField0_ |= 0x00000200; + minorVersion_ = input.readUInt32(); + break; + } + case 106: { + if (!((mutable_bitField0_ & 0x00001000) != 0)) { + partitions_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00001000; + } + partitions_.add( + input.readMessage(chromeos_update_engine.UpdateMetadata.PartitionUpdate.PARSER, extensionRegistry)); + break; + } + case 112: { + bitField0_ |= 0x00000400; + maxTimestamp_ = input.readInt64(); + break; + } + case 122: { + chromeos_update_engine.UpdateMetadata.DynamicPartitionMetadata.Builder subBuilder = null; + if (((bitField0_ & 0x00000800) != 0)) { + subBuilder = dynamicPartitionMetadata_.toBuilder(); + } + dynamicPartitionMetadata_ = input.readMessage(chromeos_update_engine.UpdateMetadata.DynamicPartitionMetadata.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(dynamicPartitionMetadata_); + dynamicPartitionMetadata_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00000800; + break; + } + case 128: { + bitField0_ |= 0x00001000; + partialUpdate_ = input.readBool(); + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + installOperations_ = java.util.Collections.unmodifiableList(installOperations_); + } + if (((mutable_bitField0_ & 0x00000002) != 0)) { + kernelInstallOperations_ = java.util.Collections.unmodifiableList(kernelInstallOperations_); + } + if (((mutable_bitField0_ & 0x00001000) != 0)) { + partitions_ = java.util.Collections.unmodifiableList(partitions_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return chromeos_update_engine.UpdateMetadata.internal_static_chromeos_update_engine_DeltaArchiveManifest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return chromeos_update_engine.UpdateMetadata.internal_static_chromeos_update_engine_DeltaArchiveManifest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + chromeos_update_engine.UpdateMetadata.DeltaArchiveManifest.class, chromeos_update_engine.UpdateMetadata.DeltaArchiveManifest.Builder.class); + } + + private int bitField0_; + public static final int INSTALL_OPERATIONS_FIELD_NUMBER = 1; + private java.util.List installOperations_; + /** + *
+     * Only present in major version = 1. List of install operations for the
+     * kernel and rootfs partitions. For major version = 2 see the |partitions|
+     * field.
+     * 
+ * + * repeated .chromeos_update_engine.InstallOperation install_operations = 1; + */ + @java.lang.Override + public java.util.List getInstallOperationsList() { + return installOperations_; + } + /** + *
+     * Only present in major version = 1. List of install operations for the
+     * kernel and rootfs partitions. For major version = 2 see the |partitions|
+     * field.
+     * 
+ * + * repeated .chromeos_update_engine.InstallOperation install_operations = 1; + */ + @java.lang.Override + public java.util.List + getInstallOperationsOrBuilderList() { + return installOperations_; + } + /** + *
+     * Only present in major version = 1. List of install operations for the
+     * kernel and rootfs partitions. For major version = 2 see the |partitions|
+     * field.
+     * 
+ * + * repeated .chromeos_update_engine.InstallOperation install_operations = 1; + */ + @java.lang.Override + public int getInstallOperationsCount() { + return installOperations_.size(); + } + /** + *
+     * Only present in major version = 1. List of install operations for the
+     * kernel and rootfs partitions. For major version = 2 see the |partitions|
+     * field.
+     * 
+ * + * repeated .chromeos_update_engine.InstallOperation install_operations = 1; + */ + @java.lang.Override + public chromeos_update_engine.UpdateMetadata.InstallOperation getInstallOperations(int index) { + return installOperations_.get(index); + } + /** + *
+     * Only present in major version = 1. List of install operations for the
+     * kernel and rootfs partitions. For major version = 2 see the |partitions|
+     * field.
+     * 
+ * + * repeated .chromeos_update_engine.InstallOperation install_operations = 1; + */ + @java.lang.Override + public chromeos_update_engine.UpdateMetadata.InstallOperationOrBuilder getInstallOperationsOrBuilder( + int index) { + return installOperations_.get(index); + } + + public static final int KERNEL_INSTALL_OPERATIONS_FIELD_NUMBER = 2; + private java.util.List kernelInstallOperations_; + /** + * repeated .chromeos_update_engine.InstallOperation kernel_install_operations = 2; + */ + @java.lang.Override + public java.util.List getKernelInstallOperationsList() { + return kernelInstallOperations_; + } + /** + * repeated .chromeos_update_engine.InstallOperation kernel_install_operations = 2; + */ + @java.lang.Override + public java.util.List + getKernelInstallOperationsOrBuilderList() { + return kernelInstallOperations_; + } + /** + * repeated .chromeos_update_engine.InstallOperation kernel_install_operations = 2; + */ + @java.lang.Override + public int getKernelInstallOperationsCount() { + return kernelInstallOperations_.size(); + } + /** + * repeated .chromeos_update_engine.InstallOperation kernel_install_operations = 2; + */ + @java.lang.Override + public chromeos_update_engine.UpdateMetadata.InstallOperation getKernelInstallOperations(int index) { + return kernelInstallOperations_.get(index); + } + /** + * repeated .chromeos_update_engine.InstallOperation kernel_install_operations = 2; + */ + @java.lang.Override + public chromeos_update_engine.UpdateMetadata.InstallOperationOrBuilder getKernelInstallOperationsOrBuilder( + int index) { + return kernelInstallOperations_.get(index); + } + + public static final int BLOCK_SIZE_FIELD_NUMBER = 3; + private int blockSize_; + /** + *
+     * (At time of writing) usually 4096
+     * 
+ * + * optional uint32 block_size = 3 [default = 4096]; + * @return Whether the blockSize field is set. + */ + @java.lang.Override + public boolean hasBlockSize() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + *
+     * (At time of writing) usually 4096
+     * 
+ * + * optional uint32 block_size = 3 [default = 4096]; + * @return The blockSize. + */ + @java.lang.Override + public int getBlockSize() { + return blockSize_; + } + + public static final int SIGNATURES_OFFSET_FIELD_NUMBER = 4; + private long signaturesOffset_; + /** + *
+     * If signatures are present, the offset into the blobs, generally
+     * tacked onto the end of the file, and the length. We use an offset
+     * rather than a bool to allow for more flexibility in future file formats.
+     * If either is absent, it means signatures aren't supported in this
+     * file.
+     * 
+ * + * optional uint64 signatures_offset = 4; + * @return Whether the signaturesOffset field is set. + */ + @java.lang.Override + public boolean hasSignaturesOffset() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + *
+     * If signatures are present, the offset into the blobs, generally
+     * tacked onto the end of the file, and the length. We use an offset
+     * rather than a bool to allow for more flexibility in future file formats.
+     * If either is absent, it means signatures aren't supported in this
+     * file.
+     * 
+ * + * optional uint64 signatures_offset = 4; + * @return The signaturesOffset. + */ + @java.lang.Override + public long getSignaturesOffset() { + return signaturesOffset_; + } + + public static final int SIGNATURES_SIZE_FIELD_NUMBER = 5; + private long signaturesSize_; + /** + * optional uint64 signatures_size = 5; + * @return Whether the signaturesSize field is set. + */ + @java.lang.Override + public boolean hasSignaturesSize() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * optional uint64 signatures_size = 5; + * @return The signaturesSize. + */ + @java.lang.Override + public long getSignaturesSize() { + return signaturesSize_; + } + + public static final int OLD_KERNEL_INFO_FIELD_NUMBER = 6; + private chromeos_update_engine.UpdateMetadata.PartitionInfo oldKernelInfo_; + /** + *
+     * Only present in major version = 1. Partition metadata used to validate the
+     * update. For major version = 2 see the |partitions| field.
+     * 
+ * + * optional .chromeos_update_engine.PartitionInfo old_kernel_info = 6; + * @return Whether the oldKernelInfo field is set. + */ + @java.lang.Override + public boolean hasOldKernelInfo() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + *
+     * Only present in major version = 1. Partition metadata used to validate the
+     * update. For major version = 2 see the |partitions| field.
+     * 
+ * + * optional .chromeos_update_engine.PartitionInfo old_kernel_info = 6; + * @return The oldKernelInfo. + */ + @java.lang.Override + public chromeos_update_engine.UpdateMetadata.PartitionInfo getOldKernelInfo() { + return oldKernelInfo_ == null ? chromeos_update_engine.UpdateMetadata.PartitionInfo.getDefaultInstance() : oldKernelInfo_; + } + /** + *
+     * Only present in major version = 1. Partition metadata used to validate the
+     * update. For major version = 2 see the |partitions| field.
+     * 
+ * + * optional .chromeos_update_engine.PartitionInfo old_kernel_info = 6; + */ + @java.lang.Override + public chromeos_update_engine.UpdateMetadata.PartitionInfoOrBuilder getOldKernelInfoOrBuilder() { + return oldKernelInfo_ == null ? chromeos_update_engine.UpdateMetadata.PartitionInfo.getDefaultInstance() : oldKernelInfo_; + } + + public static final int NEW_KERNEL_INFO_FIELD_NUMBER = 7; + private chromeos_update_engine.UpdateMetadata.PartitionInfo newKernelInfo_; + /** + * optional .chromeos_update_engine.PartitionInfo new_kernel_info = 7; + * @return Whether the newKernelInfo field is set. + */ + @java.lang.Override + public boolean hasNewKernelInfo() { + return ((bitField0_ & 0x00000010) != 0); + } + /** + * optional .chromeos_update_engine.PartitionInfo new_kernel_info = 7; + * @return The newKernelInfo. + */ + @java.lang.Override + public chromeos_update_engine.UpdateMetadata.PartitionInfo getNewKernelInfo() { + return newKernelInfo_ == null ? chromeos_update_engine.UpdateMetadata.PartitionInfo.getDefaultInstance() : newKernelInfo_; + } + /** + * optional .chromeos_update_engine.PartitionInfo new_kernel_info = 7; + */ + @java.lang.Override + public chromeos_update_engine.UpdateMetadata.PartitionInfoOrBuilder getNewKernelInfoOrBuilder() { + return newKernelInfo_ == null ? chromeos_update_engine.UpdateMetadata.PartitionInfo.getDefaultInstance() : newKernelInfo_; + } + + public static final int OLD_ROOTFS_INFO_FIELD_NUMBER = 8; + private chromeos_update_engine.UpdateMetadata.PartitionInfo oldRootfsInfo_; + /** + * optional .chromeos_update_engine.PartitionInfo old_rootfs_info = 8; + * @return Whether the oldRootfsInfo field is set. + */ + @java.lang.Override + public boolean hasOldRootfsInfo() { + return ((bitField0_ & 0x00000020) != 0); + } + /** + * optional .chromeos_update_engine.PartitionInfo old_rootfs_info = 8; + * @return The oldRootfsInfo. + */ + @java.lang.Override + public chromeos_update_engine.UpdateMetadata.PartitionInfo getOldRootfsInfo() { + return oldRootfsInfo_ == null ? chromeos_update_engine.UpdateMetadata.PartitionInfo.getDefaultInstance() : oldRootfsInfo_; + } + /** + * optional .chromeos_update_engine.PartitionInfo old_rootfs_info = 8; + */ + @java.lang.Override + public chromeos_update_engine.UpdateMetadata.PartitionInfoOrBuilder getOldRootfsInfoOrBuilder() { + return oldRootfsInfo_ == null ? chromeos_update_engine.UpdateMetadata.PartitionInfo.getDefaultInstance() : oldRootfsInfo_; + } + + public static final int NEW_ROOTFS_INFO_FIELD_NUMBER = 9; + private chromeos_update_engine.UpdateMetadata.PartitionInfo newRootfsInfo_; + /** + * optional .chromeos_update_engine.PartitionInfo new_rootfs_info = 9; + * @return Whether the newRootfsInfo field is set. + */ + @java.lang.Override + public boolean hasNewRootfsInfo() { + return ((bitField0_ & 0x00000040) != 0); + } + /** + * optional .chromeos_update_engine.PartitionInfo new_rootfs_info = 9; + * @return The newRootfsInfo. + */ + @java.lang.Override + public chromeos_update_engine.UpdateMetadata.PartitionInfo getNewRootfsInfo() { + return newRootfsInfo_ == null ? chromeos_update_engine.UpdateMetadata.PartitionInfo.getDefaultInstance() : newRootfsInfo_; + } + /** + * optional .chromeos_update_engine.PartitionInfo new_rootfs_info = 9; + */ + @java.lang.Override + public chromeos_update_engine.UpdateMetadata.PartitionInfoOrBuilder getNewRootfsInfoOrBuilder() { + return newRootfsInfo_ == null ? chromeos_update_engine.UpdateMetadata.PartitionInfo.getDefaultInstance() : newRootfsInfo_; + } + + public static final int OLD_IMAGE_INFO_FIELD_NUMBER = 10; + private chromeos_update_engine.UpdateMetadata.ImageInfo oldImageInfo_; + /** + *
+     * old_image_info will only be present for delta images.
+     * 
+ * + * optional .chromeos_update_engine.ImageInfo old_image_info = 10; + * @return Whether the oldImageInfo field is set. + */ + @java.lang.Override + public boolean hasOldImageInfo() { + return ((bitField0_ & 0x00000080) != 0); + } + /** + *
+     * old_image_info will only be present for delta images.
+     * 
+ * + * optional .chromeos_update_engine.ImageInfo old_image_info = 10; + * @return The oldImageInfo. + */ + @java.lang.Override + public chromeos_update_engine.UpdateMetadata.ImageInfo getOldImageInfo() { + return oldImageInfo_ == null ? chromeos_update_engine.UpdateMetadata.ImageInfo.getDefaultInstance() : oldImageInfo_; + } + /** + *
+     * old_image_info will only be present for delta images.
+     * 
+ * + * optional .chromeos_update_engine.ImageInfo old_image_info = 10; + */ + @java.lang.Override + public chromeos_update_engine.UpdateMetadata.ImageInfoOrBuilder getOldImageInfoOrBuilder() { + return oldImageInfo_ == null ? chromeos_update_engine.UpdateMetadata.ImageInfo.getDefaultInstance() : oldImageInfo_; + } + + public static final int NEW_IMAGE_INFO_FIELD_NUMBER = 11; + private chromeos_update_engine.UpdateMetadata.ImageInfo newImageInfo_; + /** + * optional .chromeos_update_engine.ImageInfo new_image_info = 11; + * @return Whether the newImageInfo field is set. + */ + @java.lang.Override + public boolean hasNewImageInfo() { + return ((bitField0_ & 0x00000100) != 0); + } + /** + * optional .chromeos_update_engine.ImageInfo new_image_info = 11; + * @return The newImageInfo. + */ + @java.lang.Override + public chromeos_update_engine.UpdateMetadata.ImageInfo getNewImageInfo() { + return newImageInfo_ == null ? chromeos_update_engine.UpdateMetadata.ImageInfo.getDefaultInstance() : newImageInfo_; + } + /** + * optional .chromeos_update_engine.ImageInfo new_image_info = 11; + */ + @java.lang.Override + public chromeos_update_engine.UpdateMetadata.ImageInfoOrBuilder getNewImageInfoOrBuilder() { + return newImageInfo_ == null ? chromeos_update_engine.UpdateMetadata.ImageInfo.getDefaultInstance() : newImageInfo_; + } + + public static final int MINOR_VERSION_FIELD_NUMBER = 12; + private int minorVersion_; + /** + *
+     * The minor version, also referred as "delta version", of the payload.
+     * Minor version 0 is full payload, everything else is delta payload.
+     * 
+ * + * optional uint32 minor_version = 12 [default = 0]; + * @return Whether the minorVersion field is set. + */ + @java.lang.Override + public boolean hasMinorVersion() { + return ((bitField0_ & 0x00000200) != 0); + } + /** + *
+     * The minor version, also referred as "delta version", of the payload.
+     * Minor version 0 is full payload, everything else is delta payload.
+     * 
+ * + * optional uint32 minor_version = 12 [default = 0]; + * @return The minorVersion. + */ + @java.lang.Override + public int getMinorVersion() { + return minorVersion_; + } + + public static final int PARTITIONS_FIELD_NUMBER = 13; + private java.util.List partitions_; + /** + *
+     * Only present in major version >= 2. List of partitions that will be
+     * updated, in the order they will be updated. This field replaces the
+     * |install_operations|, |kernel_install_operations| and the
+     * |{old,new}_{kernel,rootfs}_info| fields used in major version = 1. This
+     * array can have more than two partitions if needed, and they are identified
+     * by the partition name.
+     * 
+ * + * repeated .chromeos_update_engine.PartitionUpdate partitions = 13; + */ + @java.lang.Override + public java.util.List getPartitionsList() { + return partitions_; + } + /** + *
+     * Only present in major version >= 2. List of partitions that will be
+     * updated, in the order they will be updated. This field replaces the
+     * |install_operations|, |kernel_install_operations| and the
+     * |{old,new}_{kernel,rootfs}_info| fields used in major version = 1. This
+     * array can have more than two partitions if needed, and they are identified
+     * by the partition name.
+     * 
+ * + * repeated .chromeos_update_engine.PartitionUpdate partitions = 13; + */ + @java.lang.Override + public java.util.List + getPartitionsOrBuilderList() { + return partitions_; + } + /** + *
+     * Only present in major version >= 2. List of partitions that will be
+     * updated, in the order they will be updated. This field replaces the
+     * |install_operations|, |kernel_install_operations| and the
+     * |{old,new}_{kernel,rootfs}_info| fields used in major version = 1. This
+     * array can have more than two partitions if needed, and they are identified
+     * by the partition name.
+     * 
+ * + * repeated .chromeos_update_engine.PartitionUpdate partitions = 13; + */ + @java.lang.Override + public int getPartitionsCount() { + return partitions_.size(); + } + /** + *
+     * Only present in major version >= 2. List of partitions that will be
+     * updated, in the order they will be updated. This field replaces the
+     * |install_operations|, |kernel_install_operations| and the
+     * |{old,new}_{kernel,rootfs}_info| fields used in major version = 1. This
+     * array can have more than two partitions if needed, and they are identified
+     * by the partition name.
+     * 
+ * + * repeated .chromeos_update_engine.PartitionUpdate partitions = 13; + */ + @java.lang.Override + public chromeos_update_engine.UpdateMetadata.PartitionUpdate getPartitions(int index) { + return partitions_.get(index); + } + /** + *
+     * Only present in major version >= 2. List of partitions that will be
+     * updated, in the order they will be updated. This field replaces the
+     * |install_operations|, |kernel_install_operations| and the
+     * |{old,new}_{kernel,rootfs}_info| fields used in major version = 1. This
+     * array can have more than two partitions if needed, and they are identified
+     * by the partition name.
+     * 
+ * + * repeated .chromeos_update_engine.PartitionUpdate partitions = 13; + */ + @java.lang.Override + public chromeos_update_engine.UpdateMetadata.PartitionUpdateOrBuilder getPartitionsOrBuilder( + int index) { + return partitions_.get(index); + } + + public static final int MAX_TIMESTAMP_FIELD_NUMBER = 14; + private long maxTimestamp_; + /** + *
+     * The maximum timestamp of the OS allowed to apply this payload.
+     * Can be used to prevent downgrading the OS.
+     * 
+ * + * optional int64 max_timestamp = 14; + * @return Whether the maxTimestamp field is set. + */ + @java.lang.Override + public boolean hasMaxTimestamp() { + return ((bitField0_ & 0x00000400) != 0); + } + /** + *
+     * The maximum timestamp of the OS allowed to apply this payload.
+     * Can be used to prevent downgrading the OS.
+     * 
+ * + * optional int64 max_timestamp = 14; + * @return The maxTimestamp. + */ + @java.lang.Override + public long getMaxTimestamp() { + return maxTimestamp_; + } + + public static final int DYNAMIC_PARTITION_METADATA_FIELD_NUMBER = 15; + private chromeos_update_engine.UpdateMetadata.DynamicPartitionMetadata dynamicPartitionMetadata_; + /** + *
+     * Metadata related to all dynamic partitions.
+     * 
+ * + * optional .chromeos_update_engine.DynamicPartitionMetadata dynamic_partition_metadata = 15; + * @return Whether the dynamicPartitionMetadata field is set. + */ + @java.lang.Override + public boolean hasDynamicPartitionMetadata() { + return ((bitField0_ & 0x00000800) != 0); + } + /** + *
+     * Metadata related to all dynamic partitions.
+     * 
+ * + * optional .chromeos_update_engine.DynamicPartitionMetadata dynamic_partition_metadata = 15; + * @return The dynamicPartitionMetadata. + */ + @java.lang.Override + public chromeos_update_engine.UpdateMetadata.DynamicPartitionMetadata getDynamicPartitionMetadata() { + return dynamicPartitionMetadata_ == null ? chromeos_update_engine.UpdateMetadata.DynamicPartitionMetadata.getDefaultInstance() : dynamicPartitionMetadata_; + } + /** + *
+     * Metadata related to all dynamic partitions.
+     * 
+ * + * optional .chromeos_update_engine.DynamicPartitionMetadata dynamic_partition_metadata = 15; + */ + @java.lang.Override + public chromeos_update_engine.UpdateMetadata.DynamicPartitionMetadataOrBuilder getDynamicPartitionMetadataOrBuilder() { + return dynamicPartitionMetadata_ == null ? chromeos_update_engine.UpdateMetadata.DynamicPartitionMetadata.getDefaultInstance() : dynamicPartitionMetadata_; + } + + public static final int PARTIAL_UPDATE_FIELD_NUMBER = 16; + private boolean partialUpdate_; + /** + *
+     * If the payload only updates a subset of partitions on the device.
+     * 
+ * + * optional bool partial_update = 16; + * @return Whether the partialUpdate field is set. + */ + @java.lang.Override + public boolean hasPartialUpdate() { + return ((bitField0_ & 0x00001000) != 0); + } + /** + *
+     * If the payload only updates a subset of partitions on the device.
+     * 
+ * + * optional bool partial_update = 16; + * @return The partialUpdate. + */ + @java.lang.Override + public boolean getPartialUpdate() { + return partialUpdate_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + for (int i = 0; i < getInstallOperationsCount(); i++) { + if (!getInstallOperations(i).isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + for (int i = 0; i < getKernelInstallOperationsCount(); i++) { + if (!getKernelInstallOperations(i).isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + for (int i = 0; i < getPartitionsCount(); i++) { + if (!getPartitions(i).isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + if (hasDynamicPartitionMetadata()) { + if (!getDynamicPartitionMetadata().isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + for (int i = 0; i < installOperations_.size(); i++) { + output.writeMessage(1, installOperations_.get(i)); + } + for (int i = 0; i < kernelInstallOperations_.size(); i++) { + output.writeMessage(2, kernelInstallOperations_.get(i)); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeUInt32(3, blockSize_); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeUInt64(4, signaturesOffset_); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeUInt64(5, signaturesSize_); + } + if (((bitField0_ & 0x00000008) != 0)) { + output.writeMessage(6, getOldKernelInfo()); + } + if (((bitField0_ & 0x00000010) != 0)) { + output.writeMessage(7, getNewKernelInfo()); + } + if (((bitField0_ & 0x00000020) != 0)) { + output.writeMessage(8, getOldRootfsInfo()); + } + if (((bitField0_ & 0x00000040) != 0)) { + output.writeMessage(9, getNewRootfsInfo()); + } + if (((bitField0_ & 0x00000080) != 0)) { + output.writeMessage(10, getOldImageInfo()); + } + if (((bitField0_ & 0x00000100) != 0)) { + output.writeMessage(11, getNewImageInfo()); + } + if (((bitField0_ & 0x00000200) != 0)) { + output.writeUInt32(12, minorVersion_); + } + for (int i = 0; i < partitions_.size(); i++) { + output.writeMessage(13, partitions_.get(i)); + } + if (((bitField0_ & 0x00000400) != 0)) { + output.writeInt64(14, maxTimestamp_); + } + if (((bitField0_ & 0x00000800) != 0)) { + output.writeMessage(15, getDynamicPartitionMetadata()); + } + if (((bitField0_ & 0x00001000) != 0)) { + output.writeBool(16, partialUpdate_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < installOperations_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, installOperations_.get(i)); + } + for (int i = 0; i < kernelInstallOperations_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, kernelInstallOperations_.get(i)); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(3, blockSize_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(4, signaturesOffset_); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(5, signaturesSize_); + } + if (((bitField0_ & 0x00000008) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(6, getOldKernelInfo()); + } + if (((bitField0_ & 0x00000010) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(7, getNewKernelInfo()); + } + if (((bitField0_ & 0x00000020) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(8, getOldRootfsInfo()); + } + if (((bitField0_ & 0x00000040) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(9, getNewRootfsInfo()); + } + if (((bitField0_ & 0x00000080) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(10, getOldImageInfo()); + } + if (((bitField0_ & 0x00000100) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(11, getNewImageInfo()); + } + if (((bitField0_ & 0x00000200) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(12, minorVersion_); + } + for (int i = 0; i < partitions_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(13, partitions_.get(i)); + } + if (((bitField0_ & 0x00000400) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(14, maxTimestamp_); + } + if (((bitField0_ & 0x00000800) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(15, getDynamicPartitionMetadata()); + } + if (((bitField0_ & 0x00001000) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(16, partialUpdate_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof chromeos_update_engine.UpdateMetadata.DeltaArchiveManifest)) { + return super.equals(obj); + } + chromeos_update_engine.UpdateMetadata.DeltaArchiveManifest other = (chromeos_update_engine.UpdateMetadata.DeltaArchiveManifest) obj; + + if (!getInstallOperationsList() + .equals(other.getInstallOperationsList())) return false; + if (!getKernelInstallOperationsList() + .equals(other.getKernelInstallOperationsList())) return false; + if (hasBlockSize() != other.hasBlockSize()) return false; + if (hasBlockSize()) { + if (getBlockSize() + != other.getBlockSize()) return false; + } + if (hasSignaturesOffset() != other.hasSignaturesOffset()) return false; + if (hasSignaturesOffset()) { + if (getSignaturesOffset() + != other.getSignaturesOffset()) return false; + } + if (hasSignaturesSize() != other.hasSignaturesSize()) return false; + if (hasSignaturesSize()) { + if (getSignaturesSize() + != other.getSignaturesSize()) return false; + } + if (hasOldKernelInfo() != other.hasOldKernelInfo()) return false; + if (hasOldKernelInfo()) { + if (!getOldKernelInfo() + .equals(other.getOldKernelInfo())) return false; + } + if (hasNewKernelInfo() != other.hasNewKernelInfo()) return false; + if (hasNewKernelInfo()) { + if (!getNewKernelInfo() + .equals(other.getNewKernelInfo())) return false; + } + if (hasOldRootfsInfo() != other.hasOldRootfsInfo()) return false; + if (hasOldRootfsInfo()) { + if (!getOldRootfsInfo() + .equals(other.getOldRootfsInfo())) return false; + } + if (hasNewRootfsInfo() != other.hasNewRootfsInfo()) return false; + if (hasNewRootfsInfo()) { + if (!getNewRootfsInfo() + .equals(other.getNewRootfsInfo())) return false; + } + if (hasOldImageInfo() != other.hasOldImageInfo()) return false; + if (hasOldImageInfo()) { + if (!getOldImageInfo() + .equals(other.getOldImageInfo())) return false; + } + if (hasNewImageInfo() != other.hasNewImageInfo()) return false; + if (hasNewImageInfo()) { + if (!getNewImageInfo() + .equals(other.getNewImageInfo())) return false; + } + if (hasMinorVersion() != other.hasMinorVersion()) return false; + if (hasMinorVersion()) { + if (getMinorVersion() + != other.getMinorVersion()) return false; + } + if (!getPartitionsList() + .equals(other.getPartitionsList())) return false; + if (hasMaxTimestamp() != other.hasMaxTimestamp()) return false; + if (hasMaxTimestamp()) { + if (getMaxTimestamp() + != other.getMaxTimestamp()) return false; + } + if (hasDynamicPartitionMetadata() != other.hasDynamicPartitionMetadata()) return false; + if (hasDynamicPartitionMetadata()) { + if (!getDynamicPartitionMetadata() + .equals(other.getDynamicPartitionMetadata())) return false; + } + if (hasPartialUpdate() != other.hasPartialUpdate()) return false; + if (hasPartialUpdate()) { + if (getPartialUpdate() + != other.getPartialUpdate()) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getInstallOperationsCount() > 0) { + hash = (37 * hash) + INSTALL_OPERATIONS_FIELD_NUMBER; + hash = (53 * hash) + getInstallOperationsList().hashCode(); + } + if (getKernelInstallOperationsCount() > 0) { + hash = (37 * hash) + KERNEL_INSTALL_OPERATIONS_FIELD_NUMBER; + hash = (53 * hash) + getKernelInstallOperationsList().hashCode(); + } + if (hasBlockSize()) { + hash = (37 * hash) + BLOCK_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getBlockSize(); + } + if (hasSignaturesOffset()) { + hash = (37 * hash) + SIGNATURES_OFFSET_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getSignaturesOffset()); + } + if (hasSignaturesSize()) { + hash = (37 * hash) + SIGNATURES_SIZE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getSignaturesSize()); + } + if (hasOldKernelInfo()) { + hash = (37 * hash) + OLD_KERNEL_INFO_FIELD_NUMBER; + hash = (53 * hash) + getOldKernelInfo().hashCode(); + } + if (hasNewKernelInfo()) { + hash = (37 * hash) + NEW_KERNEL_INFO_FIELD_NUMBER; + hash = (53 * hash) + getNewKernelInfo().hashCode(); + } + if (hasOldRootfsInfo()) { + hash = (37 * hash) + OLD_ROOTFS_INFO_FIELD_NUMBER; + hash = (53 * hash) + getOldRootfsInfo().hashCode(); + } + if (hasNewRootfsInfo()) { + hash = (37 * hash) + NEW_ROOTFS_INFO_FIELD_NUMBER; + hash = (53 * hash) + getNewRootfsInfo().hashCode(); + } + if (hasOldImageInfo()) { + hash = (37 * hash) + OLD_IMAGE_INFO_FIELD_NUMBER; + hash = (53 * hash) + getOldImageInfo().hashCode(); + } + if (hasNewImageInfo()) { + hash = (37 * hash) + NEW_IMAGE_INFO_FIELD_NUMBER; + hash = (53 * hash) + getNewImageInfo().hashCode(); + } + if (hasMinorVersion()) { + hash = (37 * hash) + MINOR_VERSION_FIELD_NUMBER; + hash = (53 * hash) + getMinorVersion(); + } + if (getPartitionsCount() > 0) { + hash = (37 * hash) + PARTITIONS_FIELD_NUMBER; + hash = (53 * hash) + getPartitionsList().hashCode(); + } + if (hasMaxTimestamp()) { + hash = (37 * hash) + MAX_TIMESTAMP_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getMaxTimestamp()); + } + if (hasDynamicPartitionMetadata()) { + hash = (37 * hash) + DYNAMIC_PARTITION_METADATA_FIELD_NUMBER; + hash = (53 * hash) + getDynamicPartitionMetadata().hashCode(); + } + if (hasPartialUpdate()) { + hash = (37 * hash) + PARTIAL_UPDATE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getPartialUpdate()); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static chromeos_update_engine.UpdateMetadata.DeltaArchiveManifest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static chromeos_update_engine.UpdateMetadata.DeltaArchiveManifest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static chromeos_update_engine.UpdateMetadata.DeltaArchiveManifest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static chromeos_update_engine.UpdateMetadata.DeltaArchiveManifest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static chromeos_update_engine.UpdateMetadata.DeltaArchiveManifest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static chromeos_update_engine.UpdateMetadata.DeltaArchiveManifest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static chromeos_update_engine.UpdateMetadata.DeltaArchiveManifest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static chromeos_update_engine.UpdateMetadata.DeltaArchiveManifest parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static chromeos_update_engine.UpdateMetadata.DeltaArchiveManifest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static chromeos_update_engine.UpdateMetadata.DeltaArchiveManifest parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static chromeos_update_engine.UpdateMetadata.DeltaArchiveManifest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static chromeos_update_engine.UpdateMetadata.DeltaArchiveManifest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(chromeos_update_engine.UpdateMetadata.DeltaArchiveManifest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code chromeos_update_engine.DeltaArchiveManifest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:chromeos_update_engine.DeltaArchiveManifest) + chromeos_update_engine.UpdateMetadata.DeltaArchiveManifestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return chromeos_update_engine.UpdateMetadata.internal_static_chromeos_update_engine_DeltaArchiveManifest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return chromeos_update_engine.UpdateMetadata.internal_static_chromeos_update_engine_DeltaArchiveManifest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + chromeos_update_engine.UpdateMetadata.DeltaArchiveManifest.class, chromeos_update_engine.UpdateMetadata.DeltaArchiveManifest.Builder.class); + } + + // Construct using chromeos_update_engine.UpdateMetadata.DeltaArchiveManifest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getInstallOperationsFieldBuilder(); + getKernelInstallOperationsFieldBuilder(); + getOldKernelInfoFieldBuilder(); + getNewKernelInfoFieldBuilder(); + getOldRootfsInfoFieldBuilder(); + getNewRootfsInfoFieldBuilder(); + getOldImageInfoFieldBuilder(); + getNewImageInfoFieldBuilder(); + getPartitionsFieldBuilder(); + getDynamicPartitionMetadataFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (installOperationsBuilder_ == null) { + installOperations_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + installOperationsBuilder_.clear(); + } + if (kernelInstallOperationsBuilder_ == null) { + kernelInstallOperations_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + } else { + kernelInstallOperationsBuilder_.clear(); + } + blockSize_ = 4096; + bitField0_ = (bitField0_ & ~0x00000004); + signaturesOffset_ = 0L; + bitField0_ = (bitField0_ & ~0x00000008); + signaturesSize_ = 0L; + bitField0_ = (bitField0_ & ~0x00000010); + if (oldKernelInfoBuilder_ == null) { + oldKernelInfo_ = null; + } else { + oldKernelInfoBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000020); + if (newKernelInfoBuilder_ == null) { + newKernelInfo_ = null; + } else { + newKernelInfoBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000040); + if (oldRootfsInfoBuilder_ == null) { + oldRootfsInfo_ = null; + } else { + oldRootfsInfoBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000080); + if (newRootfsInfoBuilder_ == null) { + newRootfsInfo_ = null; + } else { + newRootfsInfoBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000100); + if (oldImageInfoBuilder_ == null) { + oldImageInfo_ = null; + } else { + oldImageInfoBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000200); + if (newImageInfoBuilder_ == null) { + newImageInfo_ = null; + } else { + newImageInfoBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000400); + minorVersion_ = 0; + bitField0_ = (bitField0_ & ~0x00000800); + if (partitionsBuilder_ == null) { + partitions_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00001000); + } else { + partitionsBuilder_.clear(); + } + maxTimestamp_ = 0L; + bitField0_ = (bitField0_ & ~0x00002000); + if (dynamicPartitionMetadataBuilder_ == null) { + dynamicPartitionMetadata_ = null; + } else { + dynamicPartitionMetadataBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00004000); + partialUpdate_ = false; + bitField0_ = (bitField0_ & ~0x00008000); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return chromeos_update_engine.UpdateMetadata.internal_static_chromeos_update_engine_DeltaArchiveManifest_descriptor; + } + + @java.lang.Override + public chromeos_update_engine.UpdateMetadata.DeltaArchiveManifest getDefaultInstanceForType() { + return chromeos_update_engine.UpdateMetadata.DeltaArchiveManifest.getDefaultInstance(); + } + + @java.lang.Override + public chromeos_update_engine.UpdateMetadata.DeltaArchiveManifest build() { + chromeos_update_engine.UpdateMetadata.DeltaArchiveManifest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public chromeos_update_engine.UpdateMetadata.DeltaArchiveManifest buildPartial() { + chromeos_update_engine.UpdateMetadata.DeltaArchiveManifest result = new chromeos_update_engine.UpdateMetadata.DeltaArchiveManifest(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (installOperationsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + installOperations_ = java.util.Collections.unmodifiableList(installOperations_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.installOperations_ = installOperations_; + } else { + result.installOperations_ = installOperationsBuilder_.build(); + } + if (kernelInstallOperationsBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + kernelInstallOperations_ = java.util.Collections.unmodifiableList(kernelInstallOperations_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.kernelInstallOperations_ = kernelInstallOperations_; + } else { + result.kernelInstallOperations_ = kernelInstallOperationsBuilder_.build(); + } + if (((from_bitField0_ & 0x00000004) != 0)) { + to_bitField0_ |= 0x00000001; + } + result.blockSize_ = blockSize_; + if (((from_bitField0_ & 0x00000008) != 0)) { + result.signaturesOffset_ = signaturesOffset_; + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.signaturesSize_ = signaturesSize_; + to_bitField0_ |= 0x00000004; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + if (oldKernelInfoBuilder_ == null) { + result.oldKernelInfo_ = oldKernelInfo_; + } else { + result.oldKernelInfo_ = oldKernelInfoBuilder_.build(); + } + to_bitField0_ |= 0x00000008; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + if (newKernelInfoBuilder_ == null) { + result.newKernelInfo_ = newKernelInfo_; + } else { + result.newKernelInfo_ = newKernelInfoBuilder_.build(); + } + to_bitField0_ |= 0x00000010; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + if (oldRootfsInfoBuilder_ == null) { + result.oldRootfsInfo_ = oldRootfsInfo_; + } else { + result.oldRootfsInfo_ = oldRootfsInfoBuilder_.build(); + } + to_bitField0_ |= 0x00000020; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + if (newRootfsInfoBuilder_ == null) { + result.newRootfsInfo_ = newRootfsInfo_; + } else { + result.newRootfsInfo_ = newRootfsInfoBuilder_.build(); + } + to_bitField0_ |= 0x00000040; + } + if (((from_bitField0_ & 0x00000200) != 0)) { + if (oldImageInfoBuilder_ == null) { + result.oldImageInfo_ = oldImageInfo_; + } else { + result.oldImageInfo_ = oldImageInfoBuilder_.build(); + } + to_bitField0_ |= 0x00000080; + } + if (((from_bitField0_ & 0x00000400) != 0)) { + if (newImageInfoBuilder_ == null) { + result.newImageInfo_ = newImageInfo_; + } else { + result.newImageInfo_ = newImageInfoBuilder_.build(); + } + to_bitField0_ |= 0x00000100; + } + if (((from_bitField0_ & 0x00000800) != 0)) { + result.minorVersion_ = minorVersion_; + to_bitField0_ |= 0x00000200; + } + if (partitionsBuilder_ == null) { + if (((bitField0_ & 0x00001000) != 0)) { + partitions_ = java.util.Collections.unmodifiableList(partitions_); + bitField0_ = (bitField0_ & ~0x00001000); + } + result.partitions_ = partitions_; + } else { + result.partitions_ = partitionsBuilder_.build(); + } + if (((from_bitField0_ & 0x00002000) != 0)) { + result.maxTimestamp_ = maxTimestamp_; + to_bitField0_ |= 0x00000400; + } + if (((from_bitField0_ & 0x00004000) != 0)) { + if (dynamicPartitionMetadataBuilder_ == null) { + result.dynamicPartitionMetadata_ = dynamicPartitionMetadata_; + } else { + result.dynamicPartitionMetadata_ = dynamicPartitionMetadataBuilder_.build(); + } + to_bitField0_ |= 0x00000800; + } + if (((from_bitField0_ & 0x00008000) != 0)) { + result.partialUpdate_ = partialUpdate_; + to_bitField0_ |= 0x00001000; + } + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof chromeos_update_engine.UpdateMetadata.DeltaArchiveManifest) { + return mergeFrom((chromeos_update_engine.UpdateMetadata.DeltaArchiveManifest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(chromeos_update_engine.UpdateMetadata.DeltaArchiveManifest other) { + if (other == chromeos_update_engine.UpdateMetadata.DeltaArchiveManifest.getDefaultInstance()) return this; + if (installOperationsBuilder_ == null) { + if (!other.installOperations_.isEmpty()) { + if (installOperations_.isEmpty()) { + installOperations_ = other.installOperations_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureInstallOperationsIsMutable(); + installOperations_.addAll(other.installOperations_); + } + onChanged(); + } + } else { + if (!other.installOperations_.isEmpty()) { + if (installOperationsBuilder_.isEmpty()) { + installOperationsBuilder_.dispose(); + installOperationsBuilder_ = null; + installOperations_ = other.installOperations_; + bitField0_ = (bitField0_ & ~0x00000001); + installOperationsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getInstallOperationsFieldBuilder() : null; + } else { + installOperationsBuilder_.addAllMessages(other.installOperations_); + } + } + } + if (kernelInstallOperationsBuilder_ == null) { + if (!other.kernelInstallOperations_.isEmpty()) { + if (kernelInstallOperations_.isEmpty()) { + kernelInstallOperations_ = other.kernelInstallOperations_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureKernelInstallOperationsIsMutable(); + kernelInstallOperations_.addAll(other.kernelInstallOperations_); + } + onChanged(); + } + } else { + if (!other.kernelInstallOperations_.isEmpty()) { + if (kernelInstallOperationsBuilder_.isEmpty()) { + kernelInstallOperationsBuilder_.dispose(); + kernelInstallOperationsBuilder_ = null; + kernelInstallOperations_ = other.kernelInstallOperations_; + bitField0_ = (bitField0_ & ~0x00000002); + kernelInstallOperationsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getKernelInstallOperationsFieldBuilder() : null; + } else { + kernelInstallOperationsBuilder_.addAllMessages(other.kernelInstallOperations_); + } + } + } + if (other.hasBlockSize()) { + setBlockSize(other.getBlockSize()); + } + if (other.hasSignaturesOffset()) { + setSignaturesOffset(other.getSignaturesOffset()); + } + if (other.hasSignaturesSize()) { + setSignaturesSize(other.getSignaturesSize()); + } + if (other.hasOldKernelInfo()) { + mergeOldKernelInfo(other.getOldKernelInfo()); + } + if (other.hasNewKernelInfo()) { + mergeNewKernelInfo(other.getNewKernelInfo()); + } + if (other.hasOldRootfsInfo()) { + mergeOldRootfsInfo(other.getOldRootfsInfo()); + } + if (other.hasNewRootfsInfo()) { + mergeNewRootfsInfo(other.getNewRootfsInfo()); + } + if (other.hasOldImageInfo()) { + mergeOldImageInfo(other.getOldImageInfo()); + } + if (other.hasNewImageInfo()) { + mergeNewImageInfo(other.getNewImageInfo()); + } + if (other.hasMinorVersion()) { + setMinorVersion(other.getMinorVersion()); + } + if (partitionsBuilder_ == null) { + if (!other.partitions_.isEmpty()) { + if (partitions_.isEmpty()) { + partitions_ = other.partitions_; + bitField0_ = (bitField0_ & ~0x00001000); + } else { + ensurePartitionsIsMutable(); + partitions_.addAll(other.partitions_); + } + onChanged(); + } + } else { + if (!other.partitions_.isEmpty()) { + if (partitionsBuilder_.isEmpty()) { + partitionsBuilder_.dispose(); + partitionsBuilder_ = null; + partitions_ = other.partitions_; + bitField0_ = (bitField0_ & ~0x00001000); + partitionsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getPartitionsFieldBuilder() : null; + } else { + partitionsBuilder_.addAllMessages(other.partitions_); + } + } + } + if (other.hasMaxTimestamp()) { + setMaxTimestamp(other.getMaxTimestamp()); + } + if (other.hasDynamicPartitionMetadata()) { + mergeDynamicPartitionMetadata(other.getDynamicPartitionMetadata()); + } + if (other.hasPartialUpdate()) { + setPartialUpdate(other.getPartialUpdate()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + for (int i = 0; i < getInstallOperationsCount(); i++) { + if (!getInstallOperations(i).isInitialized()) { + return false; + } + } + for (int i = 0; i < getKernelInstallOperationsCount(); i++) { + if (!getKernelInstallOperations(i).isInitialized()) { + return false; + } + } + for (int i = 0; i < getPartitionsCount(); i++) { + if (!getPartitions(i).isInitialized()) { + return false; + } + } + if (hasDynamicPartitionMetadata()) { + if (!getDynamicPartitionMetadata().isInitialized()) { + return false; + } + } + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + chromeos_update_engine.UpdateMetadata.DeltaArchiveManifest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (chromeos_update_engine.UpdateMetadata.DeltaArchiveManifest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.util.List installOperations_ = + java.util.Collections.emptyList(); + private void ensureInstallOperationsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + installOperations_ = new java.util.ArrayList(installOperations_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + chromeos_update_engine.UpdateMetadata.InstallOperation, chromeos_update_engine.UpdateMetadata.InstallOperation.Builder, chromeos_update_engine.UpdateMetadata.InstallOperationOrBuilder> installOperationsBuilder_; + + /** + *
+       * Only present in major version = 1. List of install operations for the
+       * kernel and rootfs partitions. For major version = 2 see the |partitions|
+       * field.
+       * 
+ * + * repeated .chromeos_update_engine.InstallOperation install_operations = 1; + */ + public java.util.List getInstallOperationsList() { + if (installOperationsBuilder_ == null) { + return java.util.Collections.unmodifiableList(installOperations_); + } else { + return installOperationsBuilder_.getMessageList(); + } + } + /** + *
+       * Only present in major version = 1. List of install operations for the
+       * kernel and rootfs partitions. For major version = 2 see the |partitions|
+       * field.
+       * 
+ * + * repeated .chromeos_update_engine.InstallOperation install_operations = 1; + */ + public int getInstallOperationsCount() { + if (installOperationsBuilder_ == null) { + return installOperations_.size(); + } else { + return installOperationsBuilder_.getCount(); + } + } + /** + *
+       * Only present in major version = 1. List of install operations for the
+       * kernel and rootfs partitions. For major version = 2 see the |partitions|
+       * field.
+       * 
+ * + * repeated .chromeos_update_engine.InstallOperation install_operations = 1; + */ + public chromeos_update_engine.UpdateMetadata.InstallOperation getInstallOperations(int index) { + if (installOperationsBuilder_ == null) { + return installOperations_.get(index); + } else { + return installOperationsBuilder_.getMessage(index); + } + } + /** + *
+       * Only present in major version = 1. List of install operations for the
+       * kernel and rootfs partitions. For major version = 2 see the |partitions|
+       * field.
+       * 
+ * + * repeated .chromeos_update_engine.InstallOperation install_operations = 1; + */ + public Builder setInstallOperations( + int index, chromeos_update_engine.UpdateMetadata.InstallOperation value) { + if (installOperationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureInstallOperationsIsMutable(); + installOperations_.set(index, value); + onChanged(); + } else { + installOperationsBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+       * Only present in major version = 1. List of install operations for the
+       * kernel and rootfs partitions. For major version = 2 see the |partitions|
+       * field.
+       * 
+ * + * repeated .chromeos_update_engine.InstallOperation install_operations = 1; + */ + public Builder setInstallOperations( + int index, chromeos_update_engine.UpdateMetadata.InstallOperation.Builder builderForValue) { + if (installOperationsBuilder_ == null) { + ensureInstallOperationsIsMutable(); + installOperations_.set(index, builderForValue.build()); + onChanged(); + } else { + installOperationsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+       * Only present in major version = 1. List of install operations for the
+       * kernel and rootfs partitions. For major version = 2 see the |partitions|
+       * field.
+       * 
+ * + * repeated .chromeos_update_engine.InstallOperation install_operations = 1; + */ + public Builder addInstallOperations(chromeos_update_engine.UpdateMetadata.InstallOperation value) { + if (installOperationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureInstallOperationsIsMutable(); + installOperations_.add(value); + onChanged(); + } else { + installOperationsBuilder_.addMessage(value); + } + return this; + } + /** + *
+       * Only present in major version = 1. List of install operations for the
+       * kernel and rootfs partitions. For major version = 2 see the |partitions|
+       * field.
+       * 
+ * + * repeated .chromeos_update_engine.InstallOperation install_operations = 1; + */ + public Builder addInstallOperations( + int index, chromeos_update_engine.UpdateMetadata.InstallOperation value) { + if (installOperationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureInstallOperationsIsMutable(); + installOperations_.add(index, value); + onChanged(); + } else { + installOperationsBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+       * Only present in major version = 1. List of install operations for the
+       * kernel and rootfs partitions. For major version = 2 see the |partitions|
+       * field.
+       * 
+ * + * repeated .chromeos_update_engine.InstallOperation install_operations = 1; + */ + public Builder addInstallOperations( + chromeos_update_engine.UpdateMetadata.InstallOperation.Builder builderForValue) { + if (installOperationsBuilder_ == null) { + ensureInstallOperationsIsMutable(); + installOperations_.add(builderForValue.build()); + onChanged(); + } else { + installOperationsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+       * Only present in major version = 1. List of install operations for the
+       * kernel and rootfs partitions. For major version = 2 see the |partitions|
+       * field.
+       * 
+ * + * repeated .chromeos_update_engine.InstallOperation install_operations = 1; + */ + public Builder addInstallOperations( + int index, chromeos_update_engine.UpdateMetadata.InstallOperation.Builder builderForValue) { + if (installOperationsBuilder_ == null) { + ensureInstallOperationsIsMutable(); + installOperations_.add(index, builderForValue.build()); + onChanged(); + } else { + installOperationsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+       * Only present in major version = 1. List of install operations for the
+       * kernel and rootfs partitions. For major version = 2 see the |partitions|
+       * field.
+       * 
+ * + * repeated .chromeos_update_engine.InstallOperation install_operations = 1; + */ + public Builder addAllInstallOperations( + java.lang.Iterable values) { + if (installOperationsBuilder_ == null) { + ensureInstallOperationsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, installOperations_); + onChanged(); + } else { + installOperationsBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+       * Only present in major version = 1. List of install operations for the
+       * kernel and rootfs partitions. For major version = 2 see the |partitions|
+       * field.
+       * 
+ * + * repeated .chromeos_update_engine.InstallOperation install_operations = 1; + */ + public Builder clearInstallOperations() { + if (installOperationsBuilder_ == null) { + installOperations_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + installOperationsBuilder_.clear(); + } + return this; + } + /** + *
+       * Only present in major version = 1. List of install operations for the
+       * kernel and rootfs partitions. For major version = 2 see the |partitions|
+       * field.
+       * 
+ * + * repeated .chromeos_update_engine.InstallOperation install_operations = 1; + */ + public Builder removeInstallOperations(int index) { + if (installOperationsBuilder_ == null) { + ensureInstallOperationsIsMutable(); + installOperations_.remove(index); + onChanged(); + } else { + installOperationsBuilder_.remove(index); + } + return this; + } + /** + *
+       * Only present in major version = 1. List of install operations for the
+       * kernel and rootfs partitions. For major version = 2 see the |partitions|
+       * field.
+       * 
+ * + * repeated .chromeos_update_engine.InstallOperation install_operations = 1; + */ + public chromeos_update_engine.UpdateMetadata.InstallOperation.Builder getInstallOperationsBuilder( + int index) { + return getInstallOperationsFieldBuilder().getBuilder(index); + } + /** + *
+       * Only present in major version = 1. List of install operations for the
+       * kernel and rootfs partitions. For major version = 2 see the |partitions|
+       * field.
+       * 
+ * + * repeated .chromeos_update_engine.InstallOperation install_operations = 1; + */ + public chromeos_update_engine.UpdateMetadata.InstallOperationOrBuilder getInstallOperationsOrBuilder( + int index) { + if (installOperationsBuilder_ == null) { + return installOperations_.get(index); } else { + return installOperationsBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+       * Only present in major version = 1. List of install operations for the
+       * kernel and rootfs partitions. For major version = 2 see the |partitions|
+       * field.
+       * 
+ * + * repeated .chromeos_update_engine.InstallOperation install_operations = 1; + */ + public java.util.List + getInstallOperationsOrBuilderList() { + if (installOperationsBuilder_ != null) { + return installOperationsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(installOperations_); + } + } + /** + *
+       * Only present in major version = 1. List of install operations for the
+       * kernel and rootfs partitions. For major version = 2 see the |partitions|
+       * field.
+       * 
+ * + * repeated .chromeos_update_engine.InstallOperation install_operations = 1; + */ + public chromeos_update_engine.UpdateMetadata.InstallOperation.Builder addInstallOperationsBuilder() { + return getInstallOperationsFieldBuilder().addBuilder( + chromeos_update_engine.UpdateMetadata.InstallOperation.getDefaultInstance()); + } + /** + *
+       * Only present in major version = 1. List of install operations for the
+       * kernel and rootfs partitions. For major version = 2 see the |partitions|
+       * field.
+       * 
+ * + * repeated .chromeos_update_engine.InstallOperation install_operations = 1; + */ + public chromeos_update_engine.UpdateMetadata.InstallOperation.Builder addInstallOperationsBuilder( + int index) { + return getInstallOperationsFieldBuilder().addBuilder( + index, chromeos_update_engine.UpdateMetadata.InstallOperation.getDefaultInstance()); + } + /** + *
+       * Only present in major version = 1. List of install operations for the
+       * kernel and rootfs partitions. For major version = 2 see the |partitions|
+       * field.
+       * 
+ * + * repeated .chromeos_update_engine.InstallOperation install_operations = 1; + */ + public java.util.List + getInstallOperationsBuilderList() { + return getInstallOperationsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + chromeos_update_engine.UpdateMetadata.InstallOperation, chromeos_update_engine.UpdateMetadata.InstallOperation.Builder, chromeos_update_engine.UpdateMetadata.InstallOperationOrBuilder> + getInstallOperationsFieldBuilder() { + if (installOperationsBuilder_ == null) { + installOperationsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + chromeos_update_engine.UpdateMetadata.InstallOperation, chromeos_update_engine.UpdateMetadata.InstallOperation.Builder, chromeos_update_engine.UpdateMetadata.InstallOperationOrBuilder>( + installOperations_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + installOperations_ = null; + } + return installOperationsBuilder_; + } + + private java.util.List kernelInstallOperations_ = + java.util.Collections.emptyList(); + private void ensureKernelInstallOperationsIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + kernelInstallOperations_ = new java.util.ArrayList(kernelInstallOperations_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + chromeos_update_engine.UpdateMetadata.InstallOperation, chromeos_update_engine.UpdateMetadata.InstallOperation.Builder, chromeos_update_engine.UpdateMetadata.InstallOperationOrBuilder> kernelInstallOperationsBuilder_; + + /** + * repeated .chromeos_update_engine.InstallOperation kernel_install_operations = 2; + */ + public java.util.List getKernelInstallOperationsList() { + if (kernelInstallOperationsBuilder_ == null) { + return java.util.Collections.unmodifiableList(kernelInstallOperations_); + } else { + return kernelInstallOperationsBuilder_.getMessageList(); + } + } + /** + * repeated .chromeos_update_engine.InstallOperation kernel_install_operations = 2; + */ + public int getKernelInstallOperationsCount() { + if (kernelInstallOperationsBuilder_ == null) { + return kernelInstallOperations_.size(); + } else { + return kernelInstallOperationsBuilder_.getCount(); + } + } + /** + * repeated .chromeos_update_engine.InstallOperation kernel_install_operations = 2; + */ + public chromeos_update_engine.UpdateMetadata.InstallOperation getKernelInstallOperations(int index) { + if (kernelInstallOperationsBuilder_ == null) { + return kernelInstallOperations_.get(index); + } else { + return kernelInstallOperationsBuilder_.getMessage(index); + } + } + /** + * repeated .chromeos_update_engine.InstallOperation kernel_install_operations = 2; + */ + public Builder setKernelInstallOperations( + int index, chromeos_update_engine.UpdateMetadata.InstallOperation value) { + if (kernelInstallOperationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureKernelInstallOperationsIsMutable(); + kernelInstallOperations_.set(index, value); + onChanged(); + } else { + kernelInstallOperationsBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .chromeos_update_engine.InstallOperation kernel_install_operations = 2; + */ + public Builder setKernelInstallOperations( + int index, chromeos_update_engine.UpdateMetadata.InstallOperation.Builder builderForValue) { + if (kernelInstallOperationsBuilder_ == null) { + ensureKernelInstallOperationsIsMutable(); + kernelInstallOperations_.set(index, builderForValue.build()); + onChanged(); + } else { + kernelInstallOperationsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .chromeos_update_engine.InstallOperation kernel_install_operations = 2; + */ + public Builder addKernelInstallOperations(chromeos_update_engine.UpdateMetadata.InstallOperation value) { + if (kernelInstallOperationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureKernelInstallOperationsIsMutable(); + kernelInstallOperations_.add(value); + onChanged(); + } else { + kernelInstallOperationsBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .chromeos_update_engine.InstallOperation kernel_install_operations = 2; + */ + public Builder addKernelInstallOperations( + int index, chromeos_update_engine.UpdateMetadata.InstallOperation value) { + if (kernelInstallOperationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureKernelInstallOperationsIsMutable(); + kernelInstallOperations_.add(index, value); + onChanged(); + } else { + kernelInstallOperationsBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .chromeos_update_engine.InstallOperation kernel_install_operations = 2; + */ + public Builder addKernelInstallOperations( + chromeos_update_engine.UpdateMetadata.InstallOperation.Builder builderForValue) { + if (kernelInstallOperationsBuilder_ == null) { + ensureKernelInstallOperationsIsMutable(); + kernelInstallOperations_.add(builderForValue.build()); + onChanged(); + } else { + kernelInstallOperationsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .chromeos_update_engine.InstallOperation kernel_install_operations = 2; + */ + public Builder addKernelInstallOperations( + int index, chromeos_update_engine.UpdateMetadata.InstallOperation.Builder builderForValue) { + if (kernelInstallOperationsBuilder_ == null) { + ensureKernelInstallOperationsIsMutable(); + kernelInstallOperations_.add(index, builderForValue.build()); + onChanged(); + } else { + kernelInstallOperationsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .chromeos_update_engine.InstallOperation kernel_install_operations = 2; + */ + public Builder addAllKernelInstallOperations( + java.lang.Iterable values) { + if (kernelInstallOperationsBuilder_ == null) { + ensureKernelInstallOperationsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, kernelInstallOperations_); + onChanged(); + } else { + kernelInstallOperationsBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .chromeos_update_engine.InstallOperation kernel_install_operations = 2; + */ + public Builder clearKernelInstallOperations() { + if (kernelInstallOperationsBuilder_ == null) { + kernelInstallOperations_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + kernelInstallOperationsBuilder_.clear(); + } + return this; + } + /** + * repeated .chromeos_update_engine.InstallOperation kernel_install_operations = 2; + */ + public Builder removeKernelInstallOperations(int index) { + if (kernelInstallOperationsBuilder_ == null) { + ensureKernelInstallOperationsIsMutable(); + kernelInstallOperations_.remove(index); + onChanged(); + } else { + kernelInstallOperationsBuilder_.remove(index); + } + return this; + } + /** + * repeated .chromeos_update_engine.InstallOperation kernel_install_operations = 2; + */ + public chromeos_update_engine.UpdateMetadata.InstallOperation.Builder getKernelInstallOperationsBuilder( + int index) { + return getKernelInstallOperationsFieldBuilder().getBuilder(index); + } + /** + * repeated .chromeos_update_engine.InstallOperation kernel_install_operations = 2; + */ + public chromeos_update_engine.UpdateMetadata.InstallOperationOrBuilder getKernelInstallOperationsOrBuilder( + int index) { + if (kernelInstallOperationsBuilder_ == null) { + return kernelInstallOperations_.get(index); } else { + return kernelInstallOperationsBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .chromeos_update_engine.InstallOperation kernel_install_operations = 2; + */ + public java.util.List + getKernelInstallOperationsOrBuilderList() { + if (kernelInstallOperationsBuilder_ != null) { + return kernelInstallOperationsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(kernelInstallOperations_); + } + } + /** + * repeated .chromeos_update_engine.InstallOperation kernel_install_operations = 2; + */ + public chromeos_update_engine.UpdateMetadata.InstallOperation.Builder addKernelInstallOperationsBuilder() { + return getKernelInstallOperationsFieldBuilder().addBuilder( + chromeos_update_engine.UpdateMetadata.InstallOperation.getDefaultInstance()); + } + /** + * repeated .chromeos_update_engine.InstallOperation kernel_install_operations = 2; + */ + public chromeos_update_engine.UpdateMetadata.InstallOperation.Builder addKernelInstallOperationsBuilder( + int index) { + return getKernelInstallOperationsFieldBuilder().addBuilder( + index, chromeos_update_engine.UpdateMetadata.InstallOperation.getDefaultInstance()); + } + /** + * repeated .chromeos_update_engine.InstallOperation kernel_install_operations = 2; + */ + public java.util.List + getKernelInstallOperationsBuilderList() { + return getKernelInstallOperationsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + chromeos_update_engine.UpdateMetadata.InstallOperation, chromeos_update_engine.UpdateMetadata.InstallOperation.Builder, chromeos_update_engine.UpdateMetadata.InstallOperationOrBuilder> + getKernelInstallOperationsFieldBuilder() { + if (kernelInstallOperationsBuilder_ == null) { + kernelInstallOperationsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + chromeos_update_engine.UpdateMetadata.InstallOperation, chromeos_update_engine.UpdateMetadata.InstallOperation.Builder, chromeos_update_engine.UpdateMetadata.InstallOperationOrBuilder>( + kernelInstallOperations_, + ((bitField0_ & 0x00000002) != 0), + getParentForChildren(), + isClean()); + kernelInstallOperations_ = null; + } + return kernelInstallOperationsBuilder_; + } + + private int blockSize_ = 4096; + /** + *
+       * (At time of writing) usually 4096
+       * 
+ * + * optional uint32 block_size = 3 [default = 4096]; + * @return Whether the blockSize field is set. + */ + @java.lang.Override + public boolean hasBlockSize() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + *
+       * (At time of writing) usually 4096
+       * 
+ * + * optional uint32 block_size = 3 [default = 4096]; + * @return The blockSize. + */ + @java.lang.Override + public int getBlockSize() { + return blockSize_; + } + /** + *
+       * (At time of writing) usually 4096
+       * 
+ * + * optional uint32 block_size = 3 [default = 4096]; + * @param value The blockSize to set. + * @return This builder for chaining. + */ + public Builder setBlockSize(int value) { + bitField0_ |= 0x00000004; + blockSize_ = value; + onChanged(); + return this; + } + /** + *
+       * (At time of writing) usually 4096
+       * 
+ * + * optional uint32 block_size = 3 [default = 4096]; + * @return This builder for chaining. + */ + public Builder clearBlockSize() { + bitField0_ = (bitField0_ & ~0x00000004); + blockSize_ = 4096; + onChanged(); + return this; + } + + private long signaturesOffset_ ; + /** + *
+       * If signatures are present, the offset into the blobs, generally
+       * tacked onto the end of the file, and the length. We use an offset
+       * rather than a bool to allow for more flexibility in future file formats.
+       * If either is absent, it means signatures aren't supported in this
+       * file.
+       * 
+ * + * optional uint64 signatures_offset = 4; + * @return Whether the signaturesOffset field is set. + */ + @java.lang.Override + public boolean hasSignaturesOffset() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + *
+       * If signatures are present, the offset into the blobs, generally
+       * tacked onto the end of the file, and the length. We use an offset
+       * rather than a bool to allow for more flexibility in future file formats.
+       * If either is absent, it means signatures aren't supported in this
+       * file.
+       * 
+ * + * optional uint64 signatures_offset = 4; + * @return The signaturesOffset. + */ + @java.lang.Override + public long getSignaturesOffset() { + return signaturesOffset_; + } + /** + *
+       * If signatures are present, the offset into the blobs, generally
+       * tacked onto the end of the file, and the length. We use an offset
+       * rather than a bool to allow for more flexibility in future file formats.
+       * If either is absent, it means signatures aren't supported in this
+       * file.
+       * 
+ * + * optional uint64 signatures_offset = 4; + * @param value The signaturesOffset to set. + * @return This builder for chaining. + */ + public Builder setSignaturesOffset(long value) { + bitField0_ |= 0x00000008; + signaturesOffset_ = value; + onChanged(); + return this; + } + /** + *
+       * If signatures are present, the offset into the blobs, generally
+       * tacked onto the end of the file, and the length. We use an offset
+       * rather than a bool to allow for more flexibility in future file formats.
+       * If either is absent, it means signatures aren't supported in this
+       * file.
+       * 
+ * + * optional uint64 signatures_offset = 4; + * @return This builder for chaining. + */ + public Builder clearSignaturesOffset() { + bitField0_ = (bitField0_ & ~0x00000008); + signaturesOffset_ = 0L; + onChanged(); + return this; + } + + private long signaturesSize_ ; + /** + * optional uint64 signatures_size = 5; + * @return Whether the signaturesSize field is set. + */ + @java.lang.Override + public boolean hasSignaturesSize() { + return ((bitField0_ & 0x00000010) != 0); + } + /** + * optional uint64 signatures_size = 5; + * @return The signaturesSize. + */ + @java.lang.Override + public long getSignaturesSize() { + return signaturesSize_; + } + /** + * optional uint64 signatures_size = 5; + * @param value The signaturesSize to set. + * @return This builder for chaining. + */ + public Builder setSignaturesSize(long value) { + bitField0_ |= 0x00000010; + signaturesSize_ = value; + onChanged(); + return this; + } + /** + * optional uint64 signatures_size = 5; + * @return This builder for chaining. + */ + public Builder clearSignaturesSize() { + bitField0_ = (bitField0_ & ~0x00000010); + signaturesSize_ = 0L; + onChanged(); + return this; + } + + private chromeos_update_engine.UpdateMetadata.PartitionInfo oldKernelInfo_; + private com.google.protobuf.SingleFieldBuilderV3< + chromeos_update_engine.UpdateMetadata.PartitionInfo, chromeos_update_engine.UpdateMetadata.PartitionInfo.Builder, chromeos_update_engine.UpdateMetadata.PartitionInfoOrBuilder> oldKernelInfoBuilder_; + /** + *
+       * Only present in major version = 1. Partition metadata used to validate the
+       * update. For major version = 2 see the |partitions| field.
+       * 
+ * + * optional .chromeos_update_engine.PartitionInfo old_kernel_info = 6; + * @return Whether the oldKernelInfo field is set. + */ + public boolean hasOldKernelInfo() { + return ((bitField0_ & 0x00000020) != 0); + } + /** + *
+       * Only present in major version = 1. Partition metadata used to validate the
+       * update. For major version = 2 see the |partitions| field.
+       * 
+ * + * optional .chromeos_update_engine.PartitionInfo old_kernel_info = 6; + * @return The oldKernelInfo. + */ + public chromeos_update_engine.UpdateMetadata.PartitionInfo getOldKernelInfo() { + if (oldKernelInfoBuilder_ == null) { + return oldKernelInfo_ == null ? chromeos_update_engine.UpdateMetadata.PartitionInfo.getDefaultInstance() : oldKernelInfo_; + } else { + return oldKernelInfoBuilder_.getMessage(); + } + } + /** + *
+       * Only present in major version = 1. Partition metadata used to validate the
+       * update. For major version = 2 see the |partitions| field.
+       * 
+ * + * optional .chromeos_update_engine.PartitionInfo old_kernel_info = 6; + */ + public Builder setOldKernelInfo(chromeos_update_engine.UpdateMetadata.PartitionInfo value) { + if (oldKernelInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + oldKernelInfo_ = value; + onChanged(); + } else { + oldKernelInfoBuilder_.setMessage(value); + } + bitField0_ |= 0x00000020; + return this; + } + /** + *
+       * Only present in major version = 1. Partition metadata used to validate the
+       * update. For major version = 2 see the |partitions| field.
+       * 
+ * + * optional .chromeos_update_engine.PartitionInfo old_kernel_info = 6; + */ + public Builder setOldKernelInfo( + chromeos_update_engine.UpdateMetadata.PartitionInfo.Builder builderForValue) { + if (oldKernelInfoBuilder_ == null) { + oldKernelInfo_ = builderForValue.build(); + onChanged(); + } else { + oldKernelInfoBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000020; + return this; + } + /** + *
+       * Only present in major version = 1. Partition metadata used to validate the
+       * update. For major version = 2 see the |partitions| field.
+       * 
+ * + * optional .chromeos_update_engine.PartitionInfo old_kernel_info = 6; + */ + public Builder mergeOldKernelInfo(chromeos_update_engine.UpdateMetadata.PartitionInfo value) { + if (oldKernelInfoBuilder_ == null) { + if (((bitField0_ & 0x00000020) != 0) && + oldKernelInfo_ != null && + oldKernelInfo_ != chromeos_update_engine.UpdateMetadata.PartitionInfo.getDefaultInstance()) { + oldKernelInfo_ = + chromeos_update_engine.UpdateMetadata.PartitionInfo.newBuilder(oldKernelInfo_).mergeFrom(value).buildPartial(); + } else { + oldKernelInfo_ = value; + } + onChanged(); + } else { + oldKernelInfoBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000020; + return this; + } + /** + *
+       * Only present in major version = 1. Partition metadata used to validate the
+       * update. For major version = 2 see the |partitions| field.
+       * 
+ * + * optional .chromeos_update_engine.PartitionInfo old_kernel_info = 6; + */ + public Builder clearOldKernelInfo() { + if (oldKernelInfoBuilder_ == null) { + oldKernelInfo_ = null; + onChanged(); + } else { + oldKernelInfoBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000020); + return this; + } + /** + *
+       * Only present in major version = 1. Partition metadata used to validate the
+       * update. For major version = 2 see the |partitions| field.
+       * 
+ * + * optional .chromeos_update_engine.PartitionInfo old_kernel_info = 6; + */ + public chromeos_update_engine.UpdateMetadata.PartitionInfo.Builder getOldKernelInfoBuilder() { + bitField0_ |= 0x00000020; + onChanged(); + return getOldKernelInfoFieldBuilder().getBuilder(); + } + /** + *
+       * Only present in major version = 1. Partition metadata used to validate the
+       * update. For major version = 2 see the |partitions| field.
+       * 
+ * + * optional .chromeos_update_engine.PartitionInfo old_kernel_info = 6; + */ + public chromeos_update_engine.UpdateMetadata.PartitionInfoOrBuilder getOldKernelInfoOrBuilder() { + if (oldKernelInfoBuilder_ != null) { + return oldKernelInfoBuilder_.getMessageOrBuilder(); + } else { + return oldKernelInfo_ == null ? + chromeos_update_engine.UpdateMetadata.PartitionInfo.getDefaultInstance() : oldKernelInfo_; + } + } + /** + *
+       * Only present in major version = 1. Partition metadata used to validate the
+       * update. For major version = 2 see the |partitions| field.
+       * 
+ * + * optional .chromeos_update_engine.PartitionInfo old_kernel_info = 6; + */ + private com.google.protobuf.SingleFieldBuilderV3< + chromeos_update_engine.UpdateMetadata.PartitionInfo, chromeos_update_engine.UpdateMetadata.PartitionInfo.Builder, chromeos_update_engine.UpdateMetadata.PartitionInfoOrBuilder> + getOldKernelInfoFieldBuilder() { + if (oldKernelInfoBuilder_ == null) { + oldKernelInfoBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + chromeos_update_engine.UpdateMetadata.PartitionInfo, chromeos_update_engine.UpdateMetadata.PartitionInfo.Builder, chromeos_update_engine.UpdateMetadata.PartitionInfoOrBuilder>( + getOldKernelInfo(), + getParentForChildren(), + isClean()); + oldKernelInfo_ = null; + } + return oldKernelInfoBuilder_; + } + + private chromeos_update_engine.UpdateMetadata.PartitionInfo newKernelInfo_; + private com.google.protobuf.SingleFieldBuilderV3< + chromeos_update_engine.UpdateMetadata.PartitionInfo, chromeos_update_engine.UpdateMetadata.PartitionInfo.Builder, chromeos_update_engine.UpdateMetadata.PartitionInfoOrBuilder> newKernelInfoBuilder_; + /** + * optional .chromeos_update_engine.PartitionInfo new_kernel_info = 7; + * @return Whether the newKernelInfo field is set. + */ + public boolean hasNewKernelInfo() { + return ((bitField0_ & 0x00000040) != 0); + } + /** + * optional .chromeos_update_engine.PartitionInfo new_kernel_info = 7; + * @return The newKernelInfo. + */ + public chromeos_update_engine.UpdateMetadata.PartitionInfo getNewKernelInfo() { + if (newKernelInfoBuilder_ == null) { + return newKernelInfo_ == null ? chromeos_update_engine.UpdateMetadata.PartitionInfo.getDefaultInstance() : newKernelInfo_; + } else { + return newKernelInfoBuilder_.getMessage(); + } + } + /** + * optional .chromeos_update_engine.PartitionInfo new_kernel_info = 7; + */ + public Builder setNewKernelInfo(chromeos_update_engine.UpdateMetadata.PartitionInfo value) { + if (newKernelInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + newKernelInfo_ = value; + onChanged(); + } else { + newKernelInfoBuilder_.setMessage(value); + } + bitField0_ |= 0x00000040; + return this; + } + /** + * optional .chromeos_update_engine.PartitionInfo new_kernel_info = 7; + */ + public Builder setNewKernelInfo( + chromeos_update_engine.UpdateMetadata.PartitionInfo.Builder builderForValue) { + if (newKernelInfoBuilder_ == null) { + newKernelInfo_ = builderForValue.build(); + onChanged(); + } else { + newKernelInfoBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000040; + return this; + } + /** + * optional .chromeos_update_engine.PartitionInfo new_kernel_info = 7; + */ + public Builder mergeNewKernelInfo(chromeos_update_engine.UpdateMetadata.PartitionInfo value) { + if (newKernelInfoBuilder_ == null) { + if (((bitField0_ & 0x00000040) != 0) && + newKernelInfo_ != null && + newKernelInfo_ != chromeos_update_engine.UpdateMetadata.PartitionInfo.getDefaultInstance()) { + newKernelInfo_ = + chromeos_update_engine.UpdateMetadata.PartitionInfo.newBuilder(newKernelInfo_).mergeFrom(value).buildPartial(); + } else { + newKernelInfo_ = value; + } + onChanged(); + } else { + newKernelInfoBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000040; + return this; + } + /** + * optional .chromeos_update_engine.PartitionInfo new_kernel_info = 7; + */ + public Builder clearNewKernelInfo() { + if (newKernelInfoBuilder_ == null) { + newKernelInfo_ = null; + onChanged(); + } else { + newKernelInfoBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000040); + return this; + } + /** + * optional .chromeos_update_engine.PartitionInfo new_kernel_info = 7; + */ + public chromeos_update_engine.UpdateMetadata.PartitionInfo.Builder getNewKernelInfoBuilder() { + bitField0_ |= 0x00000040; + onChanged(); + return getNewKernelInfoFieldBuilder().getBuilder(); + } + /** + * optional .chromeos_update_engine.PartitionInfo new_kernel_info = 7; + */ + public chromeos_update_engine.UpdateMetadata.PartitionInfoOrBuilder getNewKernelInfoOrBuilder() { + if (newKernelInfoBuilder_ != null) { + return newKernelInfoBuilder_.getMessageOrBuilder(); + } else { + return newKernelInfo_ == null ? + chromeos_update_engine.UpdateMetadata.PartitionInfo.getDefaultInstance() : newKernelInfo_; + } + } + /** + * optional .chromeos_update_engine.PartitionInfo new_kernel_info = 7; + */ + private com.google.protobuf.SingleFieldBuilderV3< + chromeos_update_engine.UpdateMetadata.PartitionInfo, chromeos_update_engine.UpdateMetadata.PartitionInfo.Builder, chromeos_update_engine.UpdateMetadata.PartitionInfoOrBuilder> + getNewKernelInfoFieldBuilder() { + if (newKernelInfoBuilder_ == null) { + newKernelInfoBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + chromeos_update_engine.UpdateMetadata.PartitionInfo, chromeos_update_engine.UpdateMetadata.PartitionInfo.Builder, chromeos_update_engine.UpdateMetadata.PartitionInfoOrBuilder>( + getNewKernelInfo(), + getParentForChildren(), + isClean()); + newKernelInfo_ = null; + } + return newKernelInfoBuilder_; + } + + private chromeos_update_engine.UpdateMetadata.PartitionInfo oldRootfsInfo_; + private com.google.protobuf.SingleFieldBuilderV3< + chromeos_update_engine.UpdateMetadata.PartitionInfo, chromeos_update_engine.UpdateMetadata.PartitionInfo.Builder, chromeos_update_engine.UpdateMetadata.PartitionInfoOrBuilder> oldRootfsInfoBuilder_; + /** + * optional .chromeos_update_engine.PartitionInfo old_rootfs_info = 8; + * @return Whether the oldRootfsInfo field is set. + */ + public boolean hasOldRootfsInfo() { + return ((bitField0_ & 0x00000080) != 0); + } + /** + * optional .chromeos_update_engine.PartitionInfo old_rootfs_info = 8; + * @return The oldRootfsInfo. + */ + public chromeos_update_engine.UpdateMetadata.PartitionInfo getOldRootfsInfo() { + if (oldRootfsInfoBuilder_ == null) { + return oldRootfsInfo_ == null ? chromeos_update_engine.UpdateMetadata.PartitionInfo.getDefaultInstance() : oldRootfsInfo_; + } else { + return oldRootfsInfoBuilder_.getMessage(); + } + } + /** + * optional .chromeos_update_engine.PartitionInfo old_rootfs_info = 8; + */ + public Builder setOldRootfsInfo(chromeos_update_engine.UpdateMetadata.PartitionInfo value) { + if (oldRootfsInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + oldRootfsInfo_ = value; + onChanged(); + } else { + oldRootfsInfoBuilder_.setMessage(value); + } + bitField0_ |= 0x00000080; + return this; + } + /** + * optional .chromeos_update_engine.PartitionInfo old_rootfs_info = 8; + */ + public Builder setOldRootfsInfo( + chromeos_update_engine.UpdateMetadata.PartitionInfo.Builder builderForValue) { + if (oldRootfsInfoBuilder_ == null) { + oldRootfsInfo_ = builderForValue.build(); + onChanged(); + } else { + oldRootfsInfoBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000080; + return this; + } + /** + * optional .chromeos_update_engine.PartitionInfo old_rootfs_info = 8; + */ + public Builder mergeOldRootfsInfo(chromeos_update_engine.UpdateMetadata.PartitionInfo value) { + if (oldRootfsInfoBuilder_ == null) { + if (((bitField0_ & 0x00000080) != 0) && + oldRootfsInfo_ != null && + oldRootfsInfo_ != chromeos_update_engine.UpdateMetadata.PartitionInfo.getDefaultInstance()) { + oldRootfsInfo_ = + chromeos_update_engine.UpdateMetadata.PartitionInfo.newBuilder(oldRootfsInfo_).mergeFrom(value).buildPartial(); + } else { + oldRootfsInfo_ = value; + } + onChanged(); + } else { + oldRootfsInfoBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000080; + return this; + } + /** + * optional .chromeos_update_engine.PartitionInfo old_rootfs_info = 8; + */ + public Builder clearOldRootfsInfo() { + if (oldRootfsInfoBuilder_ == null) { + oldRootfsInfo_ = null; + onChanged(); + } else { + oldRootfsInfoBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000080); + return this; + } + /** + * optional .chromeos_update_engine.PartitionInfo old_rootfs_info = 8; + */ + public chromeos_update_engine.UpdateMetadata.PartitionInfo.Builder getOldRootfsInfoBuilder() { + bitField0_ |= 0x00000080; + onChanged(); + return getOldRootfsInfoFieldBuilder().getBuilder(); + } + /** + * optional .chromeos_update_engine.PartitionInfo old_rootfs_info = 8; + */ + public chromeos_update_engine.UpdateMetadata.PartitionInfoOrBuilder getOldRootfsInfoOrBuilder() { + if (oldRootfsInfoBuilder_ != null) { + return oldRootfsInfoBuilder_.getMessageOrBuilder(); + } else { + return oldRootfsInfo_ == null ? + chromeos_update_engine.UpdateMetadata.PartitionInfo.getDefaultInstance() : oldRootfsInfo_; + } + } + /** + * optional .chromeos_update_engine.PartitionInfo old_rootfs_info = 8; + */ + private com.google.protobuf.SingleFieldBuilderV3< + chromeos_update_engine.UpdateMetadata.PartitionInfo, chromeos_update_engine.UpdateMetadata.PartitionInfo.Builder, chromeos_update_engine.UpdateMetadata.PartitionInfoOrBuilder> + getOldRootfsInfoFieldBuilder() { + if (oldRootfsInfoBuilder_ == null) { + oldRootfsInfoBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + chromeos_update_engine.UpdateMetadata.PartitionInfo, chromeos_update_engine.UpdateMetadata.PartitionInfo.Builder, chromeos_update_engine.UpdateMetadata.PartitionInfoOrBuilder>( + getOldRootfsInfo(), + getParentForChildren(), + isClean()); + oldRootfsInfo_ = null; + } + return oldRootfsInfoBuilder_; + } + + private chromeos_update_engine.UpdateMetadata.PartitionInfo newRootfsInfo_; + private com.google.protobuf.SingleFieldBuilderV3< + chromeos_update_engine.UpdateMetadata.PartitionInfo, chromeos_update_engine.UpdateMetadata.PartitionInfo.Builder, chromeos_update_engine.UpdateMetadata.PartitionInfoOrBuilder> newRootfsInfoBuilder_; + /** + * optional .chromeos_update_engine.PartitionInfo new_rootfs_info = 9; + * @return Whether the newRootfsInfo field is set. + */ + public boolean hasNewRootfsInfo() { + return ((bitField0_ & 0x00000100) != 0); + } + /** + * optional .chromeos_update_engine.PartitionInfo new_rootfs_info = 9; + * @return The newRootfsInfo. + */ + public chromeos_update_engine.UpdateMetadata.PartitionInfo getNewRootfsInfo() { + if (newRootfsInfoBuilder_ == null) { + return newRootfsInfo_ == null ? chromeos_update_engine.UpdateMetadata.PartitionInfo.getDefaultInstance() : newRootfsInfo_; + } else { + return newRootfsInfoBuilder_.getMessage(); + } + } + /** + * optional .chromeos_update_engine.PartitionInfo new_rootfs_info = 9; + */ + public Builder setNewRootfsInfo(chromeos_update_engine.UpdateMetadata.PartitionInfo value) { + if (newRootfsInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + newRootfsInfo_ = value; + onChanged(); + } else { + newRootfsInfoBuilder_.setMessage(value); + } + bitField0_ |= 0x00000100; + return this; + } + /** + * optional .chromeos_update_engine.PartitionInfo new_rootfs_info = 9; + */ + public Builder setNewRootfsInfo( + chromeos_update_engine.UpdateMetadata.PartitionInfo.Builder builderForValue) { + if (newRootfsInfoBuilder_ == null) { + newRootfsInfo_ = builderForValue.build(); + onChanged(); + } else { + newRootfsInfoBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000100; + return this; + } + /** + * optional .chromeos_update_engine.PartitionInfo new_rootfs_info = 9; + */ + public Builder mergeNewRootfsInfo(chromeos_update_engine.UpdateMetadata.PartitionInfo value) { + if (newRootfsInfoBuilder_ == null) { + if (((bitField0_ & 0x00000100) != 0) && + newRootfsInfo_ != null && + newRootfsInfo_ != chromeos_update_engine.UpdateMetadata.PartitionInfo.getDefaultInstance()) { + newRootfsInfo_ = + chromeos_update_engine.UpdateMetadata.PartitionInfo.newBuilder(newRootfsInfo_).mergeFrom(value).buildPartial(); + } else { + newRootfsInfo_ = value; + } + onChanged(); + } else { + newRootfsInfoBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000100; + return this; + } + /** + * optional .chromeos_update_engine.PartitionInfo new_rootfs_info = 9; + */ + public Builder clearNewRootfsInfo() { + if (newRootfsInfoBuilder_ == null) { + newRootfsInfo_ = null; + onChanged(); + } else { + newRootfsInfoBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000100); + return this; + } + /** + * optional .chromeos_update_engine.PartitionInfo new_rootfs_info = 9; + */ + public chromeos_update_engine.UpdateMetadata.PartitionInfo.Builder getNewRootfsInfoBuilder() { + bitField0_ |= 0x00000100; + onChanged(); + return getNewRootfsInfoFieldBuilder().getBuilder(); + } + /** + * optional .chromeos_update_engine.PartitionInfo new_rootfs_info = 9; + */ + public chromeos_update_engine.UpdateMetadata.PartitionInfoOrBuilder getNewRootfsInfoOrBuilder() { + if (newRootfsInfoBuilder_ != null) { + return newRootfsInfoBuilder_.getMessageOrBuilder(); + } else { + return newRootfsInfo_ == null ? + chromeos_update_engine.UpdateMetadata.PartitionInfo.getDefaultInstance() : newRootfsInfo_; + } + } + /** + * optional .chromeos_update_engine.PartitionInfo new_rootfs_info = 9; + */ + private com.google.protobuf.SingleFieldBuilderV3< + chromeos_update_engine.UpdateMetadata.PartitionInfo, chromeos_update_engine.UpdateMetadata.PartitionInfo.Builder, chromeos_update_engine.UpdateMetadata.PartitionInfoOrBuilder> + getNewRootfsInfoFieldBuilder() { + if (newRootfsInfoBuilder_ == null) { + newRootfsInfoBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + chromeos_update_engine.UpdateMetadata.PartitionInfo, chromeos_update_engine.UpdateMetadata.PartitionInfo.Builder, chromeos_update_engine.UpdateMetadata.PartitionInfoOrBuilder>( + getNewRootfsInfo(), + getParentForChildren(), + isClean()); + newRootfsInfo_ = null; + } + return newRootfsInfoBuilder_; + } + + private chromeos_update_engine.UpdateMetadata.ImageInfo oldImageInfo_; + private com.google.protobuf.SingleFieldBuilderV3< + chromeos_update_engine.UpdateMetadata.ImageInfo, chromeos_update_engine.UpdateMetadata.ImageInfo.Builder, chromeos_update_engine.UpdateMetadata.ImageInfoOrBuilder> oldImageInfoBuilder_; + /** + *
+       * old_image_info will only be present for delta images.
+       * 
+ * + * optional .chromeos_update_engine.ImageInfo old_image_info = 10; + * @return Whether the oldImageInfo field is set. + */ + public boolean hasOldImageInfo() { + return ((bitField0_ & 0x00000200) != 0); + } + /** + *
+       * old_image_info will only be present for delta images.
+       * 
+ * + * optional .chromeos_update_engine.ImageInfo old_image_info = 10; + * @return The oldImageInfo. + */ + public chromeos_update_engine.UpdateMetadata.ImageInfo getOldImageInfo() { + if (oldImageInfoBuilder_ == null) { + return oldImageInfo_ == null ? chromeos_update_engine.UpdateMetadata.ImageInfo.getDefaultInstance() : oldImageInfo_; + } else { + return oldImageInfoBuilder_.getMessage(); + } + } + /** + *
+       * old_image_info will only be present for delta images.
+       * 
+ * + * optional .chromeos_update_engine.ImageInfo old_image_info = 10; + */ + public Builder setOldImageInfo(chromeos_update_engine.UpdateMetadata.ImageInfo value) { + if (oldImageInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + oldImageInfo_ = value; + onChanged(); + } else { + oldImageInfoBuilder_.setMessage(value); + } + bitField0_ |= 0x00000200; + return this; + } + /** + *
+       * old_image_info will only be present for delta images.
+       * 
+ * + * optional .chromeos_update_engine.ImageInfo old_image_info = 10; + */ + public Builder setOldImageInfo( + chromeos_update_engine.UpdateMetadata.ImageInfo.Builder builderForValue) { + if (oldImageInfoBuilder_ == null) { + oldImageInfo_ = builderForValue.build(); + onChanged(); + } else { + oldImageInfoBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000200; + return this; + } + /** + *
+       * old_image_info will only be present for delta images.
+       * 
+ * + * optional .chromeos_update_engine.ImageInfo old_image_info = 10; + */ + public Builder mergeOldImageInfo(chromeos_update_engine.UpdateMetadata.ImageInfo value) { + if (oldImageInfoBuilder_ == null) { + if (((bitField0_ & 0x00000200) != 0) && + oldImageInfo_ != null && + oldImageInfo_ != chromeos_update_engine.UpdateMetadata.ImageInfo.getDefaultInstance()) { + oldImageInfo_ = + chromeos_update_engine.UpdateMetadata.ImageInfo.newBuilder(oldImageInfo_).mergeFrom(value).buildPartial(); + } else { + oldImageInfo_ = value; + } + onChanged(); + } else { + oldImageInfoBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000200; + return this; + } + /** + *
+       * old_image_info will only be present for delta images.
+       * 
+ * + * optional .chromeos_update_engine.ImageInfo old_image_info = 10; + */ + public Builder clearOldImageInfo() { + if (oldImageInfoBuilder_ == null) { + oldImageInfo_ = null; + onChanged(); + } else { + oldImageInfoBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000200); + return this; + } + /** + *
+       * old_image_info will only be present for delta images.
+       * 
+ * + * optional .chromeos_update_engine.ImageInfo old_image_info = 10; + */ + public chromeos_update_engine.UpdateMetadata.ImageInfo.Builder getOldImageInfoBuilder() { + bitField0_ |= 0x00000200; + onChanged(); + return getOldImageInfoFieldBuilder().getBuilder(); + } + /** + *
+       * old_image_info will only be present for delta images.
+       * 
+ * + * optional .chromeos_update_engine.ImageInfo old_image_info = 10; + */ + public chromeos_update_engine.UpdateMetadata.ImageInfoOrBuilder getOldImageInfoOrBuilder() { + if (oldImageInfoBuilder_ != null) { + return oldImageInfoBuilder_.getMessageOrBuilder(); + } else { + return oldImageInfo_ == null ? + chromeos_update_engine.UpdateMetadata.ImageInfo.getDefaultInstance() : oldImageInfo_; + } + } + /** + *
+       * old_image_info will only be present for delta images.
+       * 
+ * + * optional .chromeos_update_engine.ImageInfo old_image_info = 10; + */ + private com.google.protobuf.SingleFieldBuilderV3< + chromeos_update_engine.UpdateMetadata.ImageInfo, chromeos_update_engine.UpdateMetadata.ImageInfo.Builder, chromeos_update_engine.UpdateMetadata.ImageInfoOrBuilder> + getOldImageInfoFieldBuilder() { + if (oldImageInfoBuilder_ == null) { + oldImageInfoBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + chromeos_update_engine.UpdateMetadata.ImageInfo, chromeos_update_engine.UpdateMetadata.ImageInfo.Builder, chromeos_update_engine.UpdateMetadata.ImageInfoOrBuilder>( + getOldImageInfo(), + getParentForChildren(), + isClean()); + oldImageInfo_ = null; + } + return oldImageInfoBuilder_; + } + + private chromeos_update_engine.UpdateMetadata.ImageInfo newImageInfo_; + private com.google.protobuf.SingleFieldBuilderV3< + chromeos_update_engine.UpdateMetadata.ImageInfo, chromeos_update_engine.UpdateMetadata.ImageInfo.Builder, chromeos_update_engine.UpdateMetadata.ImageInfoOrBuilder> newImageInfoBuilder_; + /** + * optional .chromeos_update_engine.ImageInfo new_image_info = 11; + * @return Whether the newImageInfo field is set. + */ + public boolean hasNewImageInfo() { + return ((bitField0_ & 0x00000400) != 0); + } + /** + * optional .chromeos_update_engine.ImageInfo new_image_info = 11; + * @return The newImageInfo. + */ + public chromeos_update_engine.UpdateMetadata.ImageInfo getNewImageInfo() { + if (newImageInfoBuilder_ == null) { + return newImageInfo_ == null ? chromeos_update_engine.UpdateMetadata.ImageInfo.getDefaultInstance() : newImageInfo_; + } else { + return newImageInfoBuilder_.getMessage(); + } + } + /** + * optional .chromeos_update_engine.ImageInfo new_image_info = 11; + */ + public Builder setNewImageInfo(chromeos_update_engine.UpdateMetadata.ImageInfo value) { + if (newImageInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + newImageInfo_ = value; + onChanged(); + } else { + newImageInfoBuilder_.setMessage(value); + } + bitField0_ |= 0x00000400; + return this; + } + /** + * optional .chromeos_update_engine.ImageInfo new_image_info = 11; + */ + public Builder setNewImageInfo( + chromeos_update_engine.UpdateMetadata.ImageInfo.Builder builderForValue) { + if (newImageInfoBuilder_ == null) { + newImageInfo_ = builderForValue.build(); + onChanged(); + } else { + newImageInfoBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000400; + return this; + } + /** + * optional .chromeos_update_engine.ImageInfo new_image_info = 11; + */ + public Builder mergeNewImageInfo(chromeos_update_engine.UpdateMetadata.ImageInfo value) { + if (newImageInfoBuilder_ == null) { + if (((bitField0_ & 0x00000400) != 0) && + newImageInfo_ != null && + newImageInfo_ != chromeos_update_engine.UpdateMetadata.ImageInfo.getDefaultInstance()) { + newImageInfo_ = + chromeos_update_engine.UpdateMetadata.ImageInfo.newBuilder(newImageInfo_).mergeFrom(value).buildPartial(); + } else { + newImageInfo_ = value; + } + onChanged(); + } else { + newImageInfoBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000400; + return this; + } + /** + * optional .chromeos_update_engine.ImageInfo new_image_info = 11; + */ + public Builder clearNewImageInfo() { + if (newImageInfoBuilder_ == null) { + newImageInfo_ = null; + onChanged(); + } else { + newImageInfoBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000400); + return this; + } + /** + * optional .chromeos_update_engine.ImageInfo new_image_info = 11; + */ + public chromeos_update_engine.UpdateMetadata.ImageInfo.Builder getNewImageInfoBuilder() { + bitField0_ |= 0x00000400; + onChanged(); + return getNewImageInfoFieldBuilder().getBuilder(); + } + /** + * optional .chromeos_update_engine.ImageInfo new_image_info = 11; + */ + public chromeos_update_engine.UpdateMetadata.ImageInfoOrBuilder getNewImageInfoOrBuilder() { + if (newImageInfoBuilder_ != null) { + return newImageInfoBuilder_.getMessageOrBuilder(); + } else { + return newImageInfo_ == null ? + chromeos_update_engine.UpdateMetadata.ImageInfo.getDefaultInstance() : newImageInfo_; + } + } + /** + * optional .chromeos_update_engine.ImageInfo new_image_info = 11; + */ + private com.google.protobuf.SingleFieldBuilderV3< + chromeos_update_engine.UpdateMetadata.ImageInfo, chromeos_update_engine.UpdateMetadata.ImageInfo.Builder, chromeos_update_engine.UpdateMetadata.ImageInfoOrBuilder> + getNewImageInfoFieldBuilder() { + if (newImageInfoBuilder_ == null) { + newImageInfoBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + chromeos_update_engine.UpdateMetadata.ImageInfo, chromeos_update_engine.UpdateMetadata.ImageInfo.Builder, chromeos_update_engine.UpdateMetadata.ImageInfoOrBuilder>( + getNewImageInfo(), + getParentForChildren(), + isClean()); + newImageInfo_ = null; + } + return newImageInfoBuilder_; + } + + private int minorVersion_ ; + /** + *
+       * The minor version, also referred as "delta version", of the payload.
+       * Minor version 0 is full payload, everything else is delta payload.
+       * 
+ * + * optional uint32 minor_version = 12 [default = 0]; + * @return Whether the minorVersion field is set. + */ + @java.lang.Override + public boolean hasMinorVersion() { + return ((bitField0_ & 0x00000800) != 0); + } + /** + *
+       * The minor version, also referred as "delta version", of the payload.
+       * Minor version 0 is full payload, everything else is delta payload.
+       * 
+ * + * optional uint32 minor_version = 12 [default = 0]; + * @return The minorVersion. + */ + @java.lang.Override + public int getMinorVersion() { + return minorVersion_; + } + /** + *
+       * The minor version, also referred as "delta version", of the payload.
+       * Minor version 0 is full payload, everything else is delta payload.
+       * 
+ * + * optional uint32 minor_version = 12 [default = 0]; + * @param value The minorVersion to set. + * @return This builder for chaining. + */ + public Builder setMinorVersion(int value) { + bitField0_ |= 0x00000800; + minorVersion_ = value; + onChanged(); + return this; + } + /** + *
+       * The minor version, also referred as "delta version", of the payload.
+       * Minor version 0 is full payload, everything else is delta payload.
+       * 
+ * + * optional uint32 minor_version = 12 [default = 0]; + * @return This builder for chaining. + */ + public Builder clearMinorVersion() { + bitField0_ = (bitField0_ & ~0x00000800); + minorVersion_ = 0; + onChanged(); + return this; + } + + private java.util.List partitions_ = + java.util.Collections.emptyList(); + private void ensurePartitionsIsMutable() { + if (!((bitField0_ & 0x00001000) != 0)) { + partitions_ = new java.util.ArrayList(partitions_); + bitField0_ |= 0x00001000; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + chromeos_update_engine.UpdateMetadata.PartitionUpdate, chromeos_update_engine.UpdateMetadata.PartitionUpdate.Builder, chromeos_update_engine.UpdateMetadata.PartitionUpdateOrBuilder> partitionsBuilder_; + + /** + *
+       * Only present in major version >= 2. List of partitions that will be
+       * updated, in the order they will be updated. This field replaces the
+       * |install_operations|, |kernel_install_operations| and the
+       * |{old,new}_{kernel,rootfs}_info| fields used in major version = 1. This
+       * array can have more than two partitions if needed, and they are identified
+       * by the partition name.
+       * 
+ * + * repeated .chromeos_update_engine.PartitionUpdate partitions = 13; + */ + public java.util.List getPartitionsList() { + if (partitionsBuilder_ == null) { + return java.util.Collections.unmodifiableList(partitions_); + } else { + return partitionsBuilder_.getMessageList(); + } + } + /** + *
+       * Only present in major version >= 2. List of partitions that will be
+       * updated, in the order they will be updated. This field replaces the
+       * |install_operations|, |kernel_install_operations| and the
+       * |{old,new}_{kernel,rootfs}_info| fields used in major version = 1. This
+       * array can have more than two partitions if needed, and they are identified
+       * by the partition name.
+       * 
+ * + * repeated .chromeos_update_engine.PartitionUpdate partitions = 13; + */ + public int getPartitionsCount() { + if (partitionsBuilder_ == null) { + return partitions_.size(); + } else { + return partitionsBuilder_.getCount(); + } + } + /** + *
+       * Only present in major version >= 2. List of partitions that will be
+       * updated, in the order they will be updated. This field replaces the
+       * |install_operations|, |kernel_install_operations| and the
+       * |{old,new}_{kernel,rootfs}_info| fields used in major version = 1. This
+       * array can have more than two partitions if needed, and they are identified
+       * by the partition name.
+       * 
+ * + * repeated .chromeos_update_engine.PartitionUpdate partitions = 13; + */ + public chromeos_update_engine.UpdateMetadata.PartitionUpdate getPartitions(int index) { + if (partitionsBuilder_ == null) { + return partitions_.get(index); + } else { + return partitionsBuilder_.getMessage(index); + } + } + /** + *
+       * Only present in major version >= 2. List of partitions that will be
+       * updated, in the order they will be updated. This field replaces the
+       * |install_operations|, |kernel_install_operations| and the
+       * |{old,new}_{kernel,rootfs}_info| fields used in major version = 1. This
+       * array can have more than two partitions if needed, and they are identified
+       * by the partition name.
+       * 
+ * + * repeated .chromeos_update_engine.PartitionUpdate partitions = 13; + */ + public Builder setPartitions( + int index, chromeos_update_engine.UpdateMetadata.PartitionUpdate value) { + if (partitionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePartitionsIsMutable(); + partitions_.set(index, value); + onChanged(); + } else { + partitionsBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+       * Only present in major version >= 2. List of partitions that will be
+       * updated, in the order they will be updated. This field replaces the
+       * |install_operations|, |kernel_install_operations| and the
+       * |{old,new}_{kernel,rootfs}_info| fields used in major version = 1. This
+       * array can have more than two partitions if needed, and they are identified
+       * by the partition name.
+       * 
+ * + * repeated .chromeos_update_engine.PartitionUpdate partitions = 13; + */ + public Builder setPartitions( + int index, chromeos_update_engine.UpdateMetadata.PartitionUpdate.Builder builderForValue) { + if (partitionsBuilder_ == null) { + ensurePartitionsIsMutable(); + partitions_.set(index, builderForValue.build()); + onChanged(); + } else { + partitionsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+       * Only present in major version >= 2. List of partitions that will be
+       * updated, in the order they will be updated. This field replaces the
+       * |install_operations|, |kernel_install_operations| and the
+       * |{old,new}_{kernel,rootfs}_info| fields used in major version = 1. This
+       * array can have more than two partitions if needed, and they are identified
+       * by the partition name.
+       * 
+ * + * repeated .chromeos_update_engine.PartitionUpdate partitions = 13; + */ + public Builder addPartitions(chromeos_update_engine.UpdateMetadata.PartitionUpdate value) { + if (partitionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePartitionsIsMutable(); + partitions_.add(value); + onChanged(); + } else { + partitionsBuilder_.addMessage(value); + } + return this; + } + /** + *
+       * Only present in major version >= 2. List of partitions that will be
+       * updated, in the order they will be updated. This field replaces the
+       * |install_operations|, |kernel_install_operations| and the
+       * |{old,new}_{kernel,rootfs}_info| fields used in major version = 1. This
+       * array can have more than two partitions if needed, and they are identified
+       * by the partition name.
+       * 
+ * + * repeated .chromeos_update_engine.PartitionUpdate partitions = 13; + */ + public Builder addPartitions( + int index, chromeos_update_engine.UpdateMetadata.PartitionUpdate value) { + if (partitionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePartitionsIsMutable(); + partitions_.add(index, value); + onChanged(); + } else { + partitionsBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+       * Only present in major version >= 2. List of partitions that will be
+       * updated, in the order they will be updated. This field replaces the
+       * |install_operations|, |kernel_install_operations| and the
+       * |{old,new}_{kernel,rootfs}_info| fields used in major version = 1. This
+       * array can have more than two partitions if needed, and they are identified
+       * by the partition name.
+       * 
+ * + * repeated .chromeos_update_engine.PartitionUpdate partitions = 13; + */ + public Builder addPartitions( + chromeos_update_engine.UpdateMetadata.PartitionUpdate.Builder builderForValue) { + if (partitionsBuilder_ == null) { + ensurePartitionsIsMutable(); + partitions_.add(builderForValue.build()); + onChanged(); + } else { + partitionsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+       * Only present in major version >= 2. List of partitions that will be
+       * updated, in the order they will be updated. This field replaces the
+       * |install_operations|, |kernel_install_operations| and the
+       * |{old,new}_{kernel,rootfs}_info| fields used in major version = 1. This
+       * array can have more than two partitions if needed, and they are identified
+       * by the partition name.
+       * 
+ * + * repeated .chromeos_update_engine.PartitionUpdate partitions = 13; + */ + public Builder addPartitions( + int index, chromeos_update_engine.UpdateMetadata.PartitionUpdate.Builder builderForValue) { + if (partitionsBuilder_ == null) { + ensurePartitionsIsMutable(); + partitions_.add(index, builderForValue.build()); + onChanged(); + } else { + partitionsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+       * Only present in major version >= 2. List of partitions that will be
+       * updated, in the order they will be updated. This field replaces the
+       * |install_operations|, |kernel_install_operations| and the
+       * |{old,new}_{kernel,rootfs}_info| fields used in major version = 1. This
+       * array can have more than two partitions if needed, and they are identified
+       * by the partition name.
+       * 
+ * + * repeated .chromeos_update_engine.PartitionUpdate partitions = 13; + */ + public Builder addAllPartitions( + java.lang.Iterable values) { + if (partitionsBuilder_ == null) { + ensurePartitionsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, partitions_); + onChanged(); + } else { + partitionsBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+       * Only present in major version >= 2. List of partitions that will be
+       * updated, in the order they will be updated. This field replaces the
+       * |install_operations|, |kernel_install_operations| and the
+       * |{old,new}_{kernel,rootfs}_info| fields used in major version = 1. This
+       * array can have more than two partitions if needed, and they are identified
+       * by the partition name.
+       * 
+ * + * repeated .chromeos_update_engine.PartitionUpdate partitions = 13; + */ + public Builder clearPartitions() { + if (partitionsBuilder_ == null) { + partitions_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00001000); + onChanged(); + } else { + partitionsBuilder_.clear(); + } + return this; + } + /** + *
+       * Only present in major version >= 2. List of partitions that will be
+       * updated, in the order they will be updated. This field replaces the
+       * |install_operations|, |kernel_install_operations| and the
+       * |{old,new}_{kernel,rootfs}_info| fields used in major version = 1. This
+       * array can have more than two partitions if needed, and they are identified
+       * by the partition name.
+       * 
+ * + * repeated .chromeos_update_engine.PartitionUpdate partitions = 13; + */ + public Builder removePartitions(int index) { + if (partitionsBuilder_ == null) { + ensurePartitionsIsMutable(); + partitions_.remove(index); + onChanged(); + } else { + partitionsBuilder_.remove(index); + } + return this; + } + /** + *
+       * Only present in major version >= 2. List of partitions that will be
+       * updated, in the order they will be updated. This field replaces the
+       * |install_operations|, |kernel_install_operations| and the
+       * |{old,new}_{kernel,rootfs}_info| fields used in major version = 1. This
+       * array can have more than two partitions if needed, and they are identified
+       * by the partition name.
+       * 
+ * + * repeated .chromeos_update_engine.PartitionUpdate partitions = 13; + */ + public chromeos_update_engine.UpdateMetadata.PartitionUpdate.Builder getPartitionsBuilder( + int index) { + return getPartitionsFieldBuilder().getBuilder(index); + } + /** + *
+       * Only present in major version >= 2. List of partitions that will be
+       * updated, in the order they will be updated. This field replaces the
+       * |install_operations|, |kernel_install_operations| and the
+       * |{old,new}_{kernel,rootfs}_info| fields used in major version = 1. This
+       * array can have more than two partitions if needed, and they are identified
+       * by the partition name.
+       * 
+ * + * repeated .chromeos_update_engine.PartitionUpdate partitions = 13; + */ + public chromeos_update_engine.UpdateMetadata.PartitionUpdateOrBuilder getPartitionsOrBuilder( + int index) { + if (partitionsBuilder_ == null) { + return partitions_.get(index); } else { + return partitionsBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+       * Only present in major version >= 2. List of partitions that will be
+       * updated, in the order they will be updated. This field replaces the
+       * |install_operations|, |kernel_install_operations| and the
+       * |{old,new}_{kernel,rootfs}_info| fields used in major version = 1. This
+       * array can have more than two partitions if needed, and they are identified
+       * by the partition name.
+       * 
+ * + * repeated .chromeos_update_engine.PartitionUpdate partitions = 13; + */ + public java.util.List + getPartitionsOrBuilderList() { + if (partitionsBuilder_ != null) { + return partitionsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(partitions_); + } + } + /** + *
+       * Only present in major version >= 2. List of partitions that will be
+       * updated, in the order they will be updated. This field replaces the
+       * |install_operations|, |kernel_install_operations| and the
+       * |{old,new}_{kernel,rootfs}_info| fields used in major version = 1. This
+       * array can have more than two partitions if needed, and they are identified
+       * by the partition name.
+       * 
+ * + * repeated .chromeos_update_engine.PartitionUpdate partitions = 13; + */ + public chromeos_update_engine.UpdateMetadata.PartitionUpdate.Builder addPartitionsBuilder() { + return getPartitionsFieldBuilder().addBuilder( + chromeos_update_engine.UpdateMetadata.PartitionUpdate.getDefaultInstance()); + } + /** + *
+       * Only present in major version >= 2. List of partitions that will be
+       * updated, in the order they will be updated. This field replaces the
+       * |install_operations|, |kernel_install_operations| and the
+       * |{old,new}_{kernel,rootfs}_info| fields used in major version = 1. This
+       * array can have more than two partitions if needed, and they are identified
+       * by the partition name.
+       * 
+ * + * repeated .chromeos_update_engine.PartitionUpdate partitions = 13; + */ + public chromeos_update_engine.UpdateMetadata.PartitionUpdate.Builder addPartitionsBuilder( + int index) { + return getPartitionsFieldBuilder().addBuilder( + index, chromeos_update_engine.UpdateMetadata.PartitionUpdate.getDefaultInstance()); + } + /** + *
+       * Only present in major version >= 2. List of partitions that will be
+       * updated, in the order they will be updated. This field replaces the
+       * |install_operations|, |kernel_install_operations| and the
+       * |{old,new}_{kernel,rootfs}_info| fields used in major version = 1. This
+       * array can have more than two partitions if needed, and they are identified
+       * by the partition name.
+       * 
+ * + * repeated .chromeos_update_engine.PartitionUpdate partitions = 13; + */ + public java.util.List + getPartitionsBuilderList() { + return getPartitionsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + chromeos_update_engine.UpdateMetadata.PartitionUpdate, chromeos_update_engine.UpdateMetadata.PartitionUpdate.Builder, chromeos_update_engine.UpdateMetadata.PartitionUpdateOrBuilder> + getPartitionsFieldBuilder() { + if (partitionsBuilder_ == null) { + partitionsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + chromeos_update_engine.UpdateMetadata.PartitionUpdate, chromeos_update_engine.UpdateMetadata.PartitionUpdate.Builder, chromeos_update_engine.UpdateMetadata.PartitionUpdateOrBuilder>( + partitions_, + ((bitField0_ & 0x00001000) != 0), + getParentForChildren(), + isClean()); + partitions_ = null; + } + return partitionsBuilder_; + } + + private long maxTimestamp_ ; + /** + *
+       * The maximum timestamp of the OS allowed to apply this payload.
+       * Can be used to prevent downgrading the OS.
+       * 
+ * + * optional int64 max_timestamp = 14; + * @return Whether the maxTimestamp field is set. + */ + @java.lang.Override + public boolean hasMaxTimestamp() { + return ((bitField0_ & 0x00002000) != 0); + } + /** + *
+       * The maximum timestamp of the OS allowed to apply this payload.
+       * Can be used to prevent downgrading the OS.
+       * 
+ * + * optional int64 max_timestamp = 14; + * @return The maxTimestamp. + */ + @java.lang.Override + public long getMaxTimestamp() { + return maxTimestamp_; + } + /** + *
+       * The maximum timestamp of the OS allowed to apply this payload.
+       * Can be used to prevent downgrading the OS.
+       * 
+ * + * optional int64 max_timestamp = 14; + * @param value The maxTimestamp to set. + * @return This builder for chaining. + */ + public Builder setMaxTimestamp(long value) { + bitField0_ |= 0x00002000; + maxTimestamp_ = value; + onChanged(); + return this; + } + /** + *
+       * The maximum timestamp of the OS allowed to apply this payload.
+       * Can be used to prevent downgrading the OS.
+       * 
+ * + * optional int64 max_timestamp = 14; + * @return This builder for chaining. + */ + public Builder clearMaxTimestamp() { + bitField0_ = (bitField0_ & ~0x00002000); + maxTimestamp_ = 0L; + onChanged(); + return this; + } + + private chromeos_update_engine.UpdateMetadata.DynamicPartitionMetadata dynamicPartitionMetadata_; + private com.google.protobuf.SingleFieldBuilderV3< + chromeos_update_engine.UpdateMetadata.DynamicPartitionMetadata, chromeos_update_engine.UpdateMetadata.DynamicPartitionMetadata.Builder, chromeos_update_engine.UpdateMetadata.DynamicPartitionMetadataOrBuilder> dynamicPartitionMetadataBuilder_; + /** + *
+       * Metadata related to all dynamic partitions.
+       * 
+ * + * optional .chromeos_update_engine.DynamicPartitionMetadata dynamic_partition_metadata = 15; + * @return Whether the dynamicPartitionMetadata field is set. + */ + public boolean hasDynamicPartitionMetadata() { + return ((bitField0_ & 0x00004000) != 0); + } + /** + *
+       * Metadata related to all dynamic partitions.
+       * 
+ * + * optional .chromeos_update_engine.DynamicPartitionMetadata dynamic_partition_metadata = 15; + * @return The dynamicPartitionMetadata. + */ + public chromeos_update_engine.UpdateMetadata.DynamicPartitionMetadata getDynamicPartitionMetadata() { + if (dynamicPartitionMetadataBuilder_ == null) { + return dynamicPartitionMetadata_ == null ? chromeos_update_engine.UpdateMetadata.DynamicPartitionMetadata.getDefaultInstance() : dynamicPartitionMetadata_; + } else { + return dynamicPartitionMetadataBuilder_.getMessage(); + } + } + /** + *
+       * Metadata related to all dynamic partitions.
+       * 
+ * + * optional .chromeos_update_engine.DynamicPartitionMetadata dynamic_partition_metadata = 15; + */ + public Builder setDynamicPartitionMetadata(chromeos_update_engine.UpdateMetadata.DynamicPartitionMetadata value) { + if (dynamicPartitionMetadataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + dynamicPartitionMetadata_ = value; + onChanged(); + } else { + dynamicPartitionMetadataBuilder_.setMessage(value); + } + bitField0_ |= 0x00004000; + return this; + } + /** + *
+       * Metadata related to all dynamic partitions.
+       * 
+ * + * optional .chromeos_update_engine.DynamicPartitionMetadata dynamic_partition_metadata = 15; + */ + public Builder setDynamicPartitionMetadata( + chromeos_update_engine.UpdateMetadata.DynamicPartitionMetadata.Builder builderForValue) { + if (dynamicPartitionMetadataBuilder_ == null) { + dynamicPartitionMetadata_ = builderForValue.build(); + onChanged(); + } else { + dynamicPartitionMetadataBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00004000; + return this; + } + /** + *
+       * Metadata related to all dynamic partitions.
+       * 
+ * + * optional .chromeos_update_engine.DynamicPartitionMetadata dynamic_partition_metadata = 15; + */ + public Builder mergeDynamicPartitionMetadata(chromeos_update_engine.UpdateMetadata.DynamicPartitionMetadata value) { + if (dynamicPartitionMetadataBuilder_ == null) { + if (((bitField0_ & 0x00004000) != 0) && + dynamicPartitionMetadata_ != null && + dynamicPartitionMetadata_ != chromeos_update_engine.UpdateMetadata.DynamicPartitionMetadata.getDefaultInstance()) { + dynamicPartitionMetadata_ = + chromeos_update_engine.UpdateMetadata.DynamicPartitionMetadata.newBuilder(dynamicPartitionMetadata_).mergeFrom(value).buildPartial(); + } else { + dynamicPartitionMetadata_ = value; + } + onChanged(); + } else { + dynamicPartitionMetadataBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00004000; + return this; + } + /** + *
+       * Metadata related to all dynamic partitions.
+       * 
+ * + * optional .chromeos_update_engine.DynamicPartitionMetadata dynamic_partition_metadata = 15; + */ + public Builder clearDynamicPartitionMetadata() { + if (dynamicPartitionMetadataBuilder_ == null) { + dynamicPartitionMetadata_ = null; + onChanged(); + } else { + dynamicPartitionMetadataBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00004000); + return this; + } + /** + *
+       * Metadata related to all dynamic partitions.
+       * 
+ * + * optional .chromeos_update_engine.DynamicPartitionMetadata dynamic_partition_metadata = 15; + */ + public chromeos_update_engine.UpdateMetadata.DynamicPartitionMetadata.Builder getDynamicPartitionMetadataBuilder() { + bitField0_ |= 0x00004000; + onChanged(); + return getDynamicPartitionMetadataFieldBuilder().getBuilder(); + } + /** + *
+       * Metadata related to all dynamic partitions.
+       * 
+ * + * optional .chromeos_update_engine.DynamicPartitionMetadata dynamic_partition_metadata = 15; + */ + public chromeos_update_engine.UpdateMetadata.DynamicPartitionMetadataOrBuilder getDynamicPartitionMetadataOrBuilder() { + if (dynamicPartitionMetadataBuilder_ != null) { + return dynamicPartitionMetadataBuilder_.getMessageOrBuilder(); + } else { + return dynamicPartitionMetadata_ == null ? + chromeos_update_engine.UpdateMetadata.DynamicPartitionMetadata.getDefaultInstance() : dynamicPartitionMetadata_; + } + } + /** + *
+       * Metadata related to all dynamic partitions.
+       * 
+ * + * optional .chromeos_update_engine.DynamicPartitionMetadata dynamic_partition_metadata = 15; + */ + private com.google.protobuf.SingleFieldBuilderV3< + chromeos_update_engine.UpdateMetadata.DynamicPartitionMetadata, chromeos_update_engine.UpdateMetadata.DynamicPartitionMetadata.Builder, chromeos_update_engine.UpdateMetadata.DynamicPartitionMetadataOrBuilder> + getDynamicPartitionMetadataFieldBuilder() { + if (dynamicPartitionMetadataBuilder_ == null) { + dynamicPartitionMetadataBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + chromeos_update_engine.UpdateMetadata.DynamicPartitionMetadata, chromeos_update_engine.UpdateMetadata.DynamicPartitionMetadata.Builder, chromeos_update_engine.UpdateMetadata.DynamicPartitionMetadataOrBuilder>( + getDynamicPartitionMetadata(), + getParentForChildren(), + isClean()); + dynamicPartitionMetadata_ = null; + } + return dynamicPartitionMetadataBuilder_; + } + + private boolean partialUpdate_ ; + /** + *
+       * If the payload only updates a subset of partitions on the device.
+       * 
+ * + * optional bool partial_update = 16; + * @return Whether the partialUpdate field is set. + */ + @java.lang.Override + public boolean hasPartialUpdate() { + return ((bitField0_ & 0x00008000) != 0); + } + /** + *
+       * If the payload only updates a subset of partitions on the device.
+       * 
+ * + * optional bool partial_update = 16; + * @return The partialUpdate. + */ + @java.lang.Override + public boolean getPartialUpdate() { + return partialUpdate_; + } + /** + *
+       * If the payload only updates a subset of partitions on the device.
+       * 
+ * + * optional bool partial_update = 16; + * @param value The partialUpdate to set. + * @return This builder for chaining. + */ + public Builder setPartialUpdate(boolean value) { + bitField0_ |= 0x00008000; + partialUpdate_ = value; + onChanged(); + return this; + } + /** + *
+       * If the payload only updates a subset of partitions on the device.
+       * 
+ * + * optional bool partial_update = 16; + * @return This builder for chaining. + */ + public Builder clearPartialUpdate() { + bitField0_ = (bitField0_ & ~0x00008000); + partialUpdate_ = false; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:chromeos_update_engine.DeltaArchiveManifest) + } + + // @@protoc_insertion_point(class_scope:chromeos_update_engine.DeltaArchiveManifest) + private static final chromeos_update_engine.UpdateMetadata.DeltaArchiveManifest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new chromeos_update_engine.UpdateMetadata.DeltaArchiveManifest(); + } + + public static chromeos_update_engine.UpdateMetadata.DeltaArchiveManifest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @java.lang.Deprecated public static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeltaArchiveManifest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DeltaArchiveManifest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public chromeos_update_engine.UpdateMetadata.DeltaArchiveManifest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_chromeos_update_engine_Extent_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_chromeos_update_engine_Extent_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_chromeos_update_engine_Signatures_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_chromeos_update_engine_Signatures_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_chromeos_update_engine_Signatures_Signature_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_chromeos_update_engine_Signatures_Signature_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_chromeos_update_engine_PartitionInfo_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_chromeos_update_engine_PartitionInfo_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_chromeos_update_engine_ImageInfo_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_chromeos_update_engine_ImageInfo_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_chromeos_update_engine_InstallOperation_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_chromeos_update_engine_InstallOperation_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_chromeos_update_engine_PartitionUpdate_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_chromeos_update_engine_PartitionUpdate_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_chromeos_update_engine_DynamicPartitionGroup_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_chromeos_update_engine_DynamicPartitionGroup_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_chromeos_update_engine_DynamicPartitionMetadata_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_chromeos_update_engine_DynamicPartitionMetadata_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_chromeos_update_engine_DeltaArchiveManifest_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_chromeos_update_engine_DeltaArchiveManifest_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\025update_metadata.proto\022\026chromeos_update" + + "_engine\"1\n\006Extent\022\023\n\013start_block\030\001 \001(\004\022\022" + + "\n\nnum_blocks\030\002 \001(\004\"\237\001\n\nSignatures\022@\n\nsig" + + "natures\030\001 \003(\0132,.chromeos_update_engine.S" + + "ignatures.Signature\032O\n\tSignature\022\023\n\007vers" + + "ion\030\001 \001(\rB\002\030\001\022\014\n\004data\030\002 \001(\014\022\037\n\027unpadded_" + + "signature_size\030\003 \001(\007\"+\n\rPartitionInfo\022\014\n" + + "\004size\030\001 \001(\004\022\014\n\004hash\030\002 \001(\014\"w\n\tImageInfo\022\r" + + "\n\005board\030\001 \001(\t\022\013\n\003key\030\002 \001(\t\022\017\n\007channel\030\003 " + + "\001(\t\022\017\n\007version\030\004 \001(\t\022\025\n\rbuild_channel\030\005 " + + "\001(\t\022\025\n\rbuild_version\030\006 \001(\t\"\356\003\n\020InstallOp" + + "eration\022;\n\004type\030\001 \002(\0162-.chromeos_update_" + + "engine.InstallOperation.Type\022\023\n\013data_off" + + "set\030\002 \001(\004\022\023\n\013data_length\030\003 \001(\004\0223\n\013src_ex" + + "tents\030\004 \003(\0132\036.chromeos_update_engine.Ext" + + "ent\022\022\n\nsrc_length\030\005 \001(\004\0223\n\013dst_extents\030\006" + + " \003(\0132\036.chromeos_update_engine.Extent\022\022\n\n" + + "dst_length\030\007 \001(\004\022\030\n\020data_sha256_hash\030\010 \001" + + "(\014\022\027\n\017src_sha256_hash\030\t \001(\014\"\255\001\n\004Type\022\013\n\007" + + "REPLACE\020\000\022\016\n\nREPLACE_BZ\020\001\022\014\n\004MOVE\020\002\032\002\010\001\022" + + "\016\n\006BSDIFF\020\003\032\002\010\001\022\017\n\013SOURCE_COPY\020\004\022\021\n\rSOUR" + + "CE_BSDIFF\020\005\022\016\n\nREPLACE_XZ\020\010\022\010\n\004ZERO\020\006\022\013\n" + + "\007DISCARD\020\007\022\021\n\rBROTLI_BSDIFF\020\n\022\014\n\010PUFFDIF" + + "F\020\t\"\327\005\n\017PartitionUpdate\022\026\n\016partition_nam" + + "e\030\001 \002(\t\022\027\n\017run_postinstall\030\002 \001(\010\022\030\n\020post" + + "install_path\030\003 \001(\t\022\027\n\017filesystem_type\030\004 " + + "\001(\t\022M\n\027new_partition_signature\030\005 \003(\0132,.c" + + "hromeos_update_engine.Signatures.Signatu" + + "re\022A\n\022old_partition_info\030\006 \001(\0132%.chromeo" + + "s_update_engine.PartitionInfo\022A\n\022new_par" + + "tition_info\030\007 \001(\0132%.chromeos_update_engi" + + "ne.PartitionInfo\022<\n\noperations\030\010 \003(\0132(.c" + + "hromeos_update_engine.InstallOperation\022\034" + + "\n\024postinstall_optional\030\t \001(\010\022=\n\025hash_tre" + + "e_data_extent\030\n \001(\0132\036.chromeos_update_en" + + "gine.Extent\0228\n\020hash_tree_extent\030\013 \001(\0132\036." + + "chromeos_update_engine.Extent\022\033\n\023hash_tr" + + "ee_algorithm\030\014 \001(\t\022\026\n\016hash_tree_salt\030\r \001" + + "(\014\0227\n\017fec_data_extent\030\016 \001(\0132\036.chromeos_u" + + "pdate_engine.Extent\0222\n\nfec_extent\030\017 \001(\0132" + + "\036.chromeos_update_engine.Extent\022\024\n\tfec_r" + + "oots\030\020 \001(\r:\0012\"L\n\025DynamicPartitionGroup\022\014" + + "\n\004name\030\001 \002(\t\022\014\n\004size\030\002 \001(\004\022\027\n\017partition_" + + "names\030\003 \003(\t\"s\n\030DynamicPartitionMetadata\022" + + "=\n\006groups\030\001 \003(\0132-.chromeos_update_engine" + + ".DynamicPartitionGroup\022\030\n\020snapshot_enabl" + + "ed\030\002 \001(\010\"\311\006\n\024DeltaArchiveManifest\022D\n\022ins" + + "tall_operations\030\001 \003(\0132(.chromeos_update_" + + "engine.InstallOperation\022K\n\031kernel_instal" + + "l_operations\030\002 \003(\0132(.chromeos_update_eng" + + "ine.InstallOperation\022\030\n\nblock_size\030\003 \001(\r" + + ":\0044096\022\031\n\021signatures_offset\030\004 \001(\004\022\027\n\017sig" + + "natures_size\030\005 \001(\004\022>\n\017old_kernel_info\030\006 " + + "\001(\0132%.chromeos_update_engine.PartitionIn" + + "fo\022>\n\017new_kernel_info\030\007 \001(\0132%.chromeos_u" + + "pdate_engine.PartitionInfo\022>\n\017old_rootfs" + + "_info\030\010 \001(\0132%.chromeos_update_engine.Par" + + "titionInfo\022>\n\017new_rootfs_info\030\t \001(\0132%.ch" + + "romeos_update_engine.PartitionInfo\0229\n\016ol" + + "d_image_info\030\n \001(\0132!.chromeos_update_eng" + + "ine.ImageInfo\0229\n\016new_image_info\030\013 \001(\0132!." + + "chromeos_update_engine.ImageInfo\022\030\n\rmino" + + "r_version\030\014 \001(\r:\0010\022;\n\npartitions\030\r \003(\0132\'" + + ".chromeos_update_engine.PartitionUpdate\022" + + "\025\n\rmax_timestamp\030\016 \001(\003\022T\n\032dynamic_partit" + + "ion_metadata\030\017 \001(\01320.chromeos_update_eng" + + "ine.DynamicPartitionMetadata\022\026\n\016partial_" + + "update\030\020 \001(\010B\002H\003" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }); + internal_static_chromeos_update_engine_Extent_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_chromeos_update_engine_Extent_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_chromeos_update_engine_Extent_descriptor, + new java.lang.String[] { "StartBlock", "NumBlocks", }); + internal_static_chromeos_update_engine_Signatures_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_chromeos_update_engine_Signatures_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_chromeos_update_engine_Signatures_descriptor, + new java.lang.String[] { "Signatures", }); + internal_static_chromeos_update_engine_Signatures_Signature_descriptor = + internal_static_chromeos_update_engine_Signatures_descriptor.getNestedTypes().get(0); + internal_static_chromeos_update_engine_Signatures_Signature_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_chromeos_update_engine_Signatures_Signature_descriptor, + new java.lang.String[] { "Version", "Data", "UnpaddedSignatureSize", }); + internal_static_chromeos_update_engine_PartitionInfo_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_chromeos_update_engine_PartitionInfo_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_chromeos_update_engine_PartitionInfo_descriptor, + new java.lang.String[] { "Size", "Hash", }); + internal_static_chromeos_update_engine_ImageInfo_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_chromeos_update_engine_ImageInfo_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_chromeos_update_engine_ImageInfo_descriptor, + new java.lang.String[] { "Board", "Key", "Channel", "Version", "BuildChannel", "BuildVersion", }); + internal_static_chromeos_update_engine_InstallOperation_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_chromeos_update_engine_InstallOperation_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_chromeos_update_engine_InstallOperation_descriptor, + new java.lang.String[] { "Type", "DataOffset", "DataLength", "SrcExtents", "SrcLength", "DstExtents", "DstLength", "DataSha256Hash", "SrcSha256Hash", }); + internal_static_chromeos_update_engine_PartitionUpdate_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_chromeos_update_engine_PartitionUpdate_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_chromeos_update_engine_PartitionUpdate_descriptor, + new java.lang.String[] { "PartitionName", "RunPostinstall", "PostinstallPath", "FilesystemType", "NewPartitionSignature", "OldPartitionInfo", "NewPartitionInfo", "Operations", "PostinstallOptional", "HashTreeDataExtent", "HashTreeExtent", "HashTreeAlgorithm", "HashTreeSalt", "FecDataExtent", "FecExtent", "FecRoots", }); + internal_static_chromeos_update_engine_DynamicPartitionGroup_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_chromeos_update_engine_DynamicPartitionGroup_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_chromeos_update_engine_DynamicPartitionGroup_descriptor, + new java.lang.String[] { "Name", "Size", "PartitionNames", }); + internal_static_chromeos_update_engine_DynamicPartitionMetadata_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_chromeos_update_engine_DynamicPartitionMetadata_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_chromeos_update_engine_DynamicPartitionMetadata_descriptor, + new java.lang.String[] { "Groups", "SnapshotEnabled", }); + internal_static_chromeos_update_engine_DeltaArchiveManifest_descriptor = + getDescriptor().getMessageTypes().get(8); + internal_static_chromeos_update_engine_DeltaArchiveManifest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_chromeos_update_engine_DeltaArchiveManifest_descriptor, + new java.lang.String[] { "InstallOperations", "KernelInstallOperations", "BlockSize", "SignaturesOffset", "SignaturesSize", "OldKernelInfo", "NewKernelInfo", "OldRootfsInfo", "NewRootfsInfo", "OldImageInfo", "NewImageInfo", "MinorVersion", "Partitions", "MaxTimestamp", "DynamicPartitionMetadata", "PartialUpdate", }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/bbootimg/src/main/kotlin/avb/Avb.kt b/bbootimg/src/main/kotlin/avb/Avb.kt index df34c5b..e4d146b 100644 --- a/bbootimg/src/main/kotlin/avb/Avb.kt +++ b/bbootimg/src/main/kotlin/avb/Avb.kt @@ -73,7 +73,7 @@ class Avb { } // image + padding - val imgPaddingNeeded = Helper.round_to_multiple(newImageSize, BLOCK_SIZE) - newImageSize + val imgPaddingNeeded = Helper.round_to_multiple(newImageSize.toInt(), BLOCK_SIZE) - newImageSize // + vbmeta + padding val vbmetaBlob = newAvbInfo.encode() diff --git a/bbootimg/src/main/kotlin/avb/blob/AuthBlob.kt b/bbootimg/src/main/kotlin/avb/blob/AuthBlob.kt index ac677c6..b7fa72e 100644 --- a/bbootimg/src/main/kotlin/avb/blob/AuthBlob.kt +++ b/bbootimg/src/main/kotlin/avb/blob/AuthBlob.kt @@ -41,7 +41,7 @@ data class AuthBlob( log.debug("calc hash: NONE") byteArrayOf() } else { - MessageDigest.getInstance(Helper.pyAlg2java(alg.hash_name)).apply { + MessageDigest.getInstance(CryptoHelper.Hasher.pyAlg2java(alg.hash_name)).apply { update(header_data_blob) update(aux_data_blob) }.digest().apply { diff --git a/bbootimg/src/main/kotlin/avb/desc/HashDescriptor.kt b/bbootimg/src/main/kotlin/avb/desc/HashDescriptor.kt index 8feed6b..4c932c6 100644 --- a/bbootimg/src/main/kotlin/avb/desc/HashDescriptor.kt +++ b/bbootimg/src/main/kotlin/avb/desc/HashDescriptor.kt @@ -17,6 +17,7 @@ package avb.desc import avb.blob.Header import cfig.helper.Helper import cc.cfig.io.Struct +import cfig.helper.CryptoHelper.Hasher import org.apache.commons.codec.binary.Hex import org.slf4j.LoggerFactory import java.io.File @@ -88,7 +89,7 @@ class HashDescriptor(var flags: Int = 0, val ret: Array = arrayOf(false, "file not found") for (item in image_files) { if (File(item).exists()) { - val hasher = MessageDigest.getInstance(Helper.pyAlg2java(hash_algorithm)) + val hasher = MessageDigest.getInstance(Hasher.pyAlg2java(hash_algorithm)) hasher.update(this.salt) FileInputStream(item).use { fis -> val data = ByteArray(this.image_size.toInt()) @@ -112,7 +113,7 @@ class HashDescriptor(var flags: Int = 0, //salt if (this.salt.isEmpty()) { //If salt is not explicitly specified, choose a hash that's the same size as the hash size - val expectedDigestSize = MessageDigest.getInstance(Helper.pyAlg2java(hash_algorithm)).digest().size + val expectedDigestSize = MessageDigest.getInstance(Hasher.pyAlg2java(hash_algorithm)).digest().size FileInputStream(File("/dev/urandom")).use { val randomSalt = ByteArray(expectedDigestSize) it.read(randomSalt) @@ -136,7 +137,7 @@ class HashDescriptor(var flags: Int = 0, if (!use_persistent_digest) { //hash digest - val newDigest = MessageDigest.getInstance(Helper.pyAlg2java(hash_algorithm)).apply { + val newDigest = MessageDigest.getInstance(Hasher.pyAlg2java(hash_algorithm)).apply { update(salt) update(File(image_file).readBytes()) }.digest() diff --git a/bbootimg/src/main/kotlin/avb/desc/HashTreeDescriptor.kt b/bbootimg/src/main/kotlin/avb/desc/HashTreeDescriptor.kt index fcea621..a410024 100644 --- a/bbootimg/src/main/kotlin/avb/desc/HashTreeDescriptor.kt +++ b/bbootimg/src/main/kotlin/avb/desc/HashTreeDescriptor.kt @@ -143,7 +143,7 @@ class HashTreeDescriptor( private fun calcStreamHashSize(inStreamSize: Long, inBlockSize: Int): Long { val blockCount = (inStreamSize + inBlockSize - 1) / inBlockSize - return Helper.round_to_multiple(blockCount * calcSingleHashSize(true), inBlockSize) + return Helper.round_to_multiple(blockCount * calcSingleHashSize(true), inBlockSize.toLong()) } fun hashStream( @@ -266,7 +266,7 @@ class HashTreeDescriptor( break } //digest size in page of blockSize - val hashSize = Helper.round_to_multiple(blockCount * digestSize, blockSize) + val hashSize = Helper.round_to_multiple(blockCount * digestSize, blockSize.toLong()) tree.add(0, MerkleTree(levelDataSize, blockCount, hashSize)) levelDataSize = hashSize levelNo++ diff --git a/bbootimg/src/main/kotlin/bootimg/v2/BootHeaderV2.kt b/bbootimg/src/main/kotlin/bootimg/v2/BootHeaderV2.kt index 76bcade..59d6c78 100644 --- a/bbootimg/src/main/kotlin/bootimg/v2/BootHeaderV2.kt +++ b/bbootimg/src/main/kotlin/bootimg/v2/BootHeaderV2.kt @@ -99,7 +99,7 @@ open class BootHeaderV2( } private fun get_recovery_dtbo_offset(): Long { - return Helper.round_to_multiple(this.headerSize.toLong(), pageSize) + + return Helper.round_to_multiple(this.headerSize.toLong(), pageSize.toLong()) + Helper.round_to_multiple(this.kernelLength, pageSize) + Helper.round_to_multiple(this.ramdiskLength, pageSize) + Helper.round_to_multiple(this.secondBootloaderLength, pageSize) diff --git a/bbootimg/src/main/kotlin/bootimg/v3/VendorBoot.kt b/bbootimg/src/main/kotlin/bootimg/v3/VendorBoot.kt index a2c6c08..d39aad0 100644 --- a/bbootimg/src/main/kotlin/bootimg/v3/VendorBoot.kt +++ b/bbootimg/src/main/kotlin/bootimg/v3/VendorBoot.kt @@ -173,8 +173,8 @@ data class VendorBoot( ret.ramdisk.size = header.vndRamdiskTotalSize ret.ramdisk.loadAddr = header.ramdiskLoadAddr ret.ramdisk.position = Helper.round_to_multiple( - VendorBootHeader.VENDOR_BOOT_IMAGE_HEADER_V3_SIZE.toLong(), header.pageSize - ) + VendorBootHeader.VENDOR_BOOT_IMAGE_HEADER_V3_SIZE, header.pageSize + ).toLong() //dtb ret.dtb.file = workDir + "dtb" ret.dtb.size = header.dtbSize diff --git a/bbootimg/src/main/kotlin/ota/BrilloProp.kt b/bbootimg/src/main/kotlin/ota/BrilloProp.kt new file mode 100644 index 0000000..e4f3032 --- /dev/null +++ b/bbootimg/src/main/kotlin/ota/BrilloProp.kt @@ -0,0 +1,65 @@ +// Copyright 2022 yuyezhong@gmail.com +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package cc.cfig.droid.ota + +import cfig.helper.ZipHelper.Companion.getEntryOffset +import org.apache.commons.compress.archivers.zip.ZipFile +import org.slf4j.LoggerFactory +import java.io.File + +// tuple(name, offset, size) of an zip entry +class BrilloProp( + var name: String, + var offset: Long, + var size: Long +) { + constructor(zf: ZipFile, entryName: String) : this("", 0, 0) { + val entry = zf.getEntry(entryName) + name = File(entryName).name + offset = entry.getEntryOffset() + size = entry.size + log.debug("extra size = " + entry.localFileDataExtra.size) + log.debug("file name len = " + entry.name.length) + } + + companion object { + private val log = LoggerFactory.getLogger(BrilloProp::class.java) + } + + override fun toString(): String { + return if (offset == 0L && size == 0L) { + name + " ".repeat(15) + } else { + "$name:$offset:$size" + } + } + + override fun equals(other: Any?): Boolean { + if (this === other) return true + if (javaClass != other?.javaClass) return false + other as BrilloProp + if (name != other.name) return false + if (offset != other.offset) return false + if (size != other.size) return false + return true + } + + override fun hashCode(): Int { + var result = name.hashCode() + result = 31 * result + offset.hashCode() + result = 31 * result + size.hashCode() + return result + } +} diff --git a/bbootimg/src/main/kotlin/ota/BrilloPropString.kt b/bbootimg/src/main/kotlin/ota/BrilloPropString.kt new file mode 100644 index 0000000..7077348 --- /dev/null +++ b/bbootimg/src/main/kotlin/ota/BrilloPropString.kt @@ -0,0 +1,168 @@ +// Copyright 2022 yuyezhong@gmail.com +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package cc.cfig.droid.ota + +import cc.cfig.io.Struct +import cfig.helper.ZipHelper +import cfig.helper.ZipHelper.Companion.getEntryOffset +import org.apache.commons.compress.archivers.zip.ZipFile +import org.slf4j.LoggerFactory +import java.io.File +import java.lang.IllegalArgumentException +import java.util.* + +open class BrilloPropString { + open val name: String = "" + open val required: MutableList = mutableListOf() + open val optional: MutableList = mutableListOf() + + companion object { + private val log = LoggerFactory.getLogger(BrilloPropString::class.qualifiedName) + const val metaDataName = "META-INF/com/android/metadata" + + fun Properties.toBrilloString(): String { + val metaValueList = this.map { "${it.key}=${it.value}\n" }.sorted() + return metaValueList.reduce { acc, s -> "$acc$s" } + } + + fun computeAllPropertyStrings(fileName: String, inPropertyStrings: List): Properties { + return Properties().let { metadata -> + inPropertyStrings.forEach { + metadata[it.name] = it.preCompute(fileName) + } + metadata + } + } + + fun finalizeAllPropertyFiles( + fileName: String, + inPropertyStrings: List, + preComputed: Properties + ): Properties { + val metadata = Properties() + val zf = ZipFile(fileName) + inPropertyStrings.forEach { + metadata[it.name] = it.postCompute(fileName, (preComputed[it.name] as String).length) + } + zf.close() + return metadata + } + + fun rmMetaData(fileName: String) { + ZipFile(fileName).use { zf -> + val metadataEntry = zf.getEntry(metaDataName) + if (metadataEntry != null) { + log.info("$metaDataName exists, needs to be erased") + ZipHelper.zipDelete(File(fileName), metaDataName) + } else { + log.info("$metaDataName doesn't exist") + } + } + } + } + + /* + pre-compute: with mimiced "metadata" + */ + fun preCompute(fileName: String): String { + return this.fromZipFile(fileName, reserveSpace = true) + } + + /* + finalize return string with padding spaces + */ + fun postCompute(fileName: String, reservedLen: Int): String { + val result = fromZipFile(fileName, reserveSpace = false) + if (result.length > reservedLen) { + throw IllegalArgumentException("Insufficient reserved space: reserved=$reservedLen, actual=${result.length}") + } + return result + " ".repeat(reservedLen - result.length) + } + + fun verify(fileName: String, expected: String) { + log.info("verifying $fileName:${this.name} ...") + val actual = fromZipFile(fileName, reserveSpace = false) + if (actual != expected.trim()) { + throw RuntimeException("Mismatching streaming metadata: [$actual] vs [$expected]") + } else { + log.info("Verified $fileName:${this.name} against [$expected]") + } + } + + private fun fromZipFile(fileName: String, reserveSpace: Boolean = false): String { + ZipFile(fileName).use { zf -> + val token: MutableList = computePrivateProps(fileName) + this.required.forEach { + token.add(BrilloProp(zf, it)) + } + this.optional.filter { zf.getEntry(it) != null }.forEach { + token.add(BrilloProp(zf, it)) + } + if (reserveSpace) { + token.add(BrilloProp("metadata", 0L, 0L)) + } else { + log.info("$metaDataName is " + BrilloProp(zf, metaDataName).toString()) + token.add(BrilloProp(zf, metaDataName)) + } + val ret = token.map { it.toString() }.reduce { acc, s -> "$acc,$s" } + log.info("fromZipFile($fileName) = [$ret]") + return ret + } + } + + open fun computePrivateProps(fileName: String): MutableList { + return mutableListOf() + } +} + +open class StreamingBrilloPropString : BrilloPropString() { + override val name: String = "ota-streaming-property-files" + override val required: MutableList = mutableListOf("payload.bin", "payload_properties.txt") + + //care_map is available only if dm-verity is enabled + //compatibility.zip is available only if target supports Treble + override val optional: MutableList = mutableListOf("care_map.pb", "care_map.txt", "compatibility.zip") +} + +class NonAbBrilloPropString : BrilloPropString() { + override val name: String = "ota-property-files" +} + +/* + AbBrilloPropString will replace StreamingBrilloPropString after P-timeframe + */ +@OptIn(ExperimentalUnsignedTypes::class) +class AbBrilloPropString : StreamingBrilloPropString() { + override val name: String = "ota-property-files" + + override fun computePrivateProps(fileName: String): MutableList { + ZipFile(fileName).use { zf -> + val pb = zf.getEntry("payload.bin") + val headerFormat = Struct("!IQQL") + val header = headerFormat.unpack(zf.getInputStream(pb)) + val magic = header[0] as UInt + val manifestSize = header[2] as ULong + val metaSigSize = header[3] as UInt + if (0x43724155U != magic) {//'CrAU' + throw IllegalArgumentException("Invalid magic 0x" + magic.toString(16)) + } + val metaTotal = headerFormat.calcSize().toULong() + manifestSize + metaSigSize + if (metaTotal >= pb.size.toUInt()) { + throw IllegalArgumentException("metadata total size >= payload size") + } + return mutableListOf(BrilloProp("payload_metadata.bin", pb.getEntryOffset(), metaTotal.toLong())) + } + } +} diff --git a/bbootimg/src/main/kotlin/ota/Common.kt b/bbootimg/src/main/kotlin/ota/Common.kt new file mode 100644 index 0000000..bc83572 --- /dev/null +++ b/bbootimg/src/main/kotlin/ota/Common.kt @@ -0,0 +1,157 @@ +// Copyright 2022 yuyezhong@gmail.com +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +package cc.cfig.droid.ota + +import org.apache.commons.compress.archivers.zip.ZipFile +import org.slf4j.LoggerFactory +import java.io.InputStream +import java.nio.charset.StandardCharsets +import java.util.* + +class Common { + companion object { + private val log = LoggerFactory.getLogger(Common::class.java) + private val PARTITIONS_WITH_CARE_MAP = + mutableListOf("system", "vendor", "product", "system_ext", "odm", "vendor_dlkm", "odm_dlkm") + val PARTITIONS_WITH_BUILD_PROP = PARTITIONS_WITH_CARE_MAP.apply { add("boot") } + + private fun getEntryStream(zipFile: ZipFile, entryName: String): InputStream { + return zipFile.getInputStream(zipFile.getEntry(entryName)) + } + + fun Properties.getBuildProp(k: String): String? { + return (this.get("build.prop") as Properties).getProperty(k) + } + + fun loadInfoDict(fileName: String): Properties { + val d = Properties() + ZipFile(fileName).use { zf -> + log.info("loading META/misc_info.txt ...") + //1: misc_info.txt + d.load(getEntryStream(zf, "META/misc_info.txt")) + if (null == d.getProperty("recovery_api_version")) { + throw IllegalArgumentException("Failed to find 'recovery_api_version'") + } + if (null == d.getProperty("fstab_version")) { + throw IllegalArgumentException("Failed to find 'fstab_version'") + } + if ("true" == d.getProperty("system_root_image")) { + throw IllegalArgumentException("BOARD_BUILD_SYSTEM_ROOT_IMAGE no longer supported") + } + val recoveryFstabPath = "BOOT/RAMDISK/system/etc/recovery.fstab" + val recoveryFstabPath2 = "VENDOR_BOOT/RAMDISK/system/etc/recovery.fstab" + val validFstab = if (zf.getEntry(recoveryFstabPath) != null) { + recoveryFstabPath + } else { + recoveryFstabPath2 + } + //2: .fstab + d.put("fstab", loadRecoveryFstab(zf, validFstab, false)) + + //load all build.prop + PARTITIONS_WITH_BUILD_PROP.forEach { part -> + val subProps = Properties() + if (part == "boot") { + arrayOf("BOOT/RAMDISK/system/etc/ramdisk/build.prop", + "BOOT/RAMDISK/prop.default").forEach { bootBuildProp -> + zf.getEntry(bootBuildProp)?.let { entry -> + log.info("loading /$bootBuildProp ...") + subProps.load(zf.getInputStream(entry)) + } + } + } else { + zf.getEntry("${part.uppercase(Locale.getDefault())}/build.prop")?.let { entry -> + log.info("loading /$part/build.prop ...") + subProps.load(zf.getInputStream(entry)) + } + zf.getEntry("${part.uppercase(Locale.getDefault())}/etc/build.prop")?.let { entry -> + log.info("loading /$part/etc/build.prop ...") + subProps.load(zf.getInputStream(entry)) + } + } + //3: .$part.build.prop + d.put("$part.build.prop", subProps) + } + //4: .build.prop == .system.build.prop + log.info("duplicating system.build.prop -> build.prop") + d.put("build.prop", d.get("system.build.prop")) + } + if (d.get("avb_enable") == "true") { + // 5: avb related + (d.get("build.prop") as Properties).let { buildprop -> + var fp: String? + fp = buildprop.get("ro.build.fingerprint") as String? + if (fp == null) { + fp = buildprop.get("ro.build.thumbprint") as String? + } + fp?.let { + log.warn("adding avb_salt from fingerprint ...") + d.put("avb_salt", "fp") + } + } + } + return d + } + + private fun loadRecoveryFstab(zf: ZipFile, fstabPath: String, bSystemRoot: Boolean = false) { + class Partition( + var mount_point: String = "", + var fs_type: String = "", + var device: String = "", + var length: Long = 0, + var selinuxContext: String = "", + ) + log.info("loading $fstabPath ...") + val ret: MutableMap = mutableMapOf() + val rs = getEntryStream(zf, fstabPath).readBytes().toString(StandardCharsets.UTF_8) + log.debug(rs) + rs.lines().forEach rs@{ line -> + val item = line.trim() + if (item.isEmpty() || item.startsWith("#")) { + log.debug("ignore empty/comment line") + return@rs + } + val pieces = item.split("\\s+".toRegex()) + if (pieces.size != 5) { + throw IllegalArgumentException("malformed recovery.fstab line: [$item]") + } + if (pieces[4].contains("voldmanaged=")) { + log.info("Ignore entries that are managed by vold: [$item]") + return@rs + } + val lengthOption = pieces[4].split(",").filter { it.startsWith("length=") } + val length = when (lengthOption.size) { + 0 -> 0 + 1 -> lengthOption[0].substring(7).toLong() + else -> throw IllegalArgumentException("multiple 'length=' in options") + } + + val mountFlags = pieces[3] + val mountContextFlags = mountFlags.split(",").filter { it.startsWith("context=") } + val context = if (mountContextFlags.size == 1) mountContextFlags[0] else "" + + ret.put(pieces[1], Partition(pieces[1], pieces[2], pieces[0], length, context)) + } + if (bSystemRoot) { + if (ret.keys.contains("/system") || !ret.keys.contains("/")) { + throw IllegalArgumentException("not allowed") + } + val systemPartition = ret.get("/") as Partition + systemPartition.mount_point = "/" + log.info("adding /system for system_as_root devices") + ret.put("/system", systemPartition) + } + } + } +} diff --git a/bbootimg/src/main/kotlin/ota/DeltaGenerator.kt b/bbootimg/src/main/kotlin/ota/DeltaGenerator.kt new file mode 100644 index 0000000..ad61a9d --- /dev/null +++ b/bbootimg/src/main/kotlin/ota/DeltaGenerator.kt @@ -0,0 +1,138 @@ +// Copyright 2022 yuyezhong@gmail.com +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +package cc.cfig.droid.ota + +import cfig.helper.Helper +import cfig.helper.ZipHelper +import chromeos_update_engine.UpdateMetadata +import org.slf4j.LoggerFactory +import java.io.File +import java.io.FileInputStream +import java.util.* +import chromeos_update_engine.UpdateMetadata.InstallOperation.Type +import java.io.ByteArrayInputStream + +class DeltaGenerator { + class ChunkProcessor( + val name: String, + val op: UpdateMetadata.InstallOperation, + val blockSize: Int, + val partFile: String, + ) { + fun ProcessChunk() { + log.info("ChunkProcessor: $name") + FileInputStream(partFile).use { fis -> + val dst0 = op.getDstExtents(0) + fis.skip(dst0.startBlock * blockSize) + val data = ByteArray((dst0.numBlocks * blockSize).toInt()) + if (data.size != fis.read(data)) { + throw RuntimeException("$name: read size != expected size") + } + val bestOp = GenerateBestFullOperation(data) + if (bestOp[0] as Boolean) { + log.info("bestType=" + bestOp[1] as Type + ", bestSize=" + bestOp[2] as Int) + } else { + throw IllegalStateException("GenerateBestFullOperation fail") + } + } + } + + companion object { + fun GenerateBestFullOperation(inData: ByteArray): Array { + val ret: Array = Array(3) { 0 } + var bestType: Type = Type.REPLACE + var bestSize: Int = inData.size + //buffer MUST be valid + if (inData.isEmpty()) { + ret[0] = false + return ret + } + //zero + if (inData.all { it.toInt() == 0 }) { + bestType = Type.ZERO + log.info("raw=${inData.size}, ZERO") + ret[0] = true + ret[1] = bestType + return ret + } + //try xz + File.createTempFile("pre", "suf").let { tempFile -> + tempFile.deleteOnExit() + ZipHelper.xz(tempFile.absolutePath, ByteArrayInputStream(inData)) + log.debug("raw=${inData.size}, xz=" + tempFile.length()) + if (bestSize > tempFile.length()) { + bestType = Type.REPLACE_XZ + bestSize = tempFile.length().toInt() + } + } + //try bz + File.createTempFile("pre", "suf").let { tempFile -> + tempFile.deleteOnExit() + ZipHelper.bzip2(tempFile.absolutePath, ByteArrayInputStream(inData)) + log.debug("raw=${inData.size}, bzip2=" + tempFile.length()) + if (bestSize > tempFile.length()) { + bestType = Type.REPLACE_BZ + bestSize = tempFile.length().toInt() + } + } + ret[0] = true + ret[1] = bestType + ret[2] = bestSize + return ret + } + } + } + + class FullPayloadGenerator { + fun GenerateOperations(partName: String, partFile: String) { + val config = Properties().apply { + put("full_chunk_size", (2 * 1024 * 1024).toInt()) + put("block_size", (4 * 1024).toInt()) + } + val fullChunkSize = config.get("full_chunk_size") as Int + val blockSize = config.get("block_size") as Int + if (fullChunkSize % blockSize != 0) { + throw IllegalArgumentException("BUG: illegal (chunk_size, block_size)=($fullChunkSize, $blockSize)") + } + val fileLen = File(partFile).length() + log.warn("fcs=$fullChunkSize, file size=$fileLen") + val partitionBlocks: Long = fileLen / blockSize + val chunkBloks: Long = (fullChunkSize / blockSize).toLong() //typically 512 + val numChunks = Helper.Companion.round_to_multiple(partitionBlocks, chunkBloks) / chunkBloks + log.warn("partitionBlocks=$partitionBlocks, numChunks=$numChunks") + for (i in 0 until numChunks) { + val startBlock = i * chunkBloks + val numBlocks = minOf(chunkBloks, partitionBlocks - i * chunkBloks) + val dstExtent = UpdateMetadata.Extent.newBuilder() + .setStartBlock(startBlock) + .setNumBlocks(numBlocks) + .build() + val op = UpdateMetadata.InstallOperation.newBuilder() + .setType(Type.REPLACE) + .addDstExtents(dstExtent) + .build() + log.info("op<${i}> $op") + ChunkProcessor("$partName-operation-${i}/$numChunks", op, blockSize, partFile).ProcessChunk() + } + } + + fun appendData() { + + } + } + + companion object { + val log = LoggerFactory.getLogger(DeltaGenerator::class.java.name) + } +} \ No newline at end of file diff --git a/bbootimg/src/main/kotlin/ota/OtaOptions.kt b/bbootimg/src/main/kotlin/ota/OtaOptions.kt new file mode 100644 index 0000000..b5b4d9d --- /dev/null +++ b/bbootimg/src/main/kotlin/ota/OtaOptions.kt @@ -0,0 +1,21 @@ +// Copyright 2022 yuyezhong@gmail.com +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +package cc.cfig.droid.ota + +data class OtaOptions( + var wipe_user_data: Boolean = false, + var skip_postinstall: Boolean = false, + var include_secondary: Boolean = false, + var downgrade: Boolean = false +) diff --git a/bbootimg/src/main/kotlin/ota/Payload.kt b/bbootimg/src/main/kotlin/ota/Payload.kt new file mode 100644 index 0000000..f3c07e7 --- /dev/null +++ b/bbootimg/src/main/kotlin/ota/Payload.kt @@ -0,0 +1,299 @@ +// Copyright 2022 yuyezhong@gmail.com +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package cc.cfig.droid.ota + +import cc.cfig.io.Struct +import cfig.helper.CryptoHelper.Hasher +import cfig.helper.Helper +import chromeos_update_engine.UpdateMetadata +import com.fasterxml.jackson.annotation.JsonInclude +import com.fasterxml.jackson.databind.ObjectMapper +import com.google.protobuf.ByteString +import org.apache.commons.exec.CommandLine +import org.apache.commons.exec.DefaultExecutor +import org.apache.commons.exec.PumpStreamHandler +import org.slf4j.LoggerFactory +import java.io.* +import java.nio.file.Files +import java.nio.file.Paths +import java.time.Instant +import java.time.ZoneId +import java.time.format.DateTimeFormatter + +class Payload { + var fileName: String = "" + var header = PayloadHeader() + var manifest: UpdateMetadata.DeltaArchiveManifest = UpdateMetadata.DeltaArchiveManifest.newBuilder().build() + var metaSig: UpdateMetadata.Signatures = UpdateMetadata.Signatures.newBuilder().build() + var metaSize: Int = 0 + var dataOffset: Long = 0L + var dataSig: UpdateMetadata.Signatures = UpdateMetadata.Signatures.newBuilder().build() + + companion object { + private val log = LoggerFactory.getLogger(Payload::class.java) + val workDir = Helper.prop("payloadDir") + + fun parse(inFileName: String): Payload { + val ret = Payload() + ret.fileName = inFileName + FileInputStream(inFileName).use { fis -> + ret.header = PayloadHeader(fis) + ret.metaSize = ret.header.headerSize + ret.header.manifestLen.toInt() + ret.dataOffset = (ret.metaSize + ret.header.metaSigLen).toLong() + //manifest + ret.manifest = ByteArray(ret.header.manifestLen.toInt()).let { buf -> + fis.read(buf) + UpdateMetadata.DeltaArchiveManifest.parseFrom(buf) + } + //meta sig + ret.metaSig = ByteArray(ret.header.metaSigLen).let { buf2 -> + fis.read(buf2) + UpdateMetadata.Signatures.parseFrom(buf2) + } + + //data sig + if (ret.manifest.hasSignaturesOffset()) { + log.debug("payload sig offset = " + ret.manifest.signaturesOffset) + log.debug("payload sig size = " + ret.manifest.signaturesSize) + fis.skip(ret.manifest.signaturesOffset) + ret.dataSig = ByteArray(ret.manifest.signaturesSize.toInt()).let { buf -> + fis.read(buf) + UpdateMetadata.Signatures.parseFrom(buf) + } + } else { + log.warn("payload has no signatures") + } + } //end-of-fis + + run {//CHECK_EQ(payload.size(), signatures_offset + manifest.signatures_size()) + val calculatedSize = ret.header.headerSize + ret.header.manifestLen + ret.header.metaSigLen + + ret.manifest.signaturesOffset + ret.manifest.signaturesSize + if (File(inFileName).length() == calculatedSize) { + log.info("payload.bin size info check PASS") + } else { + throw IllegalStateException("calculated payload size doesn't match file size") + } + } + + val calcMetadataHash = + Hasher.hash(inFileName, listOf(Pair(0L, ret.metaSize.toLong())), "sha-256") + log.info("calc meta hash: " + Helper.toHexString(calcMetadataHash)) + val calcPayloadHash = Hasher.hash( + inFileName, listOf( + Pair(0L, ret.metaSize.toLong()), + Pair(ret.metaSize.toLong() + ret.header.metaSigLen, ret.manifest.signaturesOffset) + ), "sha-256" + ) + check(calcPayloadHash.size == 32) + log.info("calc payload hash: " + Helper.toHexString(calcPayloadHash)) + + val readPayloadSignature = UpdateMetadata.Signatures.parseFrom( + Helper.readFully( + inFileName, + ret.dataOffset + ret.manifest.signaturesOffset, + ret.manifest.signaturesSize.toInt() + ) + ) + log.info("Found sig count: " + readPayloadSignature.signaturesCount) + readPayloadSignature.signaturesList.forEach { + //pass + log.info(it.data.toString()) + log.info("sig_data size = " + it.data.toByteArray().size) + log.info(Helper.toHexString(it.data.toByteArray())) + Files.write(Paths.get("sig_data"), it.data.toByteArray()) + } + + return ret + } + + class PayloadVerifier { + fun getRawHashFromSignature(sig_data: ByteString, pubkey: String, sigHash: ByteArray) { + } + } + + fun displaySignatureBlob(sigName: String, sig: UpdateMetadata.Signatures): String { + return StringBuilder().let { sb -> + sb.append(String.format("%s signatures: (%d entries)\n", sigName, sig.signaturesCount)) + sig.signaturesList.forEach { + sb.append(String.format(" hex_data: (%d bytes)\n", it.data.size())) + sb.append(" Data: " + Helper.toHexString(it.data.toByteArray()) + "\n") + } + sb + }.toString() + } + } + + fun printInfo() { + val mi = ManifestInfo(blockSize = this.manifest.blockSize, + minorVersion = this.manifest.minorVersion, + maxTimeStamp = this.manifest.maxTimestamp, + signatureOffset = this.manifest.signaturesOffset, + signatureSize = this.manifest.signaturesSize, + partialUpdate = this.manifest.hasPartialUpdate(), + partsToUpdate = this.manifest.partitionsList.map { + ManifestInfo.PartitionToUpdate( + it.partitionName, it.operationsCount, + if (it.hasRunPostinstall()) it.runPostinstall else null, + if (it.hasPostinstallPath()) it.postinstallPath else null + ) + }, + enableSnapshot = this.manifest.dynamicPartitionMetadata.hasSnapshotEnabled(), + dynamicGroups = this.manifest.dynamicPartitionMetadata.groupsList.map { + ManifestInfo.DynamicPartGroup(name = it.name, size = it.size, partName = it.partitionNamesList) + }) + ObjectMapper().writerWithDefaultPrettyPrinter().writeValue(File("$workDir/header.json"), this.header) + log.info(" header info dumped to ${workDir}header.json") + ObjectMapper().writerWithDefaultPrettyPrinter().writeValue(File("$workDir/manifest.json"), mi) + log.info(" manifest info dumped to ${workDir}manifest.json") + + val signatureFile = "${workDir}signatures.txt" + FileOutputStream(signatureFile, false).use { fos -> + fos.writer().use { fWriter -> + fWriter.write(" signatures: offset=" + this.header.manifestLen + ", size=" + this.header.metaSigLen + "\n") + fWriter.write(Payload.displaySignatureBlob("", this.metaSig)) + fWriter.write(" signatures: base= offset=" + manifest.signaturesOffset + ", size=" + this.header.metaSigLen + "\n") + fWriter.write((Payload.displaySignatureBlob("", this.dataSig))) + } + } + log.info("signature info dumped to $signatureFile") + } + + private fun decompress(inBytes: ByteArray, opType: UpdateMetadata.InstallOperation.Type): ByteArray { + val baosO = ByteArrayOutputStream() + val baosE = ByteArrayOutputStream() + val bais = ByteArrayInputStream(inBytes) + DefaultExecutor().let { exec -> + exec.streamHandler = PumpStreamHandler(baosO, baosE, bais) + val cmd = when (opType) { + UpdateMetadata.InstallOperation.Type.REPLACE_XZ -> CommandLine("xzcat") + UpdateMetadata.InstallOperation.Type.REPLACE_BZ -> CommandLine("bzcat") + UpdateMetadata.InstallOperation.Type.REPLACE -> return inBytes + else -> throw IllegalArgumentException(opType.toString()) + } + cmd.addArgument("-") + exec.execute(cmd) + } + return baosO.toByteArray() + } + + private fun unpackInternal(ras: RandomAccessFile, pu: UpdateMetadata.PartitionUpdate, logPrefix: String = "") { + log.info(String.format("[%s] extracting %13s.img (%d ops)", logPrefix, pu.partitionName, pu.operationsCount)) + FileOutputStream("$workDir/${pu.partitionName}.img").use { outFile -> + val ops = pu.operationsList.toMutableList().apply { + sortBy { it.getDstExtents(0).startBlock } + } + ops.forEach { op -> + log.debug(pu.partitionName + ": " + (op.getDstExtents(0).startBlock * this.manifest.blockSize) + ", size=" + op.dataLength) + val piece = ByteArray(op.dataLength.toInt()).let { + ras.seek(this.dataOffset + op.dataOffset) + ras.read(it) + it + } + outFile.write(decompress(piece, op.type)) + } + } + } + + fun setUp() { + File(workDir).let { + if (it.exists()) { + log.info("Removing $workDir") + it.deleteRecursively() + } + log.info("Creating $workDir") + it.mkdirs() + } + } + + fun unpack() { + RandomAccessFile(this.fileName, "r").use { ras -> + var currentNum = 1 + val totalNum = this.manifest.partitionsCount + val parts = this.manifest.partitionsList.map { it.partitionName } + log.info("There are $totalNum partitions $parts") + log.info("dumping images to $workDir") + this.manifest.partitionsList.forEach { pu -> + unpackInternal(ras, pu, String.format("%2d/%d", currentNum, totalNum)) + currentNum++ + } + } + } + + data class PayloadHeader( + var version: Long = 0, + var manifestLen: Long = 0, + var metaSigLen: Int = 0, + var headerSize: Int = 0 + ) { + private val magic = "CrAU" + private val FORMAT_STRING = ">4sqq" //magic, version, manifestLen + private val CHROMEOS_MAJOR_PAYLOAD_VERSION = 1L + private val BRILLO_MAJOR_PAYLOAD_VERSION = 2L + val typeOfVersion: String + get() = when (version) { + CHROMEOS_MAJOR_PAYLOAD_VERSION -> "chromeOs" + BRILLO_MAJOR_PAYLOAD_VERSION -> "brillo" + else -> throw IllegalArgumentException() + } + + constructor(fis: InputStream) : this() { + val info = Struct(FORMAT_STRING).unpack(fis) + check((info[0] as String) == magic) { "${info[0]} is not payload magic" } + version = info[1] as Long + manifestLen = info[2] as Long + headerSize = Struct(FORMAT_STRING).calcSize() + + if (version == BRILLO_MAJOR_PAYLOAD_VERSION) { + headerSize += Int.SIZE_BYTES + metaSigLen = Struct(">i").unpack(fis)[0] as Int + } + } + } + + @JsonInclude(JsonInclude.Include.NON_NULL) + data class ManifestInfo( + var blockSize: Int? = null, + var minorVersion: Int? = null, + var maxTimeStamp: Long = 0L, + var maxTimeReadable: String? = null, + var partialUpdate: Boolean? = null, + val signatureOffset: Long? = null, + val signatureSize: Long? = null, + var dynamicGroups: List = listOf(), + var enableSnapshot: Boolean? = null, + var partsToUpdate: List = listOf() + ) { + init { + val ldt = Instant.ofEpochMilli(maxTimeStamp * 1000) + .atZone(ZoneId.systemDefault()) + .toLocalDateTime() + maxTimeReadable = DateTimeFormatter.ISO_LOCAL_DATE_TIME.format(ldt) + " (${ZoneId.systemDefault()})" + } + + @JsonInclude(JsonInclude.Include.NON_NULL) + data class PartitionToUpdate( + var name: String = "", + var ops: Int = 0, + var runPostInstall: Boolean? = null, + var postInstallPath: String? = null + ) + + data class DynamicPartGroup( + var name: String = "", + var size: Long = 0L, + var partName: List = listOf() + ) + } +} diff --git a/bbootimg/src/main/kotlin/ota/PayloadGenerator.kt b/bbootimg/src/main/kotlin/ota/PayloadGenerator.kt new file mode 100644 index 0000000..bb4ef1d --- /dev/null +++ b/bbootimg/src/main/kotlin/ota/PayloadGenerator.kt @@ -0,0 +1,247 @@ +// Copyright 2022 yuyezhong@gmail.com +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +package cc.cfig.droid.ota + +import cc.cfig.io.Struct +import cfig.helper.Helper.Companion.check_call +import cfig.helper.ZipHelper.Companion.dumpEntry +import org.apache.commons.compress.archivers.zip.ZipFile +import org.slf4j.LoggerFactory +import java.io.File +import java.io.FileInputStream +import java.io.FileOutputStream +import java.nio.file.Files +import java.nio.file.Paths +import java.nio.file.StandardOpenOption +import java.util.* +import kotlin.system.exitProcess + +@OptIn(ExperimentalUnsignedTypes::class) +class PayloadGenerator { + private val log = LoggerFactory.getLogger(PayloadGenerator::class.java) + val workDir = "build/staging_ota" + val signedPayload = "$workDir/signed-payload.bin" + val propertiesFile = "$workDir/payload-properties.txt" + + fun generate(maxTs: String, targetFile: String, payload: String) { + ("brillo_update_payload generate" + + " --max_timestamp $maxTs" + + " --target_image $targetFile" + + " --payload $payload").check_call() + } + + fun sign(inSigner: PayloadSigner, options: OtaOptions) { + // 1. Generate hashes of the payload and metadata files + ("brillo_update_payload hash" + + " --unsigned_payload $workDir/payload.bin" + + " --signature_size " + inSigner.keySize + + " --metadata_hash_file $workDir/meta.hash" + + " --payload_hash_file $workDir/payload.hash").check_call() + + // 2. Sign the hashes. + inSigner.sign("$workDir/meta.hash", "$workDir/signed-meta.hash") + inSigner.sign("$workDir/payload.hash", "$workDir/signed-payload.hash") + + // 3. Insert the signatures back into the payload file. + ("brillo_update_payload sign" + + " --unsigned_payload $workDir/payload.bin" + + " --payload $signedPayload" + + " --signature_size " + inSigner.keySize + + " --metadata_signature_file $workDir/signed-meta.hash" + + " --payload_signature_file $workDir/signed-payload.hash").check_call() + + // 4. Dump the signed payload properties. + ("brillo_update_payload properties" + + " --payload $signedPayload" + + " --properties_file $propertiesFile").check_call() + + // 5. + if (options.wipe_user_data) { + FileOutputStream(propertiesFile, true).use { + it.write("POWERWASH=1\n".toByteArray()) + } + } + options.include_secondary.let { includeSec -> + if (includeSec) { + FileOutputStream(propertiesFile, true).use { + it.write("SWITCH_SLOT_ON_REBOOT=0\n".toByteArray()) + } + } + } + } + + fun tryToDumpEntry(inputFile: ZipFile, entryItem: String, outFile: String) { + val entry = inputFile.getEntry(entryItem) + if (entry != null) { + inputFile.dumpEntry(entry.name, File(outFile)) + } else { + log.info("$entryItem not found") + } + } + + fun generateMine(maxTs: String, inTargetFile: String, payload: String, infoDict: Properties) { + val targetFile = ZipFile(inTargetFile) + val abPartitions = + String(targetFile.getInputStream(targetFile.getEntry("META/ab_partitions.txt")).readBytes()) + .lines().filter { it.isNotBlank() } + log.info("Dumping ${abPartitions.size} images from target file ...") + + abPartitions.forEach { part -> + val partEntryName = listOfNotNull( + targetFile.getEntry("IMAGES/$part.img"), targetFile.getEntry("RADIO/$part.img") + ) + .let { parts -> + if (parts.size != 1) { + log.error("Found multiple images for partition $part") + exitProcess(1) + } + parts[0].name + } + //dump image + targetFile.dumpEntry(partEntryName, File("$workDir/$part.img")) + + run {//unsparse image + Struct(">I").unpack(FileInputStream("$workDir/$part.img")).let { fileHeader -> + if (fileHeader[0] as UInt == 0x3aff26ed.toUInt()) { + log.debug("$part is sparse, convert to raw image") + "simg2img $workDir/$part.img $workDir/tmp.img".check_call() + File("$workDir/tmp.img").renameTo(File("$workDir/$part.img")) + } + } + } + + run {//dump map file + val mapFile = targetFile.getEntry(partEntryName.replace(".img", ".map")) + if (mapFile != null) { + log.debug("$part.map found, dump it to $workDir/$part.map") + targetFile.dumpEntry(mapFile.name, File("$workDir/$part.map")) + } else { + log.debug("$part.map not found") + } + } + File("$workDir/$part.img").let { partFile -> + val partSize = partFile.length() + if (partSize % 4096 != 0L) { + log.info("Padding $workDir/$part.img ...") + Files.write( + Paths.get("$workDir/$part.img"), + ByteArray(4096 - (partSize % 4096).toInt()), + StandardOpenOption.APPEND + ) + } + } + } + targetFile.dumpEntry("META/postinstall_config.txt", File("$workDir/postinstall_config.txt")) + targetFile.dumpEntry("META/dynamic_partitions_info.txt", File("$workDir/dynamic_partitions_info.txt")) + tryToDumpEntry(targetFile, "META/apex_info.pb", "$workDir/apex_info.pb") + targetFile.close() + + data class DeltaGenParam( + var partitionNames: String = "", + var newImages: String = "", + var newMapFiles: String = "", + var newPostInstallConfig: String = "", + var dynamicPartitionInfo: String = "", + var apexInfoFile: String = "", + var partitionTimeStamps: String = "", + ) + + //partition timestamps + val pTs: MutableList> = mutableListOf() + Common.PARTITIONS_WITH_BUILD_PROP.forEach { it -> + val item: Pair = Pair(it, + when (it) { + "boot" -> { + log.info("boot:" + infoDict.get("$it.build.prop") as Properties) + (infoDict.get("$it.build.prop") as Properties).getProperty("ro.${it}image.build.date.utc") + } + else -> (infoDict.get("$it.build.prop") as Properties).getProperty("ro.${it}.build.date.utc") + }) + if (item.second != null) { + pTs.add(item as Pair) + } + } + + val dp = DeltaGenParam().apply { + partitionNames = abPartitions.reduce { acc, s -> "$acc:$s" } + newImages = abPartitions.map { "$workDir/$it.img" }.reduce { acc, s -> "$acc:$s" } + newMapFiles = abPartitions + .map { if (File("$workDir/$it.map").exists()) "$workDir/$it.map" else "" } + .reduce { acc, s -> "$acc:$s" } + newPostInstallConfig = "$workDir/postinstall_config.txt" + dynamicPartitionInfo = "$workDir/dynamic_partitions_info.txt" + if (File("$workDir/apex_info.pb").exists()) { + apexInfoFile = "$workDir/apex_info.pb" + } + partitionTimeStamps = pTs.map { it.first + ":" + it.second }.reduce { acc, s -> "$s,$acc" } + } + + ("delta_generator" + + " --out_file=$payload" + + " --partition_names=${dp.partitionNames}" + + " --new_partitions=${dp.newImages}" + + " --new_mapfiles=${dp.newMapFiles}" + + " --major_version=2" + + " --max_timestamp=$maxTs" + + " --partition_timestamps=${dp.partitionTimeStamps}" + + " --new_postinstall_config_file=${dp.newPostInstallConfig}" + + " --dynamic_partition_info_file=${dp.dynamicPartitionInfo}" + + if (dp.apexInfoFile.isNotBlank()) " --apex_info_file=${dp.apexInfoFile}" else "" + ).check_call() + } + + fun signMine(inSigner: PayloadSigner, options: OtaOptions) { + //1: hash and meta of payload + ("delta_generator" + + " --in_file=$workDir/payload.bin.mine" + + " --signature_size=${inSigner.keySize}" + + " --out_hash_file=$workDir/payload.hash.mine" + + " --out_metadata_hash_file=$workDir/meta.hash.mine").check_call() + //Helper.assertFileEquals("$workDir/meta.hash", "$workDir/meta.hash.mine") + //Helper.assertFileEquals("$workDir/payload.hash", "$workDir/payload.hash.mine") + + //2: sign hash and meta + inSigner.sign("$workDir/meta.hash.mine", "$workDir/signed-meta.hash.mine") + inSigner.sign("$workDir/payload.hash.mine", "$workDir/signed-payload.hash.mine") + //Helper.assertFileEquals("$workDir/signed-meta.hash", "$workDir/signed-meta.hash.mine") + //Helper.assertFileEquals("$workDir/payload.hash", "$workDir/payload.hash.mine") + + //3: hash, meta, payload.bin -> signed-payload.bin + ("delta_generator" + + " --in_file=$workDir/payload.bin.mine" + + " --signature_size=" + inSigner.keySize + + " --payload_signature_file=$workDir/signed-payload.hash.mine" + + " --metadata_signature_file=$workDir/signed-meta.hash.mine" + + " --out_file=$signedPayload.mine").check_call() + //Helper.assertFileEquals(signedPayload, "$signedPayload.mine") + + //4: payload-properties.txt + ("delta_generator" + + " --in_file=$signedPayload.mine" + + " --properties_file=$propertiesFile.mine").check_call() + //Helper.assertFileEquals(propertiesFile, "$propertiesFile.mine") + + // 5: payload-properties.txt appending + if (options.wipe_user_data) { + FileOutputStream(propertiesFile, true).use { + it.write("POWERWASH=1\n".toByteArray()) + } + } + if (options.include_secondary) { + FileOutputStream(propertiesFile, true).use { + it.write("SWITCH_SLOT_ON_REBOOT=0\n".toByteArray()) + } + } + } +} diff --git a/bbootimg/src/main/kotlin/ota/PayloadSigner.kt b/bbootimg/src/main/kotlin/ota/PayloadSigner.kt new file mode 100644 index 0000000..fbd342f --- /dev/null +++ b/bbootimg/src/main/kotlin/ota/PayloadSigner.kt @@ -0,0 +1,62 @@ +// Copyright 2022 yuyezhong@gmail.com +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +package cc.cfig.droid.ota + +import org.apache.commons.exec.CommandLine +import org.apache.commons.exec.DefaultExecutor +import org.slf4j.LoggerFactory +import java.io.File + +class PayloadSigner { + private val log = LoggerFactory.getLogger(PayloadSigner::class.java) + var keySize = 0 + private val workDir = "build/staging_ota" + val signingKey = "signing.key" + val privKey = "aosp/security/testkey.pk8" + val modulusFile = "$workDir/modulus.file" + + init { + CommandLine.parse("openssl pkcs8 -in $privKey -inform DER -nocrypt -out $workDir/$signingKey").let { cmd -> + log.info(cmd.toString()) + DefaultExecutor().execute(cmd) + } + + CommandLine.parse("openssl rsa -inform PEM -in $workDir/$signingKey -modulus -noout -out $modulusFile").let { cmd -> + log.info(cmd.toString()) + DefaultExecutor().execute(cmd) + } + + val modulusString = File(modulusFile).readText() + log.info(modulusString) + val MODULUS_PREFIX = "Modulus=" + if (!modulusString.startsWith(MODULUS_PREFIX)) { + throw IllegalArgumentException("Invalid modulus string") + } + keySize = modulusString.substring(MODULUS_PREFIX.length).length / 2 + log.info("key size = $keySize bytes") + if (keySize !in listOf(256, 512)) { + throw IllegalArgumentException("Unsupported key size") + } + } + + fun sign(inFile: String, outFile: String) { + CommandLine.parse("openssl pkeyutl -sign").let { cmd -> + cmd.addArguments("-inkey $workDir/$signingKey -pkeyopt digest:sha256") + cmd.addArguments("-in $inFile") + cmd.addArguments("-out $outFile") + log.info(cmd.toString()) + DefaultExecutor().execute(cmd) + } + } +} diff --git a/bbootimg/src/main/kotlin/packable/PackableLauncher.kt b/bbootimg/src/main/kotlin/packable/PackableLauncher.kt index 0ff89ce..ee667fe 100644 --- a/bbootimg/src/main/kotlin/packable/PackableLauncher.kt +++ b/bbootimg/src/main/kotlin/packable/PackableLauncher.kt @@ -28,7 +28,7 @@ class PackableLauncher fun main(args: Array) { val log = LoggerFactory.getLogger(PackableLauncher::class.java) val packablePool = mutableMapOf, KClass>() - listOf(DtboParser(), VBMetaParser(), BootImgParser(), SparseImgParser(), VendorBootParser()).forEach { + listOf(DtboParser(), VBMetaParser(), BootImgParser(), SparseImgParser(), VendorBootParser(), PayloadBinParser()).forEach { @Suppress("UNCHECKED_CAST") packablePool.put(it.capabilities(), it::class as KClass) } diff --git a/bbootimg/src/main/kotlin/packable/PayloadBinParser.kt b/bbootimg/src/main/kotlin/packable/PayloadBinParser.kt new file mode 100644 index 0000000..7495610 --- /dev/null +++ b/bbootimg/src/main/kotlin/packable/PayloadBinParser.kt @@ -0,0 +1,52 @@ +// Copyright 2022 yuyezhong@gmail.com +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package cfig.packable + +import cc.cfig.droid.ota.Payload +import org.slf4j.LoggerFactory + +class PayloadBinParser : IPackable { + override val loopNo: Int = 0 + private val log = LoggerFactory.getLogger(PayloadBinParser::class.java) + override fun capabilities(): List { + return listOf("^payload\\.bin$") + } + + override fun unpack(fileName: String) { + cleanUp() + Payload.parse(fileName).let { pl -> + pl.setUp() + pl.printInfo() + pl.unpack() + } + } + + override fun pack(fileName: String) { + } + + override fun `@verify`(fileName: String) { + super.`@verify`(fileName) + } + + override fun pull(fileName: String, deviceName: String) { + super.pull(fileName, deviceName) + } + + fun clean(fileName: String) { + } + + override fun flash(fileName: String, deviceName: String) { + } +} diff --git a/bbootimg/src/main/resources/general.cfg b/bbootimg/src/main/resources/general.cfg index 08a9b67..a2343b8 100644 --- a/bbootimg/src/main/resources/general.cfg +++ b/bbootimg/src/main/resources/general.cfg @@ -9,3 +9,4 @@ kernelConfigFile = build/unzip_boot/kernel_configs.txt kernelExtracter = aosp/build/tools/extract_kernel.py mkbootimg = aosp/system/tools/mkbootimg/mkbootimg.py dtboMaker = aosp/system/libufdt/utils/src/mkdtboimg.py +payloadDir = build/payload/ diff --git a/build.gradle.kts b/build.gradle.kts index ad82c0d..67b6112 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -36,7 +36,7 @@ tasks { group = GROUP_ANDROID main = "cfig.packable.PackableLauncherKt" classpath = files("bbootimg/build/libs/bbootimg.jar") - this.maxHeapSize = "512m" + this.maxHeapSize = "128m" enableAssertions = true args("unpack") } diff --git a/helper/src/main/kotlin/cfig/helper/CryptoHelper.kt b/helper/src/main/kotlin/cfig/helper/CryptoHelper.kt index dcfc1cf..d8f47ef 100644 --- a/helper/src/main/kotlin/cfig/helper/CryptoHelper.kt +++ b/helper/src/main/kotlin/cfig/helper/CryptoHelper.kt @@ -11,10 +11,7 @@ import org.apache.commons.exec.PumpStreamHandler import org.bouncycastle.pkcs.PKCS10CertificationRequest import org.bouncycastle.util.io.pem.PemReader import org.slf4j.LoggerFactory -import java.io.ByteArrayInputStream -import java.io.ByteArrayOutputStream -import java.io.IOException -import java.io.InputStreamReader +import java.io.* import java.math.BigInteger import java.math.RoundingMode import java.security.KeyFactory @@ -36,6 +33,7 @@ class CryptoHelper { PEM, //header + metadata + base64 der DER, // der format } + class KeyBox(val fmt: KeyFormat, val clazz: KClass<*>, val key: Any) { companion object { fun parse4(data: ByteArray): KeyBox { @@ -231,6 +229,53 @@ class CryptoHelper { fun sha256(inData: ByteArray): ByteArray { return MessageDigest.getInstance("SHA-256").digest(inData) } + + //fun hash(file: String, algorithm: String): ByteArray { + // val md = MessageDigest.getInstance(algorithm) + // FileInputStream(file).use { fis -> + // val buffer = ByteArray(1024 * 1024) + // while (true) { + // val bytesRead = fis.read(buffer) + // if (bytesRead <= 0) break + // md.update(buffer, 0, bytesRead) + // } + // } + // return md.digest() + //} + fun hash(file: String, algorithm: String): ByteArray { + return hash(file, listOf(Pair(0, File(file).length())), algorithm) + } + + fun hash(file: String, coordinates: List>, algorithm: String): ByteArray { + require(coordinates.isNotEmpty()) + coordinates.forEach { + require(it.first >= 0 && it.second > 0) + } + return MessageDigest.getInstance(algorithm).let { md -> + coordinates.forEach { coordinate -> + FileInputStream(file).use { fis -> + fis.skip(coordinate.first) + val ibs = 1024 * 1024 + val buffer = ByteArray(ibs) + var bytesRemaining = coordinate.second + while (bytesRemaining > 0) { + log.debug("Remain $bytesRemaining, reading ...") + val bytesRead = fis.read(buffer) + if (bytesRemaining > ibs) { + check(bytesRead == ibs) + md.update(buffer, 0, bytesRead) + } else { + check(bytesRead >= bytesRemaining) + md.update(buffer, 0, bytesRemaining.toInt()) + } + bytesRemaining -= bytesRead + log.debug("Read $bytesRead, remain $bytesRemaining") + } + } + } + md + }.digest() + } } } diff --git a/helper/src/main/kotlin/cfig/helper/Helper.kt b/helper/src/main/kotlin/cfig/helper/Helper.kt index 4ccdceb..d87c05f 100644 --- a/helper/src/main/kotlin/cfig/helper/Helper.kt +++ b/helper/src/main/kotlin/cfig/helper/Helper.kt @@ -132,7 +132,7 @@ class Helper { } } - fun round_to_multiple(size: Long, page: Int): Long { + fun round_to_multiple(size: Long, page: Long): Long { val remainder = size % page return if (remainder == 0L) { size @@ -154,17 +154,6 @@ class Helper { return 2.0.pow((num - 1).toBigInteger().bitLength().toDouble()).toLong() } - fun pyAlg2java(alg: String): String { - return when (alg) { - "sha1" -> "sha-1" - "sha224" -> "sha-224" - "sha256" -> "sha-256" - "sha384" -> "sha-384" - "sha512" -> "sha-512" - else -> throw IllegalArgumentException("unknown algorithm: [$alg]") - } - } - fun dumpToFile(dumpFile: String, data: ByteArray) { log.info("Dumping data to $dumpFile ...") FileOutputStream(dumpFile, false).use { fos -> diff --git a/helper/src/main/kotlin/cfig/helper/ZipHelper.kt b/helper/src/main/kotlin/cfig/helper/ZipHelper.kt index 70767e3..f82fdf5 100644 --- a/helper/src/main/kotlin/cfig/helper/ZipHelper.kt +++ b/helper/src/main/kotlin/cfig/helper/ZipHelper.kt @@ -22,6 +22,8 @@ import org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream import org.apache.commons.compress.archivers.zip.ZipArchiveInputStream import org.apache.commons.compress.archivers.zip.ZipFile import org.apache.commons.compress.archivers.zip.ZipMethod +import org.apache.commons.compress.compressors.bzip2.BZip2CompressorInputStream +import org.apache.commons.compress.compressors.bzip2.BZip2CompressorOutputStream import org.apache.commons.compress.compressors.gzip.GzipCompressorOutputStream import org.apache.commons.compress.compressors.gzip.GzipParameters import org.apache.commons.compress.compressors.lzma.LZMACompressorInputStream @@ -428,5 +430,31 @@ class ZipHelper { } log.info("compress(gz) done: $compressedFile") } - } + + fun isBzip2(compressedFile: String): Boolean { + return try { + FileInputStream(compressedFile).use { fis -> + BZip2CompressorInputStream(fis).use { } + } + true + } catch (e: IOException) { + false + } + } + + fun bzip2(compressedFile: String, fis: InputStream) { + log.info("Compress(bzip2) ... ") + FileOutputStream(compressedFile).use { fos -> + BZip2CompressorOutputStream(fos).use { zos -> + val buffer = ByteArray(1024) + while (true) { + val bytesRead = fis.read(buffer) + if (bytesRead <= 0) break + zos.write(buffer, 0, bytesRead) + } + } + } + log.info("compress(bzip2) done: $compressedFile") + } + } // end-of-companion }